Skip to main content

ORACLE WORKFLOWS

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.
Step 1
Open the account generator Workflow
Image

Step 2.
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.
Image
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.
Image
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.
Image
This function calls PL/SQL XX_account_generator_pkg.set_cost_centre_attribute
PROCEDURE set_cost_centre_attribute
(
  itemtype IN VARCHAR2
 ,itemkey  IN VARCHAR2
 ,actid    IN NUMBER
 ,funcmode IN VARCHAR2
 ,RESULT   OUT VARCHAR2
) AS
  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;
  rec_get_cc c_get_cc%ROWTYPE;
BEGIN
  IF NOT (funcmode = 'RUN')
  THEN
    RETURN;
  END IF;
  BEGIN
--First nullify the value, so that accidentaly it does not get used in the next step.
    wf_engine.setitemattrtext(itemtype, itemkey, 'TEMP_CC_VALUE', '');
    OPEN c_get_cc(wf_engine.getactivityattrnumber(itemtype
                                                 ,itemkey
                                                 ,actid
                                                 ,'EXPENDITURE_ORGANIZATION_ID'));
    FETCH c_get_cc
      INTO rec_get_cc;
    IF c_get_cc%NOTFOUND
    THEN
      RESULT := 'COMPLETE:FAILURE';
    ELSE
      wf_engine.setitemattrtext(itemtype
                               ,itemkey
                               ,'TEMP_CC_VALUE'
                               ,rec_get_cc.org_cc);
      RESULT := 'COMPLETE:SUCCESS';
    END IF;
    CLOSE c_get_cc;
    RETURN;
  END;
EXCEPTION
  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);
    RAISE;
END set_cost_centre_attribute;

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).
Image
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.
Image
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?”
Image

Next, click on Node Attributes, and assign a value of TRUE to “Check only required Segments”.
Image

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.
Image

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.
Image
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.

Comments

Popular posts from this blog

Create Accounting for a Payment generates errors 95333 and 95359

Create Accounting for a Payment generates errors 95333 and 95359 Error: 95333: A conversion rate does not exist to convert USD to AUD for the conversion type Corporate and conversion date 20-MAR-09 for line -25. Please use the Daily Rates form in General Ledger to enter a conversion rate for these currencies, conversion date and conversion type. 95359: There is no accounted amount for the subledger journal entry line. Please inform your system administrator or support representative that: The source assigned to the accounting attribute Accounted Amount has no value for extract line number 88547. Please make sure the source assigned to the accounting attribute Accounted Amount has a valid value, or assign a different source to this accounting attribute. Solution: 1. Specify a conversion rate for the currencies and conversion date mentioned in the error message 95333 Navigation under the General Ledger responsibility: Setup > Currencies > Currency Rates Manager > Daily Rates ...

Public API’s for FA Transactions

Public API’s for FA Transactions So far Oracle FA is have all the good things except the lack on reporting.Oracle FA is now offer lot of public API's that can be used to interfacing with third party or Oracle application other modules. Here are some of transaction's API's:   Additions API if you have requirement to add assets directly via PL/SQL then use  FA_ADDITION_PUB.DO_ADDITION. If you have selected the Allow CIP Assets check box on the Book Controls window of a tax book when adding CIP assets using the Additions API, the this API automatically adds those CIP assets to that tax book at the same time that they are added to the corporate book. Adjustments API you can make cost adjustments to your assetsdirectly via PL/SQL using  FA_ADJUSTMENT_PUB.DO_ADJUSTMENT  for any  process adjustment. Detail can be found in appendix H) You can use this API if you have a custom interface that makes it difficult to use with the existing Oracle Assets interfaces for adjusti...

AP Table Relation Oracle Apps

AP Table Relation Oracle Apps ORACLE PAYABLE TABLE RELATION Source Table Dependent Table Condition AP_INVOICE_LINES_ALL AIL ZX_LINES_SUMMARY ZLS AIL.invoice_id = ZLS.trx_id and  ZLS.application_id  = 200 and  ZLS.entity_code  = 'AP_INVOICES' and  ZLS.event_class_code  in ('STANDARD INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS') and  AIL.summary_tax_line_id = ZLS.summary_tax_line_id AP_INVOICE_LINES_ALL AIL ZX_LINES ZL AIL.invoice_id = ZL.trx_id and  ZL.application_id  = 200 and  ZL.entity_code  = 'AP_INVOICES' and  ZL.event_class_code  in ('STANDARD INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS') and  AIL.line_number = ZL.trx_line_number AP_INVOICE_DISTRIBUTIONS_ALL AID ZX_REC_NREC_DIST ZD AID.invoice_id = ZD.trx_id and  ZD.application_id  = 200 and  ZD.entity_code  = 'AP_INVOICES' and  ZD.event_class_code  in ('STANDARD INVOICES', 'PREPAYMENT INVOICES', 'EXPENSE REPORTS') and...