Wednesday, July 7, 2010

PO Change API

Your Ad Here



This API is used to make any changes in the existing purchase order details


declare
result number := null;
begin
-- Do not forget to commit after the result returns 1
-- and rollback if result returns 0.
-- This needs to change as per your application.

fnd_global.apps_initialize(1318, 50578, 201);
result := PO_CHANGE_API1_S.update_po(
1263, -- po num
1, -- release num
1,-- revision
1,-- line num
1, -- shipment num
5,-- qty
null, -- price
null, -- date
'Y', -- launch approvals
null, -- update source
'APITEST', -- interface type
null, -- txn id
'1.0'); -- version

dbms_output.put_line('result:'result);
EXCEPTION
WHEN OTHERS THEN
raise;
end;

Parameter Description
PO_NUM:
Purchase order number.
RELEASE_NUM:
Required if the purchase order is a release. The pass-in value must be a number.
REVISION_NUM:
Which revision of the purchase order/release is being acted upon.
LINE_NUM:
Purchase order line number to update.
SHIPMENT_NUM:
If provided, indicates the update occurs at shipment level, otherwise it's at line level
NEW_QUANTITY:
Indicates the new value of quantity ordered that the order should be updated to
NEW_PRICE:
Indicates the new value of unit price that the order should be updated to.
NEW_PROMISED_DATE:
Indicates the new value of promised date that the order should be updated to. Must be in the format of 'MM/DD/YY' or 'MM-DD-YY'
LAUNCH_APPROVALS_FLAG:
Indicates if you want to launch APPROVAL workflow after the update. Its value could be either 'Y' or 'N'. If not provided, the default value is 'N'.
SOURCE_OF_UPDATE:
Reserved for future use to record the source of the update. Purchase Order Change APIs
TRANSACTION_ID:
Used to fetch any error messages recorded in PO_INTERFACE_ERRORS table if the update process fails. If not provided, a default value will be used.
VERSION:
Version of the current API (currently 1.0)


Your Ad Here

1 comment:

  1. Hi,

    That's really nice work... I have a requirement to update PO Line quantity, when the line has multiple shipments. If I given the shipment number in the above api call, the qty is getting updated at shipment level and doesn't reflecting back the sum of shipment qty at PO Line level.

    If I pass the shipment number as NULL, then it is giving the error message like below:

    "To change the quantity or amount on a line with multiple shipments, you must also specify quantity or amount on one or more shipments".

    It would be great, if you share some info.. on how to update PO Line qty in this case.

    Thanks,
    Sateesh

    ReplyDelete