This action might not be possible to undo. Are you sure you want to continue?
Written by Kishore Ryali Tuesday, 17 March 2009 20:37
Part I – POR_CUSTOM_PKG
One of the common requirements in iProcurement implementation is to perform custom defaulting or validating fields in requisition header/line/distribution during Requisition creation. For example, you may want to default project value based on requestor or validate deliver-to location to check if it is valid for a project etc. The objective of the article is to share different approaches I learnt from my experience, to achieve it.
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 220.127.116.11 iProcurement.
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
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: Different solution approaches for addressing the above requirement are: 1. 17 March 2009 20:37 not displayed unless it is shown using OAF Personalization (DFFs are by default not shown in OAF page). POR_CUSTOM_PKG 2 / 12 .Custom Defaulting and Validation in iProcurement Written by Kishore Ryali Tuesday.
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. Submit etc. These additional 3 / 12 . iProcurement OAF architecture is designed to use Server Command and Helper classes to encapsulate the business logic. 17 March 2009 20:37 This is Oracle seeded package provided as a hook to include custom defaulting and validation logic in iProcurement requisition creation.Custom Defaulting and Validation in iProcurement Written by Kishore Ryali Tuesday. 1. 1. Extend existing Helper / Server Command classes using OAF. Extend controller to make a call to that AM method during page events like Edit Lines.
Custom Defaulting and Validation in iProcurement Written by Kishore Ryali Tuesday. 4 / 12 . Approach 1: POR_CUSTOM_PKG POR_CUSTOM_PKG provides customization hooks to perform the defaulting logic and validation of the requisition header. This approach requires good understanding of OAF and its integration with underlying BC4J components. 17 March 2009 20:37 classes contain code that would normally be placed in Application Module. I will use above approaches to implement my requirement. This first article in the series has implementation using POR_CUSTOM_PKG. The code is separated to prevent AM from growing too big and promote reusability. The procedures in this package are called during requisition creation in iProcurement. and point out some limitations of each approach. We can extend these classes to place custom logic to meet our requirement. and distribution data. Requisitions created in Purchasing module doesn’t use this package. line.
I will give a gist of each of them: Procedure Name Purpose CUSTOM_DEFAULT_REQ_HEADER Customize it to include header defaulting logic. and CustomReqDistHelper classes which implements interface classes PoRequisitionHeaderEOHelper. This package contains 7 procedures (3 for defaulting logic. Without going too much into details of their implementation. CustomReqLineHelper. Function of each procedure is self explanatory by looking at their names. It is called when new requisitio 5 / 12 . let us look at different pl/sql procedures available in por_custom_pkg. 17 March 2009 20:37 The procedures are invoked from CustomReqHeaderHelper. 3 for validations and 1 for updating charge account).Custom Defaulting and Validation in iProcurement Written by Kishore Ryali Tuesday. PoRequisitionLineEOHelper. and PoReqDistributionEOHelper respectively.
17 March 2009 20:37 CUSTOM_VALIDATE_REQ_HEADER Customize it to include header validation logic. It is called when new requisition l CUSTOM_DEFAULT_REQ_DIST Customize it to include distribution defaulting logic. It is called when new requisition l CUSTOM_VALIDATE_REQ_LINE Customize it to include Line validation logic. This validation would in additio CUSTOM_DEFAULT_REQ_LINE Customize it to include Line defaulting logic. It is called when new distri 6 / 12 .Custom Defaulting and Validation in iProcurement Written by Kishore Ryali Tuesday.
It is called when new distri CUSTOM_UPDATE_CHARGE_ACCOUNT Overrides default charge account. error is displayed on the Delivery tab If result code is 2. These parameters can be used to return the results of the validation. error is displayed on the Billing tab 7 / 12 .Custom Defaulting and Validation in iProcurement Written by Kishore Ryali Tuesday. 17 March 2009 20:37 CUSTOM_VALIDATE_REQ_DIST Customize it to include distribution validation logic. Use PO Account Generator workflow instea The above defaulting and validation procedures has common OUT parameters x_return_code and x_error_msg. If result code is 1. R eturn code ( x_return_code ) can be used to indicate on which tab error message to be displayed to Edit Lines page.
17 March 2009 20:37 If result code is 2. Once custom code is placed. The profiles are: • POR: Enable Req Header Customization • POR: Enable Requisition Line Customization • POR: Enable Req Distribution Customization 8 / 12 . error is displayed on the Accounts tab These procedures are by default do not have any implementation. three profile options control whether customization takes effect on existing requisition process.Custom Defaulting and Validation in iProcurement Written by Kishore Ryali Tuesday.
9 / 12 .e. to tell iProcurement to execute customization in corresponding procedures.Custom Defaulting and Validation in iProcurement Written by Kishore Ryali Tuesday. implementation requires: - Coding defaulting procedure for requisition line i. 17 March 2009 20:37 These profiles have to be set to ‘Yes’ at site level. Implementation: Going back to my requirement of copying fund value from header to line. CUSTOM_DEFAULT_REQ_LINE - Profile “POR: Enable Requisition Line Customization” need to be set to “Yes” at site level.
If customization needs to turned off. copy its value to line fund value i. IN OUT parameter x_attribute15 .e.CUSTOM_DEFAULT_REQ_LINE procedure. If the user changes fund value in 10 / 12 . 17 March 2009 20:37 In POR_CUSTOM_PKG. header fund value is available in header attribute15 i. Below screenshot shows implementation of the procedure. Advantages of this approach are it is simple and doesn’t require developer to have understanding of OAF or Java. IN parameter he ader_attribute_15 . Return 0 at the end to signal success. clear the profile “POR: Enable Requisition Line Customization” value or set it to “No” at site level.e. Limitations of this approach is defaulting procedures are only executed when requisition is first created.Custom Defaulting and Validation in iProcurement Written by Kishore Ryali Tuesday.
Custom Defaulting and Validation in iProcurement Written by Kishore Ryali Tuesday. suppose you want to default a value say ‘0000000’ to header fund when requisition is created. So this implementation doesn’t fully solve the purpose. iProcurement doesn’t delete requisition header when lines are deleted.e. We can code POR_CUSTOM_PKG. 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 create new records in requisition header (po_requisition_headers_all) and line (po_requisition_lines_all) tables when checkout is done. 11 / 12 . It uses existing header record i. So I have to opt for alternative solution. save it. CUSTOM_VALIDATE_REQ_HEADER to copy ‘0000000’ to x_attribute15 if it is null. same req_header_id which means default header procedure is not executed. 17 March 2009 20:37 header. A similar example where defaulting fails is. These are few scenarios where I felt default procedures doesn’t work the way I wanted it to be. This works when requisition is created from scratch in Non-catalog request page or by selecting inventory item. new value is not copied to line because default procedure is not executed. Suppose you change fund value to ‘1234567’. The next article in the series uses OAF extension of controller and application module to implement my requirement.
17 March 2009 20:37 12 / 12 .Custom Defaulting and Validation in iProcurement Written by Kishore Ryali Tuesday.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.