0 Replies Latest reply on Nov 9, 2015 2:44 AM by 1567114

    Adding New Lines in 12.2.4 in Purchase Requisition Error

    1567114

      DECLARE

        l_req_hdr       PO_REQUISITION_UPDATE_PUB.REQ_HDR;

        l_req_line_tbl  PO_REQUISITION_UPDATE_PUB.REQ_LINE_TBL;

        l_req_dist_tbl  PO_REQUISITION_UPDATE_PUB.REQ_DIST_TBL;

        l_return_status VARCHAR2(1);

        l_msg_count     NUMBER;

        l_msg_data      VARCHAR2(2000);

      BEGIN

        l_req_hdr.segment1:='TEST002';

        --l_req_hdr.requisition_header_id:=17565265;

        l_req_hdr.org_id:=116817;

        --l_req_hdr.authorization_status:='INCOMPLETE';

       

       

        l_req_line_tbl(1).requisition_number:='TEST002';

        l_req_line_tbl(1).requisition_line_id:=NULL;

      -- l_req_line_tbl(1).requisition_header_id:=17565265;

      -- l_req_line_tbl(1).requisition_line_num:=2;

      -- l_req_line_tbl(1).deliver_to_location_code := 'TEST A';

      --  l_req_line_tbl(1).requisition_line_id:=NULL;

        l_req_line_tbl(1).source_type_code:='INVENTORY';

        l_req_line_tbl(1).destination_type_code:='INVENTORY';

      -- l_req_line_tbl(1).requisition_header_id:=17565265;

      --  l_req_line_tbl(1).quantity:=3;

        l_req_line_tbl(1).org_id:=116817;

        l_req_line_tbl(1).source_organization_id:=116820;

        l_req_line_tbl(1).destination_organization_id:=116818;

      -- l_req_line_tbl(1).source_organization_name:='TEST B';

      -- l_req_line_tbl(1).destination_organization:='TEST A';

      --  l_req_line_tbl(1).item_description := 'Test for Requisition Update API';

      -- l_req_line_tbl(1).deliver_to_location_code := 'TEST A';

      --  l_req_line_tbl(1).authorization_status:='INCOMPLETE';

       

      -- l_req_dist_tbl(1).distribution_num:=1;

      -- l_req_dist_tbl(1).requisition_number:='TEST002';

      -- l_req_dist_tbl(1).req_line_num:=1;

      -- l_req_dist_tbl(1).org_id:=116817;

      -- l_req_dist_tbl(1).code_combination_id:=789755;

       

       

       

          dbms_output.put_line('Before calling PO_REQUISITION_UPDATE_PUB.update_requisition.....'); 

       

         PO_REQUISITION_UPDATE_PUB.update_requisition

            (

            'T',

           'Y'   ,

            l_return_status,            

            l_msg_count,  

            l_msg_data,          

            'N',

            l_req_hdr,

            l_req_line_tbl,

            l_req_dist_tbl

            );

          dbms_output.put_line('After calling PO_REQUISITION_UPDATE_PUB.update_requisition.....'); 

          dbms_output.put_line('l_return_status ='||l_return_status); 

          dbms_output.put_line('l_msg_count  ='||TO_CHAR(l_msg_count)); 

          dbms_output.put_line('l_msg_data ='||l_msg_data); 

      END;

       

      I want to Add new line in Requisition Line and I want to achieve through Public API in Release 12.2.4.

       

      There is a existing line num 1 which has Source type as INVENTORY and Destination Type as INVENTORY.And I want to use the same Source in creation of the New line in Requisition Lines

      but every time I face Error in PO_INTERFACE_ERRORS as :

       

      l_msg_data =Number of Requisition Lines in Error: 1 Destination type is invalid

       

       

      Cause:        You entered an invalid destination type. 

       

       

      Action:        Enter a valid destination type.

        

      Please can you anyone assist what went wrong.Can i Add new Line in an Existing Internal Requisition which has Authorization Status as INCOMPLETE