zoukankan      html  css  js  c++  java
  • Oracle EBS PO采购订单更新

    DECLARE
            l_result             NUMBER;
            l_progress             NUMBER;
            l_errors              PO_API_ERRORS_REC_TYPE;
            l_chg                 PO_CHANGES_REC_TYPE;
            l_shipment_changes          PO_SHIPMENTS_REC_TYPE;
            l_return_status       VARCHAR2(30);
    
         BEGIN
    
              fnd_global.apps_initialize(user_id => &user_id,-- This function execution is required before launching the approval work flow.
                                         resp_id => &responsibility_id,
                                         resp_appl_id => &resp_application_id);
    
            --to set org context in a R12 env
           mo_global.set_policy_context ('S', &org_id);
    
            -- Create an Object for Changes
            -- po_changes_rec_type constructor takes either po_header_id OR po_release_id to construct the object. 
            -- In case of purchase order pass po_release_id as NULL.
            
            l_chg := po_changes_rec_type.Create_object(p_po_header_id => <header id>, p_po_release_id => <release id>);
    
            -- Add a Line Changes to the Change Object
            l_chg.line_changes.add_change(p_po_line_id => <po line id>, p_quantity  => <value>);
    
            -- Add Shipment Changes to the Change Object
            l_chg.shipment_changes.add_change(p_po_line_location_id => <line location id>, p_quantity  => <value>);
    
            -- Add Distribution Level Changes
            l_chg.distribution_changes.add_change(p_po_distribution_id => <po distribution id>, p_quantity_ordered  => <value>);
    
    
            -- Now call the change api to execute the above changes
            PO_DOCUMENT_UPDATE_GRP.UPDATE_DOCUMENT(p_api_version => 1.0,-- pass this as 1.0
                                                   p_init_msg_list => fnd_api.G_TRUE,-- pass this as TRUE
                                                   x_return_status => l_return_status,-- returns the result of execution
                                                   p_changes => l_chg,-- changes obj. contains all changes intended to be made on document
                                                   p_run_submission_checks => fnd_api.G_FALSE,-- set to TRUE if want to perform submission check
                                                   p_launch_approvals_flag => fnd_api.G_TRUE,-- set to TRUE if want to launch approval work flow after making the changes
                                                   p_buyer_id => NULL,-- buyer id
                                                   p_update_source => NULL,    -- name of a source who is calling this API. In case of manual call can be passed as NULL
                                                   p_override_date => NULL, 
                                                   x_api_errors => l_errors,-- list of errors if any occurred in execution
                                                   p_mass_update_releases => NULL);    
                                                   
                                                    
            IF l_errors IS NOT NULL THEN
            
              FOR i IN 1.. l_errors.message_text.COUNT LOOP
                dbms_output.Put_line(' Error is ' || l_errors.Message_text(i) || ' - name' || l_errors.Message_name(i));
              END LOOP;
            END IF;
    
            COMMIT;
    
         EXCEPTION
         
           WHEN OTHERS THEN
              dbms_output.Put_line('error :' || sqlerrm);
    
         END;
    土豆君
  • 相关阅读:
    深度学习GPU集群管理软件 OpenPAI 简介
    图片加数字盲水印
    Kubernetes核心概念简介
    一文详解 Linux 系统常用监控工具(top,htop,iotop,iftop)
    【OfficeWebViewer】在线预览Word,Excel~
    【Java】大文本字符串滤重的简单方案
    Java应用集群下的定时任务处理方案(mysql)
    《将博客搬至CSDN》
    [转]Fiddler抓取Android真机上的HTTPS包
    [Java Collection]List分组之简单应用.
  • 原文地址:https://www.cnblogs.com/jenrry/p/10006761.html
Copyright © 2011-2022 走看看