API to update purchase order in oracle apps.api to update po_lines_all
In this post , I am sharing the API to update purchase order in oracle apps. Oracle has provided the common API to update purchase order lines , headers and the distributions data. With this API we can Update PO_LINES_ALL , PO_HEAERS_ALL , PO_DISTRIBUTIONS_ALL.
API to update po_lines_all
API to update po headers_all
API to update po_line_locations_all
API to update po_distributions_all
v_result NUMBER;
v_api_errors po_api_errors_rec_type;
v_revision_num po_headers_all.revision_num%TYPE;
v_price
po_lines_all.unit_price%TYPE;
v_quantity po_line_locations_all.quantity%TYPE;
v_po_number po_headers_all.segment1%TYPE;
v_line_num po_lines_all.line_num%TYPE;
v_shipment_num po_line_locations_all.shipment_num%TYPE;
v_promised_date DATE;
v_need_by_date DATE;
v_org_id NUMBER;
v_context VARCHAR2(10);
BEGIN
v_context := set_context ('&user', '&responsibility', 2038);
IF v_context = 'F'
THEN
DBMS_OUTPUT.PUT_LINE ('Error in the context');
END IF;
MO_GLOBAL.INIT ('PO');
v_po_number :=’10000678’;
v_line_num := 1;
v_shipment_num := 1;
v_revision_num := 0;
v_promised_date := '01-APR-2016';
v_need_by_date := '11-MAY-2016';
v_quantity := 456;
v_price := 12;
v_org_id := 85;
DBMS_OUTPUT.put_line ('Calling API To Update PO');
v_result :=
PO_CHANGE_API1_S.UPDATE_PO
(x_po_number
=> v_po_number,
x_release_number => NULL,
x_revision_number => v_revision_num,
x_line_number => v_line_num,
x_shipment_number => v_shipment_num,
new_quantity => v_quantity,
new_price =>
v_price,
new_promised_date => v_promised_date,
new_need_by_date => v_need_by_date,
launch_approvals_flag=> 'Y',
update_source => NULL,
VERSION
=> '1.0',
x_override_date => NULL,
x_api_errors => v_api_errors,
p_buyer_name => NULL,
p_secondary_quantity => NULL,
p_preferred_grade => NULL,
p_org_id
=> v_org_id
);
DBMS_OUTPUT.put_line ('RESULT :' ||v_result);
IF (v_result = 1)
THEN
DBMS_OUTPUT.put_line('Updating PO is Successful ');
ELSE
DBMS_OUTPUT.put_line ('Updating PO failed');
FOR j IN 1 .. v_api_errors.MESSAGE_TEXT.COUNT
LOOP
DBMS_OUTPUT.put_line (v_api_errors.MESSAGE_TEXT (j));
END LOOP;
END IF;
END;
0 comments:
Post a Comment