Previous  Next          Contents  Index  Navigation  Glossary  Library

Sample Invoice Account Generation Activities

Following is a description of each activity in the sample process for Supplier Invoice Account Generation. You can create all the components for an activity in the graphical Oracle Workflow Builder except for the PL/SQL stored procedures that the function activities call.

Start Generating Code Combination (Node 1)

This is a standard activity that marks the start of the process.

Assign Value to Company Segment Using a Constant (Node 2)

This activity assigns a constant value, 01, to the Company segment.

This node and nodes 5, 6, and 8 use the Assign Value to a Segment function, which is provided by the standard flexfield workflow. For detailed information about this function, see Account Generator (Oracle Applications Flexfields Guide).

Test Whether Project Type is Overhead (Node 3)

This activity tests whether the project type is Overhead. The test value is set to the item attribute Project Type. The reference value is the constant Overhead. The test can have two possible results:

If the result is Equal, the process branches to node 6. Otherwise, the process branches to node 4.

Node 3 uses the Compare Text function provided in the standard workflow.

Get Segment Value Using a Lookup (Node 4)

Node 4 is executed only if the project type is not Overhead. This activity performs a lookup to determine the Cost Center segment. The lookup uses an AutoAccounting lookup set and an intermediate value (expenditure organization).

The function can have two possible results:

If the result is Success, the process branches to node 5. If not, the process branches to node 11.

Node 4 uses the Segment Lookup Set Value function, pa_acc_gen_wf_pkg.pa_seg_lookup_set_value. You can use this function to retrieve an intermediate value from an AutoAccounting lookup set that you defined in Oracle Projects. See: Segment Lookup Set Value Function.

Assign Lookup Result to Cost Center Segment (Node 5)

This activity assigns the value found in Node 4 to the Cost Center segment. The process then branches to Node 7.

Assign Flexfield2 (parameter) to Cost Center Segment (Node 6)

Node 6 is executed only if the project type is Overhead. This activity assigns the value of Invoice Descriptive Flexfield Attribute 4 to the Cost Center segment.

This assumes that the Invoice Descriptive Flexfield Attribute 4 holds a valid value for the Cost Center segment.

Sample Function to Get Segment Value Using SQL(Node 7)

Node 7 uses a SQL procedure to derive the value for the Account segment.

The sample SQL package and procedure are contained in the file PAXTMPFB.pls. This file is located in the Oracle Projects admin/sql directory. The SQL procedure is named pa_wf_fb_sample_pkg.pa_wf_sample_sql_fn. The sample procedure contains detailed documentation.

The sample function derives the segment value and sets the value in the Lookup Set Value attribute. If you write your own functions, you should create and set your own attributes.

If the process encounters an error during any of the steps, the function branches to Node 12.

Note: When you define a SQL function, you can define attributes for the function. The procedure reads the current values of the item attributes it requires, then uses the attributes to derive the segment. However, in the sample process, no attributes are required for this function.

Assign Value to Account Segment After SQL Function (Node 8)

Node 8 assigns a the segment value derived in Node 7 to the Account segment.

Validate Code Combination (Node 9)

Node 9 contains the standard Flexfield function for validating a code combination. For this function to work correctly in Oracle Projects, the attribute value New code combinations must be set to True.

End Generating Code Combination (Node 10)

This activity ends the code combination generation process.

Abort Generating Code Combination (Node 11)

This activity ends the code combination process after a failure of the lookup in Node 4. This is a standard flexfield function. For detailed information about this function, see the Account Generator section of the Oracle Applications Flexfields Guide.

Abort Generating Code Combination (Node 12)

This activity ends the code combination process after a failure of the sample SQL function in Node 7. This is a standard flexfield function. For detailed information about this function, see the Account Generator section of the Oracle Applications Flexfields Guide.

Testing a Customized Account Generator Process

You should test any modified Account Generator process before using it on a production database.

You can test the supplier invoice account generation process by calling the function pa_acc_gen_wf_pkg.ap_inv_generate_account in a PL/SQL block. Table 1 - 91 lists the parameters of this function.

Oracle Projects provides an example of how to test this function. The example is in the procedure pa_wf_fb_sample_pkg.test_ap_inv_account in the file PAXTMPFB.pls in the admin/sql directory.

Return value: BOOLEAN

In Table 1 - 91, the following attributes are descriptive flexfield values entered in the Oracle Payables invoice header:

The following attributes are descriptive flexfield values entered for each Oracle Payables invoice distribution:

Parameter Name Type Mode
P_PROJECT_ID NUMBER(15) IN
P_TASK_ID NUMBER(15) IN
P_EXPENDITURE_TYPE VARCHAR2(30) IN
P_VENDOR_ID NUMBER IN
P_EXPENDITURE_ORGANIZATION_ID NUMBER(15) IN
P_EXPENDITURE_ITEM_DATE DATE IN
P_BILLABLE_FLAG VARCHAR2(1) IN
P_CHART_OF_ACOUNTS_ID NUMBER IN
P_ATTRIBUTE_CATEGORY VARCHAR2(150) IN
P_ATTRIBUTE1 through P_ATTRIBUTE15 VARCHAR2(150) IN
P_DIST_ATTRIBUTE_CATEGORY VARCHAR2(150) IN
P_DIST_ATTRIBUTE1 through P_DIST_ATTRIBUTE15 VARCHAR2(150) IN
X_RETURN_CCID NUMBER(15) OUT
X_CONCAT_SEGS VARCHAR2 OUT
X_CONCAT_IDS VARCHAR2 OUT
X_CONCAT_DESCRS VARCHAR2 OUT
X_ERROR_MESSAGE VARCHAR2 OUT

If the function returns the value FALSE, an error has occurred during account generation. Use the value in X_ERROR_MESSAGE to determine the error message.

If the value of X_RETURN_CCID is -1, it indicates that the code combination that was created using the rules does not yet exist.


         Previous  Next          Contents  Index  Navigation  Glossary  Library