For this exercise I am using iProcurement & core Purchasing Account generation workflows. However, the concepts remain the same for all the account generator workflows, regardless of the module.
Assume that we have two Accounting Flexfield segments in Oracle General Ledger:-
1. Company Account
2. Cost Centre
Important: In real life, you will have more than mere two segments in the GL Accounting Flexfield. These pseudo Two GL Segments are for demo purposes only.
Assuming that you have implemented Oracle Projects Accounting, the Requisition or a Purchase Order can either be Project based or can be Non Project based. For this exercise, for simplicity, lets restrict ourselves to Project Based Requisition.
Lets assume that the business requirement for Project Based Requisitions is:-
Company Segment for Projects based Requisition
Company Account Segment will be Defaulted to a constant value of GO4GOLD
Cost Centre Segment for Projects based Requisition
This will be defaulted from the Attribute1 against Primary Organization for Project Task .
OK, here we go with all the steps that are required to build such an Account Generator Workflow.
Open the account generator Workflow
Assign default value to Company segment.
Double click to open the process “Build Expense Project Charge Account”
After the Start Icon, Right Click to create a new Function.
As in screenshot below, in “Item Type” field, select “Standard Flexfield Workflow” from the drop down list. In the Display Name select “Assign Value to Segment” and click on OK.
By doing the above step, we have just created a workflow Function that is capable of assigning a desired value to GL Flexfield Segment. Now we need to configure this Function further, so that it knows the Segment upon which it operates, and also the default value that is assigned to the segment.
As per our business requirement, we need to default a constant value of GO4GOLD for our Segment1 ( Company Segment ) . For this, click on the function created above, and click on the Node Attributes.
Do the steps, as in above screenshot.
Step 3 ( Part a).
Default the cost centre from Attribute1 against Primary Organization for Project Task.
In the Part-a of this step, we will assign the Cost Centre to an Attribute Named “TEMP_CC_VALUE”.
For this, we can define a new function named “Assign Cost Centre to Attribute”, by right clicking on the process.
This function calls PL/SQL XX_account_generator_pkg.set_cost_centre_attribute
itemtype IN VARCHAR2
,itemkey IN VARCHAR2
,actid IN NUMBER
,funcmode IN VARCHAR2
,RESULT OUT VARCHAR2
CURSOR c_get_cc(p_org_id IN NUMBER) IS
SELECT attribute1 org_cc
FROM hr_all_organization_units hrou
WHERE hrou.organization_id = p_org_id;
IF NOT (funcmode = 'RUN')
--First nullify the value, so that accidentaly it does not get used in the next step.
wf_engine.setitemattrtext(itemtype, itemkey, 'TEMP_CC_VALUE', '');
RESULT := 'COMPLETE:FAILURE';
RESULT := 'COMPLETE:SUCCESS';
WHEN OTHERS THEN
-- Record error using generic error message routine for debugging and
-- raise it
wf_core.CONTEXT(pkg_name => 'ic_account_generator_pkg'
,proc_name => 'GMS_GET_CC'
,arg5 => NULL);
In the above function, we are fetching the Attribute1 against the Organization Record. The organization_id is being passed as a parameter to the Newly defined Function( as in screenshot below).
Step 3 ( Part b).
In this part of the step, we will assign the value in Attribute “TEMP_CC_VALUE” to the Segment2 ( i.e. the Cost Centre). This is done as per the screenshot below.
Step 4. Check to see if the Code Combination is Complete
Right click to create a function. From Item Type dropdown list, select “Standard Flexfield Workflow”. In the Display Name dropdown list, select “Is Code Combination Complete?”
Next, click on Node Attributes, and assign a value of TRUE to “Check only required Segments”.
Step 5. By implementing the above steps, we have been able to complete the Account Generation of our two-segment Flexfield using Oracle Workflow Account Generator.
The last and final step will already be there within the Pre-Installed Account Generation. This workflow step validates the Code Combination Id, for the Oracle’s Security Rules that are defined in General Ledger, against users responsibility. For reference purposes this is pasted below.
A final note, for debugging the Account Generator workflow. Account Generator workflows are designed to run efficiently and quickly, hence they always in synchronous mode. This means that no inserts are made into the Oracle Workflow tables when generating the accounting.
Hence by default it is not possible to debug the Account Generator workflow using Status Monitor screen in Oracle Workflow.
However, Oracle delivers a profile option named “Account Generator:Run in Debug Mode”. Setting this profile to Yes, will make Account Genration processes insert records in workflow tables. Hence by setting this profile to Yes, you will be able to debug your account generation workflow. Further debugging of FND_FLEX API’s is made possible by enabling the FND Logging.