Thursday, 29 May 2014

Requisition Import API : Oracle EBS R12

In Oracle EBS R12 we can create Requisition from GUI as well as we can import the Requisition using import program "Requisition Import".

Follow the below steps to import requisition:

Step:1  Validate all the entities and insert in PO_REQUISITIONS_INTERFACE_ALL

INSERT
INTO apps.PO_REQUISITIONS_INTERFACE_ALL
  (
    interface_source_code,
    org_id,
    destination_type_code,
    authorization_status,
    preparer_id,
    charge_account_id,
    source_type_code,
    unit_of_measure,
    line_type_id,
    quantity,
    destination_organization_id,
    deliver_to_location_id,
    deliver_to_requestor_id,
    item_id,
    need_by_date,
    suggested_vendor_name,
    unit_price
  )
  VALUES
  (
    'IMPORT_INV',
    204,                        --(Validate against apps.org_organization_definitions table)
    'INVENTORY',
    'INCOMPLETE',
    25,                         --(Validate against apps.per_all_people_f tabel)
    13185,                   --(Vlidate against apps.mtl_system_items_b corresponding to item and inv org),
    'VENDOR',           --SOURCE_TYPE_CODE,
    'METRICTON',   --UNIT_OF_MEASURE
    1,                           --(Validate against PO_LINE_TYPES)
    100,                       --QUANTITY
    204,                       --DESTINATION_ORGANIZATION_ID,
    27108,                   --DELIVER_TO_LOCATION_ID,
    25,                         --DELIVER_TO_REQUESTOR_ID
    208955,                 --(Validate against mtl_system_items_b)
    SYSDATE,           --NEED_BY_DATE
    'Staples',               --SUGGESTED_VENDOR_NAME
    1                             --UNIT_PRICE
  );

Step:2 Submit "Requisition Import" program.

BEGIN
  APPS.FND_GLOBAL.APPS_INITIALIZE ( USER_ID => 1318, RESP_ID => 50578, RESP_APPL_ID => 201 );
  APPS.FND_REQUEST.SET_ORG_ID('204');
  V_REQUEST_ID := APPS.FND_REQUEST.SUBMIT_REQUEST (APPLICATION => 'PO' --Application,
                                                  ,PROGRAM => 'REQIMPORT'    --Program,
                                                  ,ARGUMENT1 => ''                       --Interface Source code,
                                                  ,ARGUMENT2 => ''                       --Batch ID,
                                                  ,ARGUMENT3 => 'ALL'               --Group By,
                                                  ,ARGUMENT4 => ''                       --Last Req Number,
                                                  ,ARGUMENT5 => 'N'                    --Multi Distributions,
                                                  ,ARGUMENT6 => 'Y'                    --Initiate Approval after ReqImport
                                                  );
  COMMIT;
END;

No comments:

Post a Comment