Showing posts with label Update. Show all posts
Showing posts with label Update. Show all posts

30 October, 2017

API to update Project code on Requisition

Below API can be used in oracle apps to Update the project code on requisition.

set serveroutput on
DECLARE

l_req_hdr PO_REQUISIITON_UPDATE_PUB.req_hdr;
l_req_line_tbl  PO_REQUISIITON_UPDATE_PUB.req_line_tbl;
l_req_dist_tbl PO_REQUISIITON_UPDATE_PUB.req_dist_tbl;
l_return_status VARCHAR2(1);
l_msg_count NUMBER;
l_msg_data VARCHAR2(2000);

BEGIN

dbms_output.ENABLE(1000000);
   fnd_global.Apps_initialize(108970, 20707, 201);
   -- pass in user_id, responsibility_id, and application_id 
   oe_msg_pub.initialize;
   oe_debug_pub.initialize;
   mo_global.Init ('ONT'); -- Required for R12
   mo_global.Set_org_context (101, NULL, 'ONT');
   fnd_global.Set_nls_context ('AMERICAN');
   mo_global.Set_policy_context ('S', 101);
 
l_req_hdr.segment1 :='Test123';
l_req_hdr.org_id := 101;

l_req_dist_tbl.project_id := 344;

dbms_output.put_line('Before calling the API');

PO_REQUISIITON_UPDATE_PUB.update_requisition(1.0,
'F',
'N',
l_return_status,
l_msg_count,
l_msg_data,
'Y',
l_req_hdr,
    l_req_line_tbl,
    l_req_dist_tbl
);

dbms_output.put_line('After calling the API');
dbms_output.put_line('l_return_status'||l_return_status);
    dbms_output.put_line('l_msg_count'||      l_msg_count);
    dbms_output.put_line('l_msg_data'|| l_msg_data);

END;
/