Oracle inv-so Line Backorder API

Source: Internet
Author: User

--sales Order Lines to backorder API
--===================================
--set serveroutput on size 1000000
DECLARE

L_return_status VARCHAR2 (100);
L_msg_count number;
L_msg_data VARCHAR2 (2000);
L_msg_index number;
L_USER_ID number;
L_RESP_ID number;
L_APPL_ID number;
L_ORG_ID Number: = &org_id;
L_MOVE_ORDER_LINE_ID number: = &mo_line_id;

BEGIN

SELECT user_id
Into l_user_id
From Fnd_user
WHERE user_name = ' SYSADMIN ';

SELECT responsibility_id
, application_id
Into l_resp_id
, l_appl_id
From FND_RESPONSIBILITY_VL
WHERE responsibility_name = ' Kw_all_ manufacturing and supply chain full responsibility ';

Fnd_global.apps_initialize (l_user_id, l_resp_id, l_appl_id);

Mo_global.set_policy_context (' S ', l_org_id);
--mo_global.init;

Dbms_output.put_line (' Calling Inv_mo_backorder_pvt to Backorder MO ');
Dbms_output.put_line (' =============================== ');

Inv_mo_backorder_pvt.backorder (p_line_id = l_move_order_line_id
, X_return_status = L_return_status
, X_msg_count = L_msg_count
, x_msg_data = L_msg_data);

Dbms_output.put_line (' Return Status is: ' | | l_return_status);
--Check Return Status

IF L_return_status = Fnd_api.g_ret_sts_success Then
Dbms_output.put_line (' Successfully backordered the ' Move Order line ');
COMMIT;
ELSE
Dbms_output.put_line (' Could not able-to-back Order line Due to following reasons ');
ROLLBACK;

for j in 1.. L_msg_count LOOP

Fnd_msg_pub.get (P_msg_index = j
, p_encoded = Fnd_api.g_false
, P_data = L_msg_data
, p_msg_index_out = L_msg_index);

Dbms_output.put_line (' Error Message is: ' | | l_msg_data);

END LOOP;
END IF;
END;

Oracle inv-so Line Backorder API

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.