2 Replies Latest reply on Mar 24, 2009 8:41 AM by hpolaert-Oracle

    Questions about PO creation / update / cancel interfaces

      Hi there,

      An E-Business Suite customer wants to use the 11i PO creation / update / cancel interfaces in order to manage Purchase Orders created from a 3rd party system.

      I've been through the 'Oracle Purchasing Open Interfaces' guide (115mfgapi.pdf), but it's still unclear to me whether:

      1/ It is possible or not to add a new PO line to an existing PO through the interfaces ? If yes, how do one do that: what interface ? sample code ?

      2/ It is possible or not to change the distribution (= accounting information) of an existing PO line ? If yes, ...

      3/ It is possible or not to reject the full PO document if a single line fails during the PO creation ? Same for a batch of POs: reject the full batch if a single PO fails ?

      4/ Is it possible or not to cancel a PO line even if the shipment already occured ? And even if the payment already occured ? Are there some controls here ?

      Thanks for your help,

      Kind regards - Hugues
        • 1. Re: Questions about PO creation / update / cancel interfaces
          1. Answer is YES. You can add a line to an existing standard purchase order by choosing the UPDATE. This can be done through Purchase Documents Open Interface.

          I can not give an example. It's quite long to write it. But You should use Open interface user guide to find nessesary columns. Just insert new row with status UPDATE and try to import

          2. Think You can NOT.

          3. Answer is YES. You can do it. Use "Cancel PO API". Function name is PO_Document_Control_PUB.control_document ().
          For technical details read Open interface UG.

          You must create exception to be avoid problems if some lines can not be canceled.

          4. Answer is YES. You can do it if there's still expected quantity to recive.
          boldJust from UG:*bold* :)
          bold1. Purchase Order Change APIs. bold
          boldThe APIs enable you to do the following*bold*:
          - Record Acceptance/Rejection in Oracle Purchasing
          - Update quantity, price, and promise date on standard purchase orders or releases in Oracle Purchasing

          boldSo only qty, promissed date, price*bold*

          boldRead next*bold*:
          Line Level Validation and Update: This logic occurs when LINE_NUM is not null
          and SHIPMENT_NUM is null.
          1. No update occurs if the line status is FINALLY CLOSED or CANCELLED.
          2. The new quantity or price value must be positive.
          3. If updating quantity, the new quantity must be greater than or equal to the
          greater of total quantity_received of all shipments and total quantity_billed
          of all shipments for this line. After the update takes place, the new quantity
          will be prorated at the shipment level and for each shipment the quantity is
          prorated at the distribution level if applicable.
          4. If updating price, no update occurs if a receipt has been created against one
          of the line’s shipments and it's been accrued upon receipt. No update
          occurs if an invoice has been created against one of the line’s shipments.
          After a price update takes place, price changes are rolled down to the
          shipment level for standard POs. No price update occurs for a release if the
          Price Override flag on the blanket purchase agreement Line is No.

          boldYou can update qty if still there's a qty to receive (Expected) and if PO still is not canceled*bold*

          Usage Example
          set serveroutput on;
          -- After the API completes, do not forget to commit if the result is 1
          -- and rollback if the result is 0.
          l_result NUMBER;
          l_api_errors PO_API_ERRORS_REC_TYPE;
          -- This needs to be changed according to your environment setup.
          FND_GLOBAL.apps_initialize ( user_id => 1318, resp_id => 50578, resp_appl_id => 201 );
          -- Record an acceptance of Y for PO 1261.
          l_result := PO_CHANGE_API1_S.record_acceptance(
          x_po_number => 1261,
          x_release_number => null,
          x_revision_number => 0,
          x_action => 'NEW',
          x_action_date => null,
          x_employee_id => 588,
          x_accepted_flag => 'Y',
          x_acceptance_lookup_code => 'On Schedule',
          x_note => 'All valid',
          x_interface_type => 'APITEST',
          x_transaction_id => null,
          version => '1.0');
          IF (l_result <> 1) THEN
          -- Handle the errors in the PO_INTERFACE_ERRORS table.
          END IF;
          -- Change the quantity to 5 on line 1, shipment 1 of PO 1263.

          l_result := PO_CHANGE_API1_S.update_po (
          x_po_number => 1263,
          x_release_number => 1,
          x_revision_number => 1,
          x_line_number => 1,
          x_shipment_number => 1,
          new_quantity => 5,
          new_price => NULL,
          new_promised_date => NULL,
          launch_approvals_flag =>'Y',
          update_source => NULL,
          version => '1.0',
          x_override_date => NULL,
          x_api_errors => l_api_errors,
          p_buyer_name => null
          IF (l_result <> 1) THEN
          -- Display the errors
          FOR i IN 1..l_api_errors.message_text.COUNT LOOP
          dbms_output.put_line ( l_api_errors.message_text(i) );
          END LOOP;
          END IF;
          • 2. Re: Questions about PO creation / update / cancel interfaces
            Thank you Eugene

            Kind regards - Hugues