ITPub博客

首页 > Linux操作系统 > Linux操作系统 > [zz]Oracle EBS API: 采购订单承诺日期更改示例

[zz]Oracle EBS API: 采购订单承诺日期更改示例

原创 Linux操作系统 作者:idoo 时间:2009-11-30 16:48:20 0 删除 编辑

Oracle EBS API: 采购订单承诺日期更改示例(PO promise date updated with API )


本示例中, 采用PO模块的API, 实现订单行的送货承诺日期更改.  对其进行改动和扩展, 可实现对PO其他数据的更改.

    l_result_num := PO_CHANGE_API1_S.UPDATE_PO (
                                     X_PO_NUMBER        => p_po_num,
                                     X_RELEASE_NUMBER  => p_release_num,
                                     X_REVISION_NUMBER        => l_revision_num,
                                     X_LINE_NUMBER  => p_line_num,
                                     X_SHIPMENT_NUMBER        => p_shipment_num,
                                     NEW_QUANTITY  => NULL,
                                     NEW_PRICE   => NULL,
                                     NEW_PROMISED_DATE        => p_new_promised,
                                     LAUNCH_APPROVALS_FLAG => ‘Y’,
                                     UPDATE_SOURCE  => NULL,
                                     VERSION   => 1.0,
                                     X_OVERRIDE_DATE  => NULL,
                                     X_API_ERRORS             => l_po_error_rec,
                                     p_BUYER_NAME             => NULL
                                     );

 详细代码请查看附件. PO updated with API


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


create or replace package sg_po_update is


PROCEDURE update_promise_date(p_po_num IN VARCHAR2,
p_release_num IN NUMBER,
p_line_num IN VARCHAR2,
p_shipment_num IN VARCHAR2,
p_new_promised IN DATE,
p_comments IN VARCHAR2
);


FUNCTION get_original_promise_date(po_line_location_id IN NUMBER)
RETURN DATE;



end sg_po_update;
/
create or replace package body sg_po_update is


PROCEDURE update_promise_date(p_po_num IN VARCHAR2,
p_release_num IN NUMBER,
p_line_num IN VARCHAR2,
p_shipment_num IN VARCHAR2,
p_new_promised IN DATE,
p_comments IN VARCHAR2 )
AS
l_result_num NUMBER := NULL;
l_revision_num NUMBER;
l_po_error_rec PO_API_ERRORS_REC_TYPE;
l_user_id NUMBER;

BEGIN
l_user_id := fnd_profile.value('USER_ID');
fnd_global.apps_initialize(l_user_id, 50578, 201); --user_id, resp_id, resp_appl_id

IF p_release_num IS NULL THEN
SELECT pha.revision_num
INTO l_revision_num
FROM po.po_headers_all pha
WHERE pha.segment1 = p_po_num
AND ROWNUM = 1;
ELSE
SELECT pra.release_num
INTO l_revision_num
FROM po.po_headers_all pha,
po.po_releases_all pra
WHERE pha.segment1 = p_po_num
AND pra.release_num = p_release_num
AND ROWNUM = 1;
END IF;

l_result_num := PO_CHANGE_API1_S.UPDATE_PO (
X_PO_NUMBER => p_po_num,
X_RELEASE_NUMBER => p_release_num,
X_REVISION_NUMBER => l_revision_num,
X_LINE_NUMBER => p_line_num,
X_SHIPMENT_NUMBER => p_shipment_num,
NEW_QUANTITY => NULL,
NEW_PRICE => NULL,
NEW_PROMISED_DATE => p_new_promised,
LAUNCH_APPROVALS_FLAG => 'Y',
UPDATE_SOURCE => NULL,
VERSION => 1.0,
X_OVERRIDE_DATE => NULL,
X_API_ERRORS => l_po_error_rec,
p_BUYER_NAME => NULL
);
COMMIT;

EXCEPTION
WHEN OTHERS THEN
NULL;
END update_promise_date;


FUNCTION get_original_promise_date(po_line_location_id IN NUMBER)
RETURN DATE
IS
BEGIN

RETURN sysdate;

END get_original_promise_date;

END sg_po_update;
/


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/318394/viewspace-621032/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-04-13

  • 博文量
    13
  • 访问量
    35598