Por Custom PKG
Por Custom PKG
Por Custom PKG
Solution Approach:
Different solution approaches for addressing the above requirement are:
POR_CUSTOM_PKG:
This is Oracle seeded package provided as a hook to include custom defaulting
and validation logic in iProcurement requisition creation.
Extending Application Module and Controller of Checkout page using
OAF extension:
Create a method to copy fund from header to line in extended application
module. Extend controller to make a call to that AM method during page events
like Edit Lines, Submit etc.
Extend existing Helper / Server Command classes using OAF:
iProcurement OAF architecture is designed to use Server Command and Helper
classes to encapsulate the business logic. These additional classes contain code
that would normally be placed in Application Module. The code is separated to
prevent AM from growing too big and promote reusability. We can extend these
classes to place custom logic to meet our requirement. This approach requires
good understanding of OAF and its integration with underlying BC4J components.
I will use above approaches to implement my requirement, and point out some
limitations of each approach. This first article in the series has implementation
using POR_CUSTOM_PKG.
Approach 1: POR_CUSTOM_PKG:
POR_CUSTOM_PKG provides customization hooks to perform the defaulting logic
and validation of the requisition header, line, and distribution data. The
procedures in this package are called during requisition creation in iProcurement.
Requisitions created in Purchasing module doesnt use this package.
The procedures are invoked from CustomReqHeaderHelper,
CustomReqLineHelper, and CustomReqDistHelper classes which implements
interface classes PoRequisitionHeaderEOHelper, PoRequisitionLineEOHelper, and
PoReqDistributionEOHelper respectively. Without going too much into details of
their implementation, let us look at different pl/sql procedures available in
por_custom_pkg.
This package contains 7 procedures (3 for defaulting logic, 3 for validations and 1
for updating charge account). Function of each procedure is self explanatory by
looking at their names; I will give a gist of each of them:
Procedure Name
Purpose
CUSTOM_DEFAULT_REQ_HEADER
CUSTOM_VALIDATE_REQ_HEADER
CUSTOM_DEFAULT_REQ_LINE
CUSTOM_VALIDATE_REQ_LINE
CUSTOM_DEFAULT_REQ_DIST
CUSTOM_VALIDATE_REQ_DIST
CUSTOM_UPDATE_CHARGE_ACCOUNT
The above defaulting and validation procedures has common OUT parameters
x_return_code and x_error_msg. These parameters can be used to return the
results of the validation. Return code (x_return_code) can be used to indicate on
which tab error message to be displayed to Edit Lines page.
If result code is 1, error is displayed on the Delivery tab
If result code is 2, error is displayed on the Billing tab
If result code is 2, error is displayed on the Accounts tab
These procedures are by default do not have any implementation. Once custom
code is placed, three profile options control whether customization takes effect
on existing requisition process.
The profiles are:
POR: Enable Req Header Customization
POR: Enable Requisition Line Customization
custom logic for the x_attribute1 through x_attribute15 IN OUT line level
variables as OUTPUT.
For example:
If you want the header_attribute_7 header value to be assigned to x_attribute8 at
the line level, use the following statement in the CUSTOM_DEFAULT_REQ_LINE
procedure
BEGIN
x_attribute8 := header_attribute_7;
X_RETURN_CODE:=0;
X_ERROR_MSG:='';
END;
Implement the above logic in POR_CUSTOM_PKG.CUSTOM_DEFAULT_REQ_LINE.
Or you may add more complex logic if you prefer. You will have to contact
Consulting or Partners for assistance with more complex logic if desired.
4. How do you modify the POR_CUSTOM_PKG code?
You may modify the POR_CUSTOM_PKG.CUSTOM_DEFAULT_REQ_LINE directly in
the database. Or you may modify the
POR_CUSTOM_PKG.CUSTOM_DEFAULT_REQ_LINE in file
$ICX_TOP/patch/115/sql/PORCUSTB.pls and then upload the revised package to
the database.
If you modify the file PORCUSTB.pls, then you may use these commands to load
the revised package to the database.
cd $ICX_TOP/patch/115/sql
sqlplus apps/apps
SQL> set define off;
SQL> @PORCUSTB.pls
SQL> commit;
5. Is the POR_CUSTOM_PKG used only for updating DFF attributes, or
can it be used for updating other values on requisitions?
POR_CUSTOM_PKG can be used for updating other valus as well. Review the
specific Header, Line, or Distribution DEFAULT procedure in the custom package
and see the IN OUT values available for update. As a general rule of thumb IN
values are Read Only, but IN OUT values may be updated by the
POR_CUSTOM_PKG (there may be a few exceptions).
6. Is it necessary for the user to navigate to a page where the DFF
attributes or other field values are enabled in order for the
POR_CUSTOM_PKG to be called?
Yes, the user must navigate to the page where the DFF value is active for the
customization in POR_CUSTOM_PKG to be called. You may enable the Requisition
Header DFF Additional Header Information, Requisition Line DFF Additional Line
Information, and Requisition Distribution DFF Additional Distribution Information
on the Checkout page to get the relevant POR_CUSTOM_PKG procedures to be
called at checkout step 1. The users navigate to this page each time they
checkout a requisition in iProcurement so the relevant POR_CUSTOM_PKG
procedures would be called accordingly.
7. How is personalization implemented to show DFF attributes
referenced in the POR_CUSTOM_PKG?
For Example:
Navigate to iProcurement checkout step 1 of 3
Click Personalize Page
Complete / Expance All
Search the page for - Row Layout: (ReqLineDFFRow)
Click the Edit (pencil) icon
Set Rendered = True
Click Apply
Click Return to Application (lower left of page)