380 Por Custom PKG Iprocurement Part1
380 Por Custom PKG Iprocurement Part1
380 Por Custom PKG Iprocurement Part1
I will take a simple requirement to explain each of the approaches and analyze
their pros and cons. My requirement in is as follows as. Please note I'm using
11.5.10.2 iProcurement.
Requirement:
I’ve defined attributes (Attribute15) on requisition header and line with the name
“Fund”. Fund attribute on the line drives charge account generation. User is
required to enter fund on header in ‘Checkout: Requisition Information’ page, this
value is defaulted or copied to fund attribute on the line. This means user doesn’t
have to enter fund attribute for all the lines in the requisition, in fact fund on line is
1 / 12
Custom Defaulting and Validation in iProcurement
not displayed unless it is shown using OAF Personalization (DFFs are by default
not shown in OAF page). Only Fund attribute on header is displayed by setting
‘Rendered’ property to “true” for item ‘ReqHeaderDFF’ using OAF Personalization.
Fund on requisition header in Checkout page is shown in the below screenshot.
Solution Approach:
1.
POR_CUSTOM_PKG
2 / 12
Custom Defaulting and Validation in iProcurement
1.
1.
3 / 12
Custom Defaulting and Validation in iProcurement
Approach 1: POR_CUSTOM_PKG
4 / 12
Custom Defaulting and Validation in iProcurement
Procedure Name
Purpose
CUSTOM_DEFAULT_REQ_HEADER
5 / 12
Custom Defaulting and Validation in iProcurement
CUSTOM_VALIDATE_REQ_HEADER
CUSTOM_DEFAULT_REQ_LINE
CUSTOM_VALIDATE_REQ_LINE
CUSTOM_DEFAULT_REQ_DIST
6 / 12
Custom Defaulting and Validation in iProcurement
CUSTOM_VALIDATE_REQ_DIST
CUSTOM_UPDATE_CHARGE_ACCOUNT
7 / 12
Custom Defaulting and Validation in iProcurement
8 / 12
Custom Defaulting and Validation in iProcurement
Implementation:
9 / 12
Custom Defaulting and Validation in iProcurement
In POR_CUSTOM_PKG.CUSTOM_DEFAULT_REQ_LINE procedure,
header fund value is available in header attribute15 i.e. IN parameter he
ader_attribute_15
, copy its value to line fund value i.e. IN OUT parameter
x_attribute15
. Return 0 at the end to signal success. Below screenshot shows
implementation of the procedure.
10 / 12
Custom Defaulting and Validation in iProcurement
header, new value is not copied to line because default procedure is not
executed. So this implementation doesn’t fully solve the purpose.
A similar example where defaulting fails is, suppose you want to default
a value say ‘0000000’ to header fund when requisition is created. We
can code POR_CUSTOM_PKG. CUSTOM_VALIDATE_REQ_HEADER
to copy ‘0000000’ to x_attribute15 if it is null. This works when
requisition is created from scratch in Non-catalog request page or by
selecting inventory item. iProcurement create new records in requisition
header (po_requisition_headers_all) and line (po_requisition_lines_all)
tables when checkout is done. Suppose you change fund value to
‘1234567’, save it, delete lines in requisition and start over from
Non-catalog request page, default value ‘0000000’ is not shown for fund
instead ‘1234567’ is shown. iProcurement doesn’t delete requisition
header when lines are deleted. It uses existing header record i.e. same
req_header_id which means default header procedure is not executed.
These are few scenarios where I felt default procedures doesn’t work
the way I wanted it to be. So I have to opt for alternative solution.
The next article in the series uses OAF extension of controller and
application module to implement my requirement.
11 / 12
Custom Defaulting and Validation in iProcurement
12 / 12