Change API Mode – Using the Extension Package

 
The extension package is called during Upload, NOT during validation. The extension package is called for every line and shipment. 
 
Errors and Messages
 
·       Lines
o   Line status value for the errored line is set to ‘Error’ for the corresponding spreadsheet row.
o   Line messages returned from When a message is returned.  
 
Exclusions
 
We run the approval process on the last record to be updated for a Purchase Order. If the last record is rejected by the extension package then the approval process will not be run. In this case the approval process will need to be initiated from the oracle forms.
 
Procedure m4aps_pow_extension.changeapi
 
The procedure changeapi provides access to the uploaded data. Modify this procedure to suit your requirements.
 
This mode calls the Change API mode Oracle API function (PO_CHANGE_API1_S.update_po) to update purchase orders.  The uploaded data parameters match the PO_CHANGE_API1_S.update_po (however we don’t expose all of the parameters).
 
M4aps_pow_extension Parameters
 
Name
Mode
Type
Description
l_po_header
IN
VARCHAR2
Purchase Order Number
l_release_number
IN
NUMBER
Purchase Order Release Number
l_revision_number
IN
NUMBER
Purchase Order Revision Number
l_line_number
IN
NUMBER
Line Number
l_shipment_number
IN
NUMBER
Shipment Number
l_new_quantity
IN OUT
NUMBER
New Quantity
l_new_price
IN OUT
NUMBER
New Price
l_new_promised_date
IN OUT
DATE
New Promised Date
l_new_need_by_date
IN OUT
DATE
New Need by Date
l_override_date
IN OUT
DATE
Override Date
l_secondary_quantity
IN OUT
NUMBER
Secondary Quantity
l_preferred_grade
IN OUT
VARCHAR2
Preferred Grade
l_org_id
IN
VARCHAR2
Operating Unit Identifier
x_status
OUT
VARCHAR2
set to 'E' to error the requisition and stop it from being inserted into the interface table
x_message
OUT
VARCHAR2
Used to return a message to the Wizard. Messages are returned to the header record in the Wizard.
 
If l_shipment_number is null then the data maps to the line section in the wizard.
If l_shipment_number is not null then the data maps to the shipments section in the Wizard.
 
Using the Extension Package for Additional Validation
 
This example:
·            Business Rule: User ‘Operations’ is not allowed to update ‘Promised Date’
·            Example return message in the Wizard for this code - Extension Error: Promised Date updates not allowed for this user: Operations.
 
 
Using the Extension to Return a Warning to the Sheet
 
This example:
·            Business Rule: Return a warning if there is no ‘Promised Date’.
·            Example return message in the Wizard for this code – Extension Warning: Shipment has no Promised Date.
 
 
Refer to section: