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;

原文地址:https://www.cnblogs.com/jenrry/p/10006761.html

时间: 2024-10-09 22:59:17

Oracle EBS PO采购订单更新的相关文章

Oracle EBS 中直发订单Drop Ship流程的系统操作记录

Oracle EBS 中直发订单Drop Ship流程的系统操作记录 应用场景: A公司向客户B销售产品,但是自己不生产该产品,而是向供应商C来采购,并且通常是要供应商C直接把货发到B客户处,属于贸易型企业经常用到的业务流程,有些集团公司下的子公司销售业务也用这种方式. 在实际业务中,并非所有的销售都是企业内部发出的,为了节约成本.提高周转效率.甚至应急销售,企业往往将外部企业也作为自己销售供货的来源之一,通过采购后直接发货的方式,将其他企业的货物直接销往自己的客户.这种销售业务模式,系统中称之

Oracle EBS-SQL (PO-5):采购订单控制信息查询.sql

select distinct pla.po_header_id, --pha.type_lookup_code, pha.segment1       采购订单号, appf.full_name            采购员, pla.line_num               订单行, msi.segment1          物料编码, pla.item_description 物料说明, case when pha.Authorization_Status='APPROVED' th

Oracle EBS发放销售订单

 模拟发放销售订单界面进行发放操作 PROCEDURE insert_row(x_batch_id OUT NUMBER) IS l_autopack_flag VARCHAR2(1 ); l_autopack_level NUMBER; l_release_method VARCHAR2(1 ); l_release_online VARCHAR2(240 ) := fnd_profile.value('SHP_PICK_RELEASE_ONLINE' ); --bugfix 118302

Oracle EBS PO退货失败

无法读取例程 &ROUTINE 中配置文件选项 INV_DEBUG_TRACE 的值. 系统-配置文件-地点层 INC%调试%踪 是 select *  from po_interface_errors a order by a.creation_date desc; RVTTH-192.rvtthins:子例行程序 PO_INVALID_REL_SHIPMENT_STATUS 返回的错误 原因:子例行程序 PO_INVALID_REL_SHIPMENT_STATUS 返回时出现内部错误. 措施

Oracle EBS OM 登记订单

DECLARE l_header_rec OE_ORDER_PUB.Header_Rec_Type; l_line_tbl OE_ORDER_PUB.Line_Tbl_Type; l_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type; l_header_adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type; l_line_adj_tbl OE_ORDER_PUB.line_adj_tbl_Type; l_header_s

Oracle EBS OM 发放订单

DECLARE l_header_rec OE_ORDER_PUB.Header_Rec_Type; l_line_tbl OE_ORDER_PUB.Line_Tbl_Type; l_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type; l_header_adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type; l_line_adj_tbl OE_ORDER_PUB.line_adj_tbl_Type; l_header_s

Oracle EBS OM 保留订单

DECLARE l_header_rec OE_ORDER_PUB.Header_Rec_Type; l_line_tbl OE_ORDER_PUB.Line_Tbl_Type; l_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type; l_header_adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type; l_line_adj_tbl OE_ORDER_PUB.line_adj_tbl_Type; l_header_s

Oracle EBS OM 取消订单

DECLARE l_header_rec OE_ORDER_PUB.Header_Rec_Type; l_line_tbl OE_ORDER_PUB.Line_Tbl_Type; l_action_request_tbl OE_ORDER_PUB.Request_Tbl_Type; l_header_adj_tbl OE_ORDER_PUB.Header_Adj_Tbl_Type; l_line_adj_tbl OE_ORDER_PUB.line_adj_tbl_Type; l_header_s

Oracle EBS 采购 接收入库 接口开发

http://blog.itpub.net/25164132/viewspace-746657/ 接收入库是项目中会经常碰到的开发,这类开发一般来说比较简单,但是接收入库在Oracle中其实涉及到很多模块,其中层次较多,也可以做得比较复杂.本文将尽可能深入细致地讨论接收入库的流程,种类,数据来源,数据的流动路径,以及各个数据点之间的对应关系.最后将给出一个较为全面的接收入库的样例代码.接收入库的种类接收入库可以按照数据来源分为2种:1.         对于po订单以及发放的接收入库:2.