ORACLE APPLICATIONS WHITE PAPER Oracle Fixed Assets Diagnosing Account Generator Errors in Fixed Assets

ORACLE
World Wide Support

1

Date

Author

Version
1.0

Change Reference
Initial Document Completed

30 MAR 2001 Kevin E. Cronk

2

TABLE OF CONTENTS

1 INTRODUCTION ...................................................................................................................................................5 2 GENERATING ACCOUNTS IN ORACLE FIXED ASSETS ............................................................................6 2.1 OVERVIEW AND DEFINITIONS ...............................................................................................................................6 2.2 FA ACCOUNT GENERATOR – THE WORKFLOW PROCESS .....................................................................................7 2.3 FA ACCOUNT GENERATOR – THE GENERATE ACCOUNTS PROCESS (FAGDA) ...................................................8 2.3.1 What Accounts Are Generated in Advance by FAGDA? ..............................................................................9 2.3.2 Generating Accounts for Retired Assets .....................................................................................................11 2.3.3 Turning Off Generate Accounts..................................................................................................................11 3 DEFAULT ACCOUNT GENERATOR PROCESS ...........................................................................................13 3.1 GENERATE DEFAULT ACCOUNT PROCESS ..........................................................................................................13 3.2 GENERATE ASSET LEVEL ACCOUNT...................................................................................................................13 3.3 GENERATE CATEGORY LEVEL ACCOUNT ...........................................................................................................14 3.4 GENERATE BOOK LEVEL ACCOUNT ...................................................................................................................15 4 USING THE UPGRADED FLEXBUILDER RULES........................................................................................16 4.1 GENERATE ACCOUNTS WITH UPGRADED FLEXBUILDER RULES PROCESS .........................................................16 4.2 INVALID PARAMETERS IN THE UPGRADED RULES ..............................................................................................16 4.3 RETRIEVING SOURCE CODE FOR THE UPGRADED RULES ....................................................................................17 4.4 CREATING SOURCE CODE FOR THE UPGRADED FLEXBUILDER RULES ................................................................18 4.5 UPGRADED FUNCTIONS WITH AN INVALID NAME ...............................................................................................18 5 DEBUGGING ACCOUNT GENERATION FAILURES ..................................................................................19 5.1 ACCOUNT FAILURES ...........................................................................................................................................19 5.1.1 When Do Accounts Fail? ............................................................................................................................19 5.1.2 Why Do Accounts Fail? ..............................................................................................................................19 5.1.3 What Accounts Failed?...............................................................................................................................20 5.2 APPLY THE LATEST DIAGNOSTIC PATCHES ........................................................................................................23 5.3 DIAGNOSE FAILURE WITHOUT THE AID OF SQL .................................................................................................24 5.3.1 Gather The Parameters ..............................................................................................................................24 5.3.2 Build the Account........................................................................................................................................27 5.3.3 Validate the Account...................................................................................................................................27 5.4 DIAGNOSING FAILURE WITH THE FAXAGTST.SQL DIAGNOSTIC SCRIPT .........................................................28 5.4.1 Finding the Correct Script..........................................................................................................................28 5.4.2 Gathering the Parameters ..........................................................................................................................28 5.4.3 Running the Script ......................................................................................................................................31 5.5 DIAGNOSING FAILURE WITH THE FAGDA_TEST.SQL DIAGNOSTIC SCRIPT .......................................................32 6 DIAGNOSING OTHER ERRORS ......................................................................................................................33 6.1 ROLLBACK SEGMENT ERRORS............................................................................................................................33 6.2 OVERWRITING WORKFLOW WHEN APPLYING PATCHES ....................................................................................33 6.3 ORA-20002 AND FAFLEXWF ERRORS ............................................................................................................34 6.3.1 Tablespace for WF tables and Indexes .......................................................................................................34 6.3.2 Reload Workflow ........................................................................................................................................34 6.3.3 Qualified Segments Defined........................................................................................................................34 6.3.4 Test For Failed Accounts............................................................................................................................35 6.3.5 Test Parameters for Upgraded Flexbuilder Rules......................................................................................35 6.4 CREATE JOURNAL ENTRIES WAITS FOR FAGDA PROCESS .................................................................................35

3

.............................................38 8 PERFORMANCE ISSUES ..........................2 IMPROVING PERFORMANCE .............................................................43 9...............................................6 NO ERROR MESSAGES IN THE LOG FILE .........................................................................35 6...................SQL TEST SCRIPT ...........................................................................................................................................................................................................................................37 7...............................................39 8........................................................................................................53 APPENDIX D – FAGDA_TEST.......43 9...................................................4 FA: GENERATE DEPRECIATION EXPENSE ACCOUNT ....36 6...................................................................2 TRUNCATING THE FA_DISTRIBUTION_ACCOUNTS TABLE ......................................................45 APPENDICES.............................................42 9...............................................................43 9.............................................................................................................................................SQL TEST SCRIPT ..............39 8................46 APPENDIX B –FAXAGTST......................................................1 ESTIMATING THE TIME TO COMPLETION ..............................CONSIDERATIONS ..............................6..50 APPENDIX C – SUCCESSFUL RUN OF FAXAGTST.............46 APPENDIX A – SAMPLE SOURCE CODE FOR UPGRADED FLEXBUILDER RULE ...........................42 9........................7 DEPRECIATION EXPENSE ACCOUNT MODIFICATIONS DO NOT WORK ...............................................................................1 GENERAL LEDGER ACCOUNTING AND WORKFLOW CHANGES IN FA .....40 9 PROFILE OPTIONS ..................................1 FA:GENERATE <ASSET/BOOK/CATEGORY> LEVEL ACCOUNT ..........................................37 7...........................5 DYNAMIC INSERTION FAILS IN FAGDA PROCESS................................SQL TEST SCRIPT .........43 10 IF AN ITAR IS NECESSARY.....55 APPENDIX E – SUBMITTING GENERATE ACCOUNT FROM THE COMMAND LINE .....63 4 ...................................................................................................................................................................................................................................................................................................................5 FA: USE FA_CUSTOM_GEN_CCID_PKG .........................................................................................36 7 MODIFYING WORKFLOW ..........................................................3 FA: NUMBER OF GENERATE ACCOUNTS PARALLEL REQUESTS ..........2 DEBUG PROFILE OPTIONS ...........................................................................................................................................

Several examples of workflow modifications are included in that document.5.X Oracle Workflow Guide Release 2.X Oracle Workflow Guide Release 2.1. Some of this information will be discussed where it is relevant to diagnose the failure to generate an account in Fixed Assets.1 Introduction This document is intended to assist in diagnosing Account Generator failures in the Oracle Fixed Assets module.0. available on Metalink under Note number 115322. If a detailed treatment of the Fixed Assets Account Generator Process is needed. 5 . Part Number A75397–01. This document is not intended to educate on the use of Workflow Builder nor is it intended to educate on the intricacies of the Account Generator workflow processes.0.5. For release 11. If a detailed treatment of the Workflow Builder is needed.3 Part Number A56104–01 Familiarity with these documents or similar workflow documentation is recommended prior to debugging Account Generation errors. please refer to the Oracle Fixed Assets Account Generator White Paper. please refer to the following: For release 11.

At the table level a distribution is active if the date_ineffective field in the fa_distribution_history table is null. Oracle Fixed Assets can generate 25 different account types in release 11. 23 in release 11. The FAGDA concurrent process generates the accounts by calling the FA Account Generator process for each active distribution for the asset book for which the process was run. This paper will discuss account generation failures in Oracle Fixed Assets and the various debugging techniques that can be used to resolve these issues.2. A particular asset has one or more active distributions. Active Distribution – An asset’s distribution is active if it has not been terminated by any transaction that changes the asset’s distribution information (units. location.X using a workflow process called FA Account Generator. CCID – Code Combination ID. location and employee associated with each asset. it is referred to as multi-distributed. short name FAGDA (Fixed Assets Generate Distribution Accounts) that will generate and store from 14 to 23 of the 25 accounts that may be needed by an asset in it’s lifetime. Generate Accounts – Name of the concurrent process used to generate accounts in Oracle Fixed Assets. 6 . The accounts that are pregenerated depend on the release and mini-pack applied (see section 2. Workflow Builder – A PC based tool that is used to access and modify the FA Account Generator workflow process stored in the database. This process calls the workflow process FA Account Generator for each of the accounts that it attempts to generate. Oracle Fixed Assets also has a concurrent process called Generate Accounts. FAGDA – short name for the Generate Accounts process (acronym for Fixed Assets Generate Distribution Accounts) FA Account Generator – Default name of the Fixed Assets workflow used in Oracle Fixed Assets to generate accounting code combinations. If an asset has more than one active distribution.1 for full list).1 Overview and Definitions Oracle Fixed Assets generates accounts in release 11.5. expense account.5.0. In this paper it refers to the Accounting Key Flexfield structure and the values from the GL_CODE_COMBINATIONS table.2 Generating Accounts in Oracle Fixed Assets 2. Definitions: Distribution – unique combination of expense account. Account generation errors can occur in a variety of transactions and processes in Oracle Fixed Assets. a unique id that represents a unique combination of flexfield segment values.X and 11.X for a particular asset. This process will be called by the application to generate an asset related account when the account is needed to complete a transaction.X.0. employee ).

To determine the workflow process you are using for account generation in FA: Navigation: Setup/Financials/Flexfields/Key/Accounts Query “FA Account Generator” Seeded values are as follows: Generate Default Account Generate Accounts Using Upgrade Rules 7 . which in turn points to the actual workflow process. FA Account Generator is in fact the workflow type. Please see section 3 of this paper for more detailed information on the default workflow process.2 FA Account Generator – The Workflow Process FA Account Generator is referred to as the workflow process for generating accounts in Oracle Fixed Assets. The “Fixed Assets Account Generator and Workflow White Paper” contains detailed information on modifying the workflow process using Workflow Builder.2.

3 FA Account Generator – The Generate Accounts Process (FAGDA) The Generate Accounts concurrent process (FAGDA) is pregenerates from 6 to 23 individual code combinations for each distribution. When a process or transaction needs an account. it first checks this table and uses the pregenerated ccid if it is populated therein. This is the only time this process is submitted unless the user also submits it as a standalone process. even it FAGDA has completed in error. depreciation and other Fixed Asset processes can complete successfully. can cause a performance bottleneck. The FAGDA process can in effect be turned off by using profile options that allow account generation for the various account groupings to be turned off. If FAGDA failes to generate an account that is needed by a process. then the process will also fail when at attempts to generate the account in question. 8 . Generate Accounts is primarily a performance enhancement feature. if the account is one of the pregenerated accounts. The FAGDA process is submitted automatically when the Depreciation process is run. such as in a depreciation run. This can be avoided by generating the needed accounts in advance using the FAGDA process. The ccids generated are stored in the FA_DISTRIBUTION_ACCOUNTS table. The FAGDA process is OPTIONAL. If the account is not present. Multiple calls to workflow to generate a large number of accounts. The name of the standalone request is “Generate Accounts”.2. then a call to workflow is made and the account is generated.

5.3.X only) Construction-in-Process Clearing Construction-in-Process Cost Depreciation Reserve Revaluation Amortization Revaluation Reserve X X X X X 9 .5.1 What Accounts Are Generated in Advance by FAGDA? This depends on the Release and the Mini-Pack applied within that release.X FAGDA Mini-Pack Account Name Depreciation Expense Cost of Removal Clearing Cost of Removal Gain. Accounts Generated Account Type Asset Level Accounts Book Level Accounts 11.X only) Bonus Depreciation Reserve (11. The following chart shows the various accounts and which accounts are generated in the FAGDA process for Release 11i.5.2. Cost of Removal Loss Deferred Depreciation Expense Deferred Depreciation Reserve Depreciation Adjustment Intercompany Accounts Payable Intercompany Accounts Receivable Net Book Value Retired Gain Net Book Value Retired Loss Proceeds of Sale Clearing Proceeds of Sale Gain Proceeds of Sale Loss Revaluation Reserve Retired Gain Revaluation Reserve Retired Loss A-D X X X X E-F X X X X X X X X X X X X X X X X X X X X X X X X X X X X Category Level Accounts Asset Clearing Asset Cost Bonus Depreciation Expense (11.

Cost of Removal Loss Deferred Depreciation Expense Deferred Depreciation Reserve Depreciation Adjustment Intercompany Accounts Payable Intercompany Accounts Receivable Net Book Value Retired Gain Net Book Value Retired Loss Proceeds of Sale Clearing Proceeds of Sale Gain Proceeds of Sale Loss Revaluation Reserve Retired Gain Revaluation Reserve Retired Loss X X X X X C X D X X X X G or 1763995 X X X X X X X X X X X X X X X X X X X X X X X X X X Category Level Accounts Asset Clearing Asset Cost Construction-in-Process Clearing Construction-in-Process Cost Depreciation Reserve Revaluation Amortization Revaluation Reserve X X X X X 10 .5.0.0.0.0 did not include the FAGDA process at all.X the accounts that are pregenerated can range from 0 to 21 accounts. all accounts except the Intercompany AR and Intercompany AP accounts are generated in FAGDA.0 or 11.X. The base release of 11. Enhancement 1553682 adds 7 more accounts. Enhancement 1004321 included eight more accounts as shown in the chart below.X FAGDA Account Name Depreciation Expense Cost of Removal Clearing Cost of Removal Gain. again the same as in the chart above with the exception of the Bonus Depreciation accounts which do not exist in release 11. If you are on the latest code in release 11. Accounts Generated Account Type Asset Level Accounts Book Level Accounts 11.In release 11. In summary. Mini-pack C included six accounts.

The accounts built could be different next month than they would be if generated today.F . 2.bug 1350298 · 11.FA.FA.X · 11i.bug 1626136 Release 11. In this scenario.FA. a value which is not known until the retirement transaction occurs. An example given in the original enhancement was an account segment for a retirement account that is based on the assets retirement type. the accounts thus generated can only be generated at the run time of the transaction. Dynamic creation of accounts at transaction run time is desirable. Both of these scenarios can be accommodated via the use of profile options that were introduced with enhancement 1106734.0.000 the performance gains become less of an issue.bug 1405177 · 11i. an asset retired in a previous fiscal year will never use the accounts associated with the distribution.3. The application will run correctly without the account generation process enabled. Fully retired assets also have an active distribution.FA.F . Since assets that have been fully retired can only be reinstated in the current year. There are three profile options that are used to enable or 11 . This typically happens in an environment that contains fully retired assets and was upgraded from an earlier version. as accounts must be generated for each unique combination of book and distribution.bug 1483543 · 11i. This is a guideline only and should never be substituted for system testing in your environment.bug 1391289 · 11. As the number of assets in the system drops below 10.5.B .FA. Typically there are two reasons why account generation may be turned off for some or all accounts: · · Not enough assets in the system to make the performance gains worthwhile.X · 11. They can be used to selectively turn off account generation by the FAGDA process.2.3 Turning Off Generate Accounts The Generate Accounts process was developed as a performance enhancement.FA.0. The Generate Accounts process attempts to create accounts for all active distributions.bug 1509971 · 11i.0.E .FA.G .E .D .2 Generating Accounts for Retired Assets A problem can arise when FAGDA attempts to generate accounts for fully retired assets for which the accounts to be generate are no longer active. This issue was addressed by excluding assets retired in a previous fiscal year and the code is included in the following mini-packs for FA: Release 11.bug 1794240 Subsequent mini-packs will include these fixes as well. therefore they need not be generated. Consideration must also be given to the number of books in your environment.C .FA. Certain business models require use of accounts for specific transactions that are time sensitive.0.bug 1584277 · 11i.3.

A value of NO will skip the accounts. The profile options are as follows: FA: Generate Asset Level Account FA: Generate Book Level Account FA: Generate Category Level Account Values of YES or NULL will result in account generation for the accounts within that level.disable account generation by account level. 12 . Please see section 9 for a detailed explanation of how to enable/disable these profile options. The accounts affected are the same as in the chart on pages 9 and 10.

The following figures in sections 3. Default Asset Account Level Generation Company 1 Cost Center 2 Account 3 Sub-Acct Product Distribution (Expense) Account Asset WorkBench/Assignments 02 400 7500 300 621 DEPRECIATION EXPENSE ACCOUNT 02 400 7500 300 621 1 .3 Default Account Generator Process 3.3 and 3.Balancing Segment 2 .Qualified Segment .0.1 Generate Default Account Process To effectively diagnose and correct account generation errors it is imperative to understand how Oracle Fixed Assets builds the various accounts.2. The corrected version was provided in patch 1000331 and is in version 110. For category level accounts it used the cost center from the expense account (distribution_ccid) instead of the cost center from the account generator default account (default_ccid) in the book controls form. The default workflow has a different definition for each group of accounts.2 Generate Asset Level Account The Asset Level accounts include only the Depreciation Expense Account. Asset Level Accounts: Depreciation Expense The default workflow for the asset level account simply uses all the segments from the expense account that was assigned to the asset in the Assignments Form.Cost Center 3 .Qualified Segment . In release 11. 3.6 of faflxgrp.X the original seeded workflow was not the correct default workflow.Natural Account 13 . Each diagram also gives the navigation within the application where the actual values can be retrieved.4 show a diagram of the default account generation for the different levels of accounts.wft and can be found in the FA_TOP/patch/110/import/ directory.Qualified Segment . 3. The FA Account Generator workflow groups the assets into three different groups referred to as levels.

Cost Center 3 .Expense account (DISTRIBUTION_CCID) . This allows for cost center level detail on the balance sheet.3 Generate Category Level Account The accounts included in the Category Level are as follows: Category Level Accounts: Asset Clearing Asset Cost Bonus Depreciation Expense (11.Various accounts from the category definition. 14 .Balancing Segment 2 .Default account (DEFAULT_CCID) .X only) Bonus Depreciation Reserve (11. .X only) Construction-in-Process Clearing Construction-in-Process Cost Depreciation Reserve Revaluation Amortization Revaluation Reserve The default workflow for the category level account pulls the required segments from three different account combinations. The following example is for the ASSET_COST_ACCOUNT: Example of Default Category Account Level Generation Company 01 1 Default Account From Book Controls DEFAULT_CCID parameter Setup/Asset System/Book Controls Distribution Account DISTRIBUTION_CCID parameter Asset WorkBench/Assignments Account Segment from Category ACCOUNT_SEGMENT parameter Setup/Asset System/Asset Categories ASSET COST ACCOUNT 1 .3.Natural Account Cost Center 000 2 Account 9999 3 Sub-Acct Product 000 000 02 400 7500 300 621 01 000 1520 000 000 02 000 1520 000 000 A common modification is to derive the Cost Center qualified segment from the expense account rather than from the default ccid.5.5.

The following example is for the NBV_RETIRED_LOSS_ACCOUNT: Example of Default Book Account Level Generation Company 01 1 Default Account From Book Controls DEFAULT_CCID parameter Setup/Asset System/Book Controls Distribution Account DISTRIBUTION_CCID parameter Asset WorkBench/Assignments Account Segment from Book Controls ACCOUNT_SEGMENT parameter Setup/Asset System/Book Controls/Nat.Balancing Segment 2 .4 Generate Book Level Account The accounts included in the Book Level are as follows: Book Level Accounts: Cost of Removal Clearing Cost of Removal Gain.Cost Center 3 .3. Cost of Removal Loss Deferred Depreciation Expense Deferred Depreciation Reserve Depreciation Adjustment Intercompany Accounts Payable Intercompany Accounts Receivable Net Book Value Retired Gain Net Book Value Retired Loss Proceeds of Sale Clearing Proceeds of Sale Gain Proceeds of Sale Loss Revaluation Reserve Retired Gain Revaluation Reserve Retired Loss The default workflow for the book level account is identical to the category level except that the natural account segment comes from the Book Controls rather than from the category.Natural Account Cost Center 000 2 Account 9999 3 Sub-Acct Product 000 000 02 400 7500 300 621 9400 02 000 9400 000 000 15 . Accts NBV RETIRED LOSS ACCOUNT 1 .

7 should be duplicated in workflow (see Note number 115322. A patch was available in release 10.0 and 11.7.How to test the individual upgraded flexbuilder rules. Flexbuilder is a series of rules defined for each unique combination of account type and book.0 or 11.7 did not include the distribution_id (do not confuse with distribution_ccid) as a standard parameter for the flexbuilder functions. any modifications in flexbuilder for release 10. for example the function name for the the asset cost account would be as follows: OPS_CORP_ASSET_COST To utilize these rules.1 Generate Accounts With Upgraded Flexbuilder Rules Process In release 10. When a system with this parameter defined is upgraded. The calling functions are in the following code from the FA_FLEX_UPG_PKG package. Workflow is still utilized. If the account generator workflow is used after an upgrade.7. an incompatibility may result between the upgraded rules and the functions that call them. then the corresponding package in release 11. An example of one of the functions extracted in this manner is the category level function: FUNCTION CATE_LEVEL_ACCT (X_flex_num in number. X_func in varchar2. The behavior of the default workflow in release 11. but the workflow process calls the upgrade function rather than applying the rules as defined in the default workflow. If the book name was OPS CORP in 10.2 Invalid Parameters in the Upgraded Rules Release 10.7 that supplied this value as a parameter. 4.1). X_acct_seg in varchar2. the workflow process that is selected in the Account Generator form (see section 2.5 is the same as the default behavior of flexbuilder in release 10.102 .7.5 is OPS_CORP_<account type>.7 Flexbuilder was used for account creation. select text from dba_source where name = 'FA_FLEX_UPG_PKG' and owner = 'APPS' and type = 'PACKAGE'. 1015769. An upgraded flexbuilder function can be tested using the detailed instructions on Metalink as follows: 1015770. The following note provides a script and detailed instructions on testing the calling functions.Test the calling functions to verify parameter mismatches. (script calls the functions WITH the distribution_id parameter) The code can also be compared manually. the existing flexbuilder rules can be converted into PLSQL packages that are stored in the database. 16 .102 .4 Using the Upgraded Flexbuilder Rules 4.1) should be the “Generate Accounts Using Upgrade Rules”. X_acct_ccid in varchar2. When upgrading from Release 10.

3 Retrieving Source Code for the Upgraded Rules The source code for upgraded rules in release 11. If the parameters do not match. PACKAGE OPS_CORP_ASSET_COST AUTHID CURRENT_USER AS FUNCTION BUILD ( FB_FLEX_NUM IN NUMBER DEFAULT 101.X may need to be accessed for the following reasons: . 4. DISTRIBUTION_CCID IN VARCHAR2 DEFAULT NULL.X_def_ccid in varchar2. Due to the large number of individual functions it would likely be easiest to modify the calling functions in FA_FLEX_UPG_PKG.replace name ('OPS_CORP_ASSET_COST') with the book specific function name select text from dba_source where name = 'OPS_CORP_ASSET_COST' and owner = 'APPS' and type = 'PACKAGE'.X and 11. select text from dba_source where name = 'OPS_CORP_ASSET_COST' and owner = 'APPS' and type = 'PACKAGE BODY'. X_dist_ccid in varchar2. FB_ERROR_MSG IN OUT VARCHAR2) RETURN BOOLEAN. X_error_msg in out varchar2) RETURN BOOLEAN. 17 . run the following query.0. X_flex_seg in out varchar2. Compare that code to the following category level account package definition: -.5. FB_FLEX_SEG IN OUT VARCHAR2. ACCOUNT_CCID IN VARCHAR2 DEFAULT NULL. either the individual functions must be changed or the FA_FLEX_UPG_PKG must be modified. Please see APPENDIX A for the full text of an upgraded asset cost function. ACCOUNT_SEGMENT IN VARCHAR2 DEFAULT NULL.verify and debug functionality for a specific account/book function To view the source code created in the upgrade process. Replace “OPS_CORP” with the name the asset book in question. END OPS_CORP_ASSET_COST.modify account generation when using upgraded rules . DEFAULTS_CCID IN VARCHAR2 DEFAULT NULL.

' '. This issue was noted in BUG 1359213.'_') ||'"' from fnd_flexbuilder_functions f where f.use workflow instead of the upgraded rules.pls" The following sql will create the command line statements: select '$FND_TOP/bin/FNDFBPLS apps/apps 0 Y "OFA" "' ||f.function_code. Such a function name is illegal in PLSQL and account generation will fail for this book when attempting to use the upgraded flexbuilder rules.5 Upgraded Functions with an Invalid Name As previously discussed the upgrade process creates functions with names in the following format: <book_type_code>_<account type> Oracle Assets allows a book to be defined that starts with a numeric character. 18 .rename the book and all related records in the data base for the book in question.application_id = 140. 4. run the following commands: $FND_TOP/bin/FNDFBPLS apps/apps 0 Y "OFA" "<flexbuilder function name>" "unique file name" example: $FND_TOP/bin/FNDFBPLS apps/apps 0 Y "OFA" "US CORP DEPRN_EXP" "opcoexp.4 Creating Source Code for the Upgraded Flexbuilder Rules This process is detailed in the Upgrade Manual Chapter 12 (Flexbuilder) under To summarize the process: 1) Run the following to retrieve all of the flexbuilder functions: select f.application_id = 140.4. The solutions is to either .function_code ||'" "' ||translate(f. such as 123 CORP. The second option requires comprehensive sql updates and will need development/consulting involvement to implement. 3) Then you need to execute each of the statements to create the correct package specification and body.function_code from fnd_flexbuilder_functions f where f. In this case the upgraded function name for asset cost would be “123_CORP_ASSET_COST”. . 2) For each function.

Whenever a code combination is needed for a particular transaction.Reclassification Processes: Calculate Gains and Losses . New error message diagnostics are available in the latest updates that often provide the reason for the failure in the log file itself.Invalid worklflow setup and configuration.The account violates a cross validation rules.Segment value has been disabled. . . 19 .5 Debugging Account Generation Failures 5.Accounting code combination does not exist and dynamic inserts is not enabled.Segment value has been end dated. Account failures are most common (but not limited to) the following areas: Forms: Asset Workbench/Assignments . (see sections 5. .FARET Depreciation – FADEPR Generate Accounts – FAGDA Create Journal Entries – FAPOST Periodic Mass Copy – FAMCP 5. .3 and 5.Accounting code combinations has been end dated.1. the application will generate it if it has not been generated using the Generate Accounts (FAGDA) process.1 Account Failures 5.2 Why Do Accounts Fail? Account failures can usually be traced to one of the following: .2).Transfers Asset Workbench/Open . . .1.1 When Do Accounts Fail? Account Generation errors can occur in numerous places in the Fixed Assets application.Accounting code combinations has been disabled.1.

A review of the log file is always the frist step in determining what accounts failed. Depending on the minipack level you are on the error messages can vary greatly. The Asset Number is C5971 Error: function &CALLING_FN returned failure (CALLED_FN=FA_GENACCTS_PKG. Action: Check the account segment value you are using to generate a new code combination.5. SQL can be used to determine the full extent of account failures in the Generate Accounts process.1. or further diagnosis of failures is desired.GEN_CCID) The Asset Id is 129825 If the log does not provide this information. Typically the following information will be seen: Flexbuilder failed to generate a new code combination Cause: The code combination for the generated segment values does not exist and cannot be created because it would contain invalid segment values. Error: function &CALLING_FN returned failure (CALLED_FN=FAFLEX_PKG_WF. The The The The The The The The Asset Number is C5971 Asset Id is 108635 book_type_code parameter is CORP account type parameter is NBV_GAIN account segment parameter is 3900 account CCID parameter is 0 default ccid parameter is 1120 distribution_ccid parameter is 2981 Turn on print debug to get as detailed an error message as possible: FA: Print Debug (set to Yes) Account Generator:Run in Debug Mode (set to Yes) With the latest patches applied there is enhanced error messaging as shown in the following example. (see section 5.START_PROCESS) This combination has expired.3 What Accounts Failed? The accounts that have failed are shown in the log file for the account generator process. 20 .2 for latest patches and review Metalink for patch updates) Action: Please review the following message for a detailed explanation of why the account could not be generated.

Determine what accounts are present in the FA_DISTRIBUTION_ACCOUNTS table. When this query completes successfully. SQL>describe FA_DISTRIBUTION_ACCOUNTS The output will appear similar to the following: Name BOOK_TYPE_CODE DISTRIBUTION_ID ASSET_COST_ACCOUNT_CCID ASSET_CLEARING_ACCOUNT_CCID DEPRN_EXPENSE_ACCOUNT_CCID DEPRN_RESERVE_ACCOUNT_CCID CIP_COST_ACCOUNT_CCID CIP_CLEARING_ACCOUNT_CCID NBV_RETIRED_GAIN_CCID NBV_RETIRED_LOSS_CCID PROCEEDS_SALE_GAIN_CCID PROCEEDS_SALE_LOSS_CCID COST_REMOVAL_GAIN_CCID COST_REMOVAL_LOSS_CCID PROCEEDS_SALE_CLEARING_CCID COST_REMOVAL_CLEARING_CCID REVAL_RSV_GAIN_ACCOUNT_CCID REVAL_RSV_LOSS_ACCOUNT_CCID DEFERRED_EXP_ACCOUNT_CCID DEFERRED_RSV_ACCOUNT_CCID DEPRN_ADJ_ACCOUNT_CCID REVAL_AMORT_ACCOUNT_CCID REVAL_RSV_ACCOUNT_CCID BONUS_EXP_ACCOUNT_CCID BONUS_RSV_ACCOUNT_CCID LAST_UPDATE_DATE LAST_UPDATED_BY CREATED_BY CREATION_DATE LAST_UPDATE_LOGIN Constraint Type NOT NULL VARCHAR2(15) NOT NULL NUMBER NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NUMBER(15) NOT NULL DATE NOT NULL NUMBER(15) NUMBER(15) DATE NUMBER(15) The following query will determine the number of distributions that have not generated all of the accounts that are stored in the FA_DISTRIBUTION_ACCOUNTS table. The queries that follow will need to be modified to exclude any ccids that are not in your FA_DISTRIBUTION_ACCOUNTS table. then all of the account have been successfully generated. The ccids stored therein are dependent on the release and minipack that you are on and therefore can vary within Release. These accounts typically have an error condition that prevents then from being generated. 21 .

PROCEEDS_SALE_CLEARING_CCID is null OR da.asset_id id . null. 'not null'.REVAL_RSV_ACCOUNT_CCID is null OR da. Any failures thus returned can be diagnosed with the methods that follow.2. 22 .asset_category_id and cb.PROCEEDS_SALE_LOSS_CCID is null OR da.category_id = ad.asset_number num .PROCEEDS_SALE_GAIN_CCID is null OR da. null.ad.DEFERRED_EXP_ACCOUNT_CCID is null OR da.ad.fa_distribution_accounts da .book_type_code book . removing all the OR conditions except the account you wish to test.3.COST_REMOVAL_CLEARING_CCID is null OR da.WIP_CLEARING_ACCOUNT_CCID.asset_id = ad. This query will indicate only that you have ccids that failed to generate.NBV_RETIRED_GAIN_CCID is null OR da. those accounts should be eliminated from the query. then the query will need to be edited to remove them or an error (ORA-00904: invalid column name) will result.DEFERRED_RSV_ACCOUNT_CCID is null OR da. da.book_type_code = da.book_type_code and (da.distribution_id dist_id from fa_additions ad . If this is the case.ASSET_CLEARING_ACCOUNT_CCID is null OR da.DEPRN_ADJ_ACCOUNT_CCID is null OR da.REVAL_AMORT_ACCOUNT_CCID is null OR da. -.BONUS_RSV_ACCOUNT_CCID is null OR decode(cb.If the describe command above reveals ccids that are not present as columns in your FA_DISTRIBUTION_ACCOUNTS table.BONUS_EXP_ACCOUNT_CCID is null OR da.CIP_CLEARING_ACCOUNT_CCID) is null) order by 1.distribution_id and cb. 'not null'.incomplete records in fa_distribution_accounts select da.WIP_COST_ACCOUNT_CCID.ASSET_COST_ACCOUNT_CCID is null OR da.COST_REMOVAL_GAIN_CCID is null OR da.CIP_COST_ACCOUNT_CCID) is null OR decode(cb.distribution_id = dh.dh.fa_category_books cb where dh.COST_REMOVAL_LOSS_CCID is null OR da.3.NBV_RETIRED_LOSS_CCID is null OR da.REVAL_RSV_LOSS_ACCOUNT_CCID is null OR da. da.asset_id and da.DEPRN_RESERVE_ACCOUNT_CCID is null OR da.REVAL_RSV_GAIN_ACCOUNT_CCID is null OR da. Accounts may be null in this table if account generation for the class of accounts has been disabled using the profile options in section 2. To find which accounts are in error. rerun the query for each ccid separately.fa_distribution_history dh .DEPRN_EXPENSE_ACCOUNT_CCID is null OR da.

patch 1891974. See the read me for additional information on these or any patches that are applied. (See above for description) Note: You must apply FA minipack E (Patch #1584277) before applying patch 1891974.5. The error will now display the several details including the concatenated segments being generated. deprn expense generation. For Release 11. Also included in this patch is a change that makes the generation of the bonus expense and reserve accounts conditional on whether the asset is linked to a bonus rule or not.5 Introduced in Patch 1791339 This patch enhances error messaging when Account Generator errors occur in PL/SQL based programs and form level transactions. If you are using MRC. Also available in the latest CUMULATIVE CONCURRENT PROGRAM PATCH FOR 11. Note: You must have applied FA minipack C (Patch# 1483543) or greater prior to applying this patch. Also available in the latest CUMULATIVE CONCURRENT PROGRAM PATCH FOR 11. Also displayed will be any associated FND messages such as those noting the ccid has been disabled or the combination is excluded by a cross validation rule. The error will now display the several details including the concatenated segments being generated. Note: You will also need the latest FND/Workflow patch (i. Also displayed will be any associated FND messages such as those noting the ccid has been disabled or the combination is excluded by a cross validation rule. Note: You must apply FA minipack F (Patch #1391289) before applying patch 1891974. For Release 11. Note: You must have applied FA minipack E (Patch# 1350298) or greater prior to applying this patch. Patch# 1516634 or greater) to get the concatenated segment output.0 Introduced in Patch 1763995: This patch enhances error messaging when Account Generator errors occur in PL/SQL based programs and form level transactions. patch 1891974. In addition it includes fixes for upgraded flexbuilder rules. This also adds enhanced account generator error messaging to all concurrent programs.e. 23 .2 Apply the Latest Diagnostic Patches Apply the latest patches for Account Generator include new error messaging. and dynamic insertion. you must also apply patch 1875291 immediately after applying this patch (please see the special instructions).5.0. Also included are fixes to avoid rounding issues and out-of-balance conditions in reporting books.

You must know how the failed account is being built so that you can retrieve the parameters through the forms and manually build the account. (multiply distributed assets may have more than one) 24 .Query the asset in question Open the Assignments Form Note the expense account value as shown below. 5.1 Gather The Parameters The expense account provides the balancing segment for all accounts. navigate as follows: Asset Workbench . To retrieve the expense account for a particular asset. The example that follows shows how to diagnose the ASSET_COST_ACCOUNT failure with the default workflow setup .5.3 Diagnose Failure without the aid of SQL Understanding the setup of the FA Account Generator workflow is critical to diagnose the failure without the aid of SQL. The account can then be verified to see if exists and is valid.3.

The asset cost account natural account segment comes from the asset cost account as specified in the category setup. To retrieve the cost account for a particular asset. Note the asset account value as shown below. Tab to the General Ledger Accounts zone of the form. 25 .Query the category to which the asset belongs. Query the book for which the transaction is occurring. navigate as follows: Setup/Asset System/Asset Categories .

Click on the Natural Accounts Tab. 26 .The remaining segments for the asset cost account come from the account generator default account when using the default workflow setup. The default account is specified in the book controls setup. Note the default account value as shown below. navigate as follows: Setup/Asset System/Book Controls . To retrieve the default account for a particular book.Query the book to which the asset belongs.

Fixed Assets will fail to generate the account if it violates a rule even if the account itself exists and is enabled. If all appears correct.0000.410. It is important to remember that an existing account can be created before the cross validation rule is added.2 Build the Account Build the account using the rules of the default workflow.0000.detail posting is allowed .7350. Verify the following for each value: Query the segment value and verify: .0000.the from/to dates (if populated) do not exclude todays date Even though the combination exists.3. review the cross validation rule to determine if the account violates an existing rule.9999.1550.the account exists . the following steps typically will find the error: Query the combination in the General Ledger Combinations form to verify: .000.3 Validate the Account There are several levels of validation that occur when an account is generated.000. Therefore for each segment in the accounting flexfield. it is possible that individual segment values have been disabled subsequent to the creation of the combination.000 01. Refer to section 3.000.the value exists .000 5.0000.1550.000 01. The segments shown in bold were used to build the account.5.the from/to dates (if populated) do not exclude todays date Finally.000 --------------------ASSET_COST_ACCOUNT: 01.3.the account is enabled .the value is enabled .3 for the category level default workflow. 27 . query the appropriate value set and examine the values which appear in the combination. Quite often the user can recognize what is wrong with the account at this point in the process. Expense Account: Cost Account: Default Account: 01.

28 .0 .4.sql Diagnostic Script 5. X_flex_num number := &&flex_structure.2 Gathering the Parameters The instructions to use the script are as follows: FAXAGTST.sql script is used to test account generation in Oracle Fixed Assets. The script will reside in two different directories as follows: FA_TOP/admin/sql/ FA_TOP/patch/110/sql/ The script in the admin/sql/ directory should be avoided as it likely contains a parameter error.$Header: faxagtst.SQL Instructions The faxagtst. 5.4 Diagnosing Failure With The FAXAGTST.4. Check the version of the script. ASSET_ID: The asset_id can be retirieved using the asset number: select asset_id from fa_additions where asset_number = '&number'.sql 115.5 . The main advantage of this script is that it is provided with the application. X_book_type_code varchar2(30) := '&&flex_structure'. REQUIRED ARGUMENTS: Enter value for account_type: see #1 Enter value for book: book_type_code for the book that fails Enter value for flex_structure: see #2 Enter value for distribution_ccid: see #3 Enter value for account_segment: see #5 Enter value for default_ccid: see #4 Enter value for account_ccid: see #5 In order to retrieve the required arguments you need to know the book_type_code and the asset_id.1 Finding the Correct Script The faxagtst.3 Release 11.sql program can be used to generate more specific error messages about why an account is failing.2 You can also verify the script is correct by opening it with any test editor.5.sql 110.$Header: faxagtst. If the script begins as follows: DECLARE X_flex_account_type varchar2(30) := '&&account_type'. Change the second variable declaration to read as follows: X_book_type_code varchar2(30) := '&&book'. it should be as follows: Release 11. The errors in the log or on the screen typically indicate that the Account Generator function is failing to generate the General Ledger account combination it needs.

29 .--------------Book Level Accounts (Use 0 for account_ccid parameter) AP_INTERCOMPANY_ACCT AR_INTERCOMPANY_ACCT COST_OF_REMOVAL_CLEARING_ACCT COST_OF_REMOVAL_GAIN_ACCT COST_OF_REMOVAL_LOSS_ACCT DEFERRED_DEPRN_EXPENSE_ACCT DEFERRED_DEPRN_RESERVE_ACCT NBV_RETIRED_GAIN_ACCT NBV_RETIRED_LOSS_ACCT PROCEEDS_OF_SALE_CLEARING_ACCT PROCEEDS_OF_SALE_GAIN_ACCT PROCEEDS_OF_SALE_LOSS_ACCT REVAL_RSV_RETIRED_GAIN_ACCT REVAL_RSV_RETIRED_LOSS_ACCT DEPRN_ADJUSTMENT_ACCT Category Level accounts ASSET_CLEARING_ACCT ASSET_COST_ACCT CIP_CLEARING_ACCT CIP_COST_ACCT DEPRN_RESERVE_ACCT REVAL_AMORTIZATION_ACCT REVAL_RESERVE_ACCT Asset Level Accounts DEPRN_EXPENSE_ACCT ASSET_CLEARING ASSET_COST CIP_CLEARING CIP_COST DEPRN_RSV REV_AMORT REV_RSV account_ccid) AP_INTERCO AR_INTERCO COR_CLEARING COR_GAIN COR_LOSS DEF_DEPRN_EXP DEF_DEPRN_RSV NBV_GAIN NBV_LOSS POS_CLEARING POS_GAIN POS_LOSS REV_RSV_GAIN REV_RSV_LOSS DEPRN_ADJ (Use 0 for account segment and DEPRN_EXP 2. in that case you can retrieve the asset_id using the distribution_id from the log file (distribution_id not distribution_ccid): select asset_id from fa_distribution_history where distribution_id = '&dist_id'. 1) Account type is as follows: ACCOUNT Internal name -------------------------------. The distributions_ccid If process was run with the profile option FA: Print Debug set to Yes the error log typically contains the distribution id. book_type_code from fa_book_controls where book_type_code = '&&book_type_code' 3.The log file may NOT contain an actual asset number or id. The flex_structure is as follows: select accounting_flex_structure.

select asset_id. COR_GAIN. book_type_code from fa_book_controls where book_type_code like '&&book_type_code' / 5. REV_RSV_LOSS. cb.category_id = ad. AR_INTERCO 30 . POS_GAIN. POS_LOSS.asset_cost_account_ccid account_ccid from fa_category_books cb. distribution_id. account_segment. cb. fa_additions ad id. account_ccid NBV_GAIN. book. COR_CLEARING. AP_INTERCO. NBV_LOSS. For the CATEGORY level accounts: ASSET_COST_ACCOUNT: select ad.deprn_reserve_acct cb. DEF_DEPRN_EXP.asset_id id.asset_category_id and ad. 4. REV_RSV_GAIN. fa_additions ad where cb. POS_CLEARING. Retrieve the account segment parameter as follows: select NBV_RETIRED_GAIN_ACCT NBV_RETIRED_LOSS_ACCT PROCEEDS_OF_SALE_CLEARING_ACCT PROCEEDS_OF_SALE_GAIN_ACCT PROCEEDS_OF_SALE_LOSS_ACCT REVAL_REV_RETIRED_GAIN_ACCT REVAL_REV_RETIRED_LOSS_ACCT DEPRN_ADJUSTMENT_ACCT COST_OF_REMOVAL_CLEARING_ACCT COST_OF_REMOVAL_GAIN_ACCT COST_OF_REMOVAL_LOSS_ACCT DEFERRED_DEPRN_EXPENSE_ACCT DEFERRED_DEPRN_RESERVE_ACCT AP_INTERCOMPANY_ACCT AR_INTERCOMPANY_ACCT from fa_book_controls where book_type_code = '&&book'.asset_cost_acct account_segment. code_combination_id distribution_ccid from fa_distribution_history where asset_id = '&&asset_id' and transaction_header_id_out is NULL.Otherwise run the following query.reserve_account_ccid from fa_category_books cb. This is the query to retrieve the parameters for the account_segment and account_ccid. DEF_DEPRN_RSV. cb.asset_id cb. DEPRN_ADJ.book_type_code cb. COR_LOSS. For the BOOK level accounts: account_ccid is 0 for all BOOK and ASSET level accounts.book_type_code book.asset_id = '&&asset_id' / DEPRN_RESERVE_ACCOUNT: select ad. The default_ccid is as follows: select flexbuilder_defaults_ccid.

asset_cost_account_ccid account_ccid from fa_category_books cb where cb.asset_clearing_acct account_segment.category_id = ad.where and / cb.asset_id = '&&asset_id' / RECLASSIFICATION: For the asset_cost_account and deprn_reserve_account for the new category to which you are reclassifying. sqlplus apps/apps @$FA_TOP/admin/sql/faxagtst IMPORTANT: You must provide all 7 arguments.. cb.asset_id = '&&asset_id' ASSET_CLEARING_ACCOUNT: select ad.X.4.book_type_code book. cb.category_id = &&asset_category_id / DEPRN_RESERVE_ACCOUNT: select cb.g. See Appendix B for a copy of the faxagtst.asset_category_id and ad.. Then run ASSET_COST_ACCOUNT: select cb.attribute1 = '&&segment1' and cb.deprn_reserve_acct account_segment. select cb. cb.asset_id id.category_id = &&asset_category_id / 5.asset_cost_acct account_segment.category_id = ad.attribute2 = '&&segment1' etc.asset_clearing_account_ccid account_ccid from fa_category_books cb. See Appendix C for a successful run of the faxagtst.reserve_account_ccid account_ccid from fa_category_books cb where cb.sql script for 11. cb. fa_additions ad where cb.3 Running the Script Run the following: sqlplus user/pwd @<path>faxagtst e. 31 . cb.5.asset_category_id from fa_category_books cb where cb.asset_category_id ad.sql script.

sql runs can be viewed by selecting VIEW/PAGE SOURCE in your browser. 32 .sql Diagnostic Script The FAGDA_test.sql script appears in it’s entirety in Appendix D.sql script for all of the accounts for a particular asset. To run the script all that is need is the asset_id and book_type_code. It fornats that output in an HTML format in a file named FAGDA_test.html.sql script for every account for the asset in question. The results of the indeividual FAXAGTST.5 Diagnosing Failure With The FAGDA_test.sql <Asset_id> "<book_type_code>" For example: @FAGDA_test. The script can be cut and pasted into a text file named FAGDA_test.sql. The actual ouptut of the individual runs may reveal the source of the error or the segment upon which it fails. This script runs the faxagtst. A sample of the FAXAGTST.sql 1234 "CORP" The output will appear similar to the following for each account generated: =========================================================== Book_type_code: OPS CORP Flex_Structure: 101 Distribution_ccid: 19347 Account_segment: 1540 Account_ccid: 12847 Default_ccid: 34616 Success CCID is :19351 Segments : 01-470-1540-0000-000 =========================================================== Review any combinations and error messages that do not generate successfully. The script actually runs the FAXAGTST.5. @FAGDA_test.sql output is in Appendix C. The script will retrieve the balance of the parameters. This file can be viewed with your browser.

2 Overwriting Workflow When Applying Patches Applying a mini-pack may cause unprotected customizations to be overwritten if they have not been prorperly protected. The problem is without extending. Each time you enter a new extent in the first example. Of course. they may wish to try an extent size the same or smaller than the present setting. and the process can be resubmitted as often as necessary to get the intial build of accounts completed. preserving 38MB. however in 11i all FA mini-packs call wfload with the UPGRADE option. causing the ORA-1555.X FA was the only product that did not call WFLOAD in the minipacks.6 Diagnosing Other Errors 6. a 20 times increase in the extent size would have had a similar effect. though it is not particularly economical in its usage of disk space.0 the patch driver did not execute the WFLOAD command in the mini-packs. If the ct is at 2 extents minimum. With 20 extents as a minimum.5. It is not likely to occur with normal processing volumes. this is usually seen in runs of FAGDA where thousands of records are being populated. As a side note.0. 33 . No data is lost as it commits at every record. The FAGDA process does not cause the rbs to extend as it commits for every record it creates in fa_distribution_accounts. every time you cross the boundary between those two extents. fully one half of the rollback information is lost. For example: 1) 2 minimum extents 20 MB each for 40 MB total at minimum size. only 1/20 of the information previously written in the rbs is lost. 6. In example 2). but with a minimum extents setting of 20. this information is accessed (why I am not sure). preserving 20 MB. Each time you enter a new extent you only lose 2MB of rbs used for read consistent image. Both examples use the same "minimum" size.1 Rollback Segment Errors The ORA-01555 is common when running this process the first time. you lose 20MB of rbs used for read consistent image. many articles on Metalink refer to a recommended setting of 20 for APPS. All financial products in 11. At some point in large runs for FAGDA. Therefore.X call WFLOAD with the UPGRADE option. in release 11. The problem can usually be minimized by increasing the number of the minimum extents in the rbs being used for FAGDA. verses 2) 20 minimum extents of 2 MB each for 40 MB total at minimum size. In release 11. the rbs will never use more than the 2 minimum extents. Often the setting on the clients system is 2. then each time you cross into a new extent.

The Cost Center qualifier is only required in Oracle Fixed Assets and Project Accounting and may therefore not be set. 6. use the FORCE option on the command line: ***WARNING – this option will overwrite your existing workflow *** $FND_TOP/bin/WFLOAD usr/pwd 0 Y FORCE $FA_TOP/<path>/<filename.2 Reload Workflow This error has also been eliminated by reloading the workflow file. 34 .3. Even if protected the options can be overwritten if the ct uses the FORCE option instead of UPGRADE. When run on the database server. PA in particular. the following command will load the workflow into the database: $FND_TOP/bin/WFLOAD usr/pwd 0 Y UPGRADE $FA_TOP/<path>/<filename.3. 6. If a PROTECTED workflow is overwritten it is likely due to rerunning wfload with the FORCE option after seeing wfload access level errors in the patch log file due to a protected workflow. 6.wft> For example: $FND_TOP/bin/WFLOAD apps/apps 0 Y FORCE $FA_TOP/patch/110/import/faflxgrp.Customized workflows will not be overwritten if the access levels have been set to reflect the customizations.3 ORA-20002 and FAFLEXWF Errors Generate Accounts process errors and the following error is in the log file: ORA-20002: 3136: Item 'FAFLEXWF/#SYNCH' cannot be accessed while synchronous process in progress. but UPGRADE is the default in the driver files for the patches. This has been reported in other products recently as well.1 Tablespace for WF tables and Indexes The most common cause of this error is a tablespace violation.3 Qualified Segments Defined Particularly if this is a new implementation.wft To overwrite a protected workflow.wft 6. as this apparently is standard patching procedure in 11i products (to call wfload).wft> For example: $FND_TOP/bin/WFLOAD apps/apps 0 Y UPGRADE $FA_TOP/patch/110/import/faflxgrp. Please review the Alert log for the time frame that includes the time frame during which the process ended in error. OR ORA-20002: 3103: Attribute 'BOOK_TYPE_CODE' does not exist for item 'FAFLEXWF/'. We have received a few TARs where custom workflows were replaced because the customer had NOT protected their changes. make sure that the Cost Center segment is qualified in the definition of the Accounting Flexfield.3.

the Generate Process is decoupled from all required processes including Create Journal Entries.How to test the upgraded flexbuilder rules.5 Test Parameters for Upgraded Flexbuilder Rules If the Generate Accounts process has never been run successfully and you are using the upgraded flexbuilder rules. 6. If you are not on the current code you can manually uncouple FAGDA from the Create Journal Entries process using one of the following options: 1) Edit the existing request set to allow CJE to continue of FAGDA fails.6 How do I use the FAXAGTST. *** You must have applied FA Patchset C (1483543) or higher before applying this patch *** 35 .6.102 .1> CREATE NEW REQUEST SET: <Note:1019842.3.102> 6.SQL to debug problems 6. Also fixes problems with date formatting and dynamic insertion. run the account generator test for the asset in question from one of the following notes: NOTE:146661.4 Create Journal Entries waits for FAGDA process If you are on a current mini pack. Note 1015769. 2) Create a new Create Journal Entry request set that does not include FAGDA 3) Apply a current mini-pack EDIT THE REQUEST SET: <Note:102594.Test the calling functions to verify parameter mismatches.3.1 Account Generator Test Script for Fixed Assets NOTE:1062849.102 .4 Test For Failed Accounts If the error message also indicates failure on a particular distribution. please review Note 1015770. This will provide consistent and detailed messaging to the user.5 Dynamic Insertion Fails in FAGDA Process 1854331 Patch Description PLACEHOLDER FOR MERGING ACCOUNT GENERATOR MESSAGING ENHANCEMENTS INTO PRO*C Patch will merge the new detailed error messaging from account generator with programs like depreciation and gain loss.

If nothing at all appears in the log file.100)). This is accomplished with a profile option. modifications to the FA Account Generator workflow to specifically generate the expense account in a manner other than the default method will be ignored unless the application is told to call workflow for the expense account. that directory must have the permissions set to allow read/write access to allow error messages.6 No Error Messages in the Log File If there are start and end messages in the log file but no errors. end spool 6. To force a call to workflow for the expense account.put_line('v err buf is '||substr(v_err_buf. Finished executing request completion options. run the following request from Sysadmin responsibility: Submit and Purge Concurrent Request Statistics The following workaround is available as a short term solution when there are no error messages in the log file: Run FAGDA from SQL using the following script and the error messages will be displayed : spool <filename> set serveroutput on declare v_err_buf varchar2(20000). The application uses the expense account directly. v_ret_code number. Rather than call workflow to generate the same account.ora initialization file for the database must point to the same directory.. end.7 Depreciation Expense Account Modifications Do Not Work The expense account is a special case when making modifications to workflow. begin fa_genaccts_pkg. dbms_output. The log will be similar to the following: FAGDA module: Generate Accounts Current system time is 10-MAR-2000 09:12:03 Executing request completion options. by default workflow is not called. the most likely cause is an environment problem. Also.. The expense account generated is the same as the expense (distribution) account for the asset.1. Therefore. <Insert the book_type_code> ).v_ret_code. FA: Generate Depreciation Expense Account 36 .gen_accts(v_err_buf.6. Concurrent request completed The APPLTMP environment variable and the util_file_dir variable in the init. set the following profile option to Yes.

NaturalAccount 1) Asset is added: Original workflow did NOT use a cost center.1500 The proper way to handle a change when an account (typically asset cost or depreciation reserve) that carries a balance on the balance sheet is modified in workflow to generate a different account.7 Modifying Workflow . it will transfer the asset from the old cost/reserve to the new cost/reserve accounts. The accounts may not exist or could violate cross validation rules that were not a factor before the change. They are then immediately transferred back from the dummy location to the original location. There are several references that indicate that the solution may be to truncate the fa_distribution_accounts table and regenerate all of the accounts.000. Cost Account now stored in FA is 01. This allows the application to account for the change from the old account into the newly generated account. This leaves a Credit balance in 01.410. The following example illustrates the problem: Account structure: BalSegment. This will insure that the General Ledger and Fixed Assets detail remain in balance. the new accounts that are generated as a result of the change may experience validation errors in various processes and transactions in the application. When Generate Accounts is run.410.410.CostCenter. All assets in a particular location can be transferred to the dummy location.1500 3) Truncated the FA_DISTRIBUTION_ACCOUNTS table.410.410.000.1500 4) Transfer or Reclassify the Asset The asset is transferred out of account 01.1500.000. One way of accomplishing this would be using Mass Transfer and a dummy or currently unused location. This is not a supported solution when the affected accounts are balance sheet accounts since this could leave an imbalance between Fixed Assets detail and the General Ledger balances. 7. These errors can be diagnosed with standard debugging procedures ans ttest scripts in section 6.1 General Ledger Accounting and Workflow Changes in FA The most significant issue with a workflow change is to coordinate the change with the existing general ledger accounting for the transactions which pre-dated the workflow change. When a change to workflow or a change to the PLSQL functions for upgraded rules are made.1500 even though in General Ledger the Asset Cost is still in account 01. This results in a new distribution for the asset.1500 and an offsetting Debit balance in 01. 37 . Expense Account: 01.7500 Category Cost Account Segment: 1500 Cost Account to Which Asset Cost was debited: 01. requires that the asset be transferred.1500 2) Modified workflow to use a cost center. Ran FAGDA to regenerate the accounts.Considerations Modifications to workflow are often the cause of account generation errors. Cost Account which workflow now generates: 01.

This is often used when in the implementation phase of fixed assets or when assets entries are not posted to the general ledger.7. After truncating. all accounts will need to be regenerated for all books.2 Truncating The FA_DISTRIBUTION_ACCOUNTS Table TRUNCATE TABLE FA_DISTRIBUTION_ACCOUNTS.1). This will adversely affect performance and can result in detail Fixed Asset ledgers not balancing with the asset account balances in the General Ledger. As a general rule. the fa_distribution_accounts table should never be truncated (see section 7. 38 .

Subselect eliminate rows already generated for this book.1 Estimating the Time to Completion If FAGDA is running. This is the number of minutes to completion.fiscal_year = dp.book_type_code and dp. -. Run the following query one minute apart (use '/' from the SQL command line to rerun the query 60 seconds later).asset_id and bk. this value is the records per minute that are being committed. -.book_type_code = bk. select count(*) from fa_distribution_history dh .period_counter_fully_retired >= (select min(dp1.book_type_code = bk. select count(*) from fa_distribution_accounts where book_type_code = '&book'.To determine the count of active fa_distribution_history -records that require a row to be generated in -fa_distribution_accounts.period_counter_fully_retired is null OR bk. -.fa_books bk .book_type_code = '&book' and dp. you can estimate the time to completion.book_type_code).transaction_header_id_out is null and (bk.accounts have been generated.period_close_date is null and bk.period_counter) from fa_deprn_periods dp1 where dp1.To determine the total number of distributions for which -. Then determine the number of records that need to be generated with the following query. 39 . Subtract the first result from the second. Supply the book_type_code -for the book that you are running generate accounts.fa_deprn_periods dp where dh.8 Performance Issues 8.transaction_header_id_out is null and bk. divide the previous result by sixty. Divide the result from the last query by the result from the first query.asset_id = dh. To determine the hours until completion.fiscal_year)) and distribution_id not in (select da.distribution_id from fa_distribution_accounts da where da.

apply patch 1516634. 4) Run the Purge Obsolete Workflow Runtime Data concurrent request. load on the system.If set to 1. Note:1018928. etc. . 1) For both release 11. different settings can affect performance.102 on Metalink.0 and 11.8. .1 to first establish a base line performance so that the following options can be tested for effectiveness after the appropriate changes have been made. 2) Turn off the following profile options to reduce overhead: FA: Print Debug (set to No) Account Generator:Run in Debug Mode (set to No) Verify that these options are turned off at the USER level as well.4 Maintenance Pack.If set to greater than 1.5. Depending on hardware configuration. try with value of 1. It is also included in Oracle Applications 11. Book level accounts include: Cost of Removal Clearing Cost of Removal Gain Cost of Removal Loss Deferred Depreciation Expense Deferred Depreciation Reserve Depreciation Adjustment Net Book Value Retired Gain Net Book Value Retired Loss Proceeds of Sale Clearing Proceeds of Sale Gain Proceeds of Sale Loss Revaluation Reserve Retired Gain Revaluation Reserve Retired Loss 40 . 3) Check the setting for the following profile option: FA: Number of Generate Accounts Parallel Requests Valid values are from 1 to 15.2 Improving Performance Use the information in section 8. try a value from 2 to 5.5.0.5. . This patch is included in FND minipack H and later for Release 11. This patch is included in FND minipack C and later for Release 11.If set greater than 5. it specifically implements additional caching in the workflow account generator packages. This patch provides the latest performance enhancements for workflow. next try with a value of 2 to 5 In each case. 5) Consider turning off Account Generator for book level accounts. recheck performance after the change.

certain transactions such as Mass Retirements will perform substantially better if these accounts are not turned off. However. 41 . Typically very few of these accounts are used in an assets lifetime and they can be safely generated at transaction time without sacrificing significant performance. To turn off book level accounts set the following profile option to NO: FA: Generate Book Level Account Values of YES or NULL will result in account generation for the accounts within that level. A value of NO will skip these accounts.On the latest version of the code all of these accounts are generated for each distribution.

1 FA:Generate <Asset/Book/Category> Level Account Three new profile options: FA:Generate Asset Level Account FA:Generate Book Level Accounts FA:Generate Category Level Accounts Setting any of these profiles to 'NO' will prevent the Generate Accounts Program from pre-generating any of the associated accounts.9 Profile Options The profile options related to the FA Account Generator process are as follows: FA:Generate Asset Level Account FA:Generate Book Level Accounts FA:Generate Category Level Accounts FA: Number of Generate Accounts Parallel Requests FA: Generate Depreciation Expense Account FA: Use FA_CUSTOM_GEN_CCID_PKG FA: Print Debug Account Generator:Run in Debug Mode 9. To set the profile options they must first be visible and updateable at the appropriate access level. when a segment value is determined by an asset's retirement type which can not be known at the time of addition. 42 . The value 'NO' should only be used in cases where the FA workflow has been customized so that one or more accounts for a single asset & distribution may change over time. NOTE: Excluding one or more account types from processing by the Generate Accounts program will have significant performance impacts as workflow will be called for each account as needed. This is especially important in the case of mass transactions and batch processing such as Depreciation. Typically these options will be set at the application level since the expectation is that they be consistent for all users and responsibilities using Oracle Assets. For example. The profile options can then be set at the level for which they were enabled. In general they should be left NULL or set to 'YES'. Responsibility: Application Developer Navigation: Profile Query in the name field for each profile options as follows: FA_PREGEN_ASSET_ACCOUNT FA_PREGEN_CAT_ACCOUNT FA_PREGEN_BOOK_ACCOUNT In the box titled “System Administrator Access” check the appropriate boxes for “visible” and “updateable” as required. By default these profiles should be left as NULL or set to 'YES'.

9.4 FA: Generate Depreciation Expense Account FA: Generate Depreciation Expense Account (Yes/No) By default workflow is not called for the depreciation expense account. calling workflow would be redundant and waste resources when the account it generates is identical to the account to which it was originally assigned. subsequently. Asset Clearing Account. Oracle Assets will now provide a PL/SQL package and stub function which a customer can modify to generate code combinations without using Account Generator. Since each asset is assigned to one or more expense accounts when it is created. There are performance issues associated with using Account Generator and Generate Accounts does not alleviate the performance issues. although it can be run ahead of critical month-end processes. etc. This package contains a function called 'fafbgcc' which calls the Workflow process to generate code combinations.7. Oracle Assets shipped a new concurrent program called Generate Accounts (FAGDA) which generates all the code combinations for all the distributions in a book and stores it in a table called FA_DISTRIBUTION_ACCOUNTS.3 FA: Number of Generate Accounts Parallel Requests FA: Number of Generate Accounts Parallel Requests (1-15/null) 9. Therefore. Depreciation Reserve Account. A profile option. The code to generate code combinations using Account Generator in Oracle Assets is contained in the package FA_GCCID_PKG which is shipped in the file FAFBGCB.2 Debug Profile Options FA: Print Debug (Yes/No) Account Generator:Run in Debug Mode (Yes/No) 9. Oracle Assets uses Account Generator implemented using Workflow rules and procedures to generate code combinations for all the account types. if the workflow for the expense account has been modified. Account Generator is called repeatedly to generate the combinations for each account type and. As mentioned earlier. FA: Use FA_CUSTOM_GEN_CCID_PKG to Generate CCID. Some of the account types for which Oracle Assets creates code combinations are: Asset Cost Account.9. Depreciation Expense Account.5 FA: Use FA_CUSTOM_GEN_CCID_PKG FA: Use FA_CUSTOM_GEN_CCID_PKG (Yes/No) From patch 1141094: In Release 11. all transactions and concurrent programs such as Depreciation (FADEPR) and Create Journal Entries (FAPOST) check if a combination already exists in the table FA_DISTRIBUTION_ACCOUNTS and uses the combination if it exists. when enabled 43 . this profile option must be set to “Yes” to force the application to call workflow to generate the expense account. thereby significantly speeding up month-end close. See section 6.pls.

fafbgcc to call the stub package instead of calling Oracle's Workflow to generate code combinations. The stub package is called: FA_CUSTOM_GEN_CCID_PKG and the function is called: gen_ccid. sysdate) >= sysdate. 44 . After calling the stub function FA_GCCID_PKG. 'fafbgcc' will also return a failure to the calling function which could have been invoked during a transaction or by a concurrent program. 'fafbgcc' will not. In the case where the stub returns TRUE.code_combination_id = X_rtn_ccid AND glcc. In the case where the stub returns FALSE.fafbgcc will check the return value of either TRUE (indicating success in generating a code combination) or FALSE (indicating failure in generating a code combination) of the stub.will allow FA_GCCID_PKG. The following SQL will be used to validate the ccid returned by the custom stub package: CURSOR validate_ccid IS SELECT 'VALID' FROM gl_code_combinations glcc WHERE glcc. No changes must be made to the logic in FA_GCCID_PKG. The customized code in the stub package will have to ensure that the code combination for a given account type is the desired one based on what business rules are defined. 'fafbgcc' will check that the returned CCID exists in GL_CODE_COMBINATIONS and is enabled.enabled_flag = 'Y' AND nvl(glcc. All the logic required to generate a code combination must be placed in this stub package. however.end_date_active. check crossvalidation rules or the validity of individual segment values that make up the code combinations since these validations are contained within the Account Generator Workflow process which is now being bypassed.

184 115.232 110.97 110.167 115.10 If an iTAR is Necessary Things to provide to Oracle Support when logging an iTAR for Account Generation errors: 1) Name of the failed process/transaction being performed.178 115.217 110.5.122 110.216 110. 5) Asset trace if the source of the error is a specific asset.168 115.177 115.172 115. 3) Detailed description of screen errors if the error occurred in a form transaction.204 110. 2) Error Log of the failed process (with print debug enabled).X 45 . use the following chart with your FAXASSET form version to verify the information.0.184 Release 11.254 115.148 110. Scroll down until the FAXASSET form name is visible From release 11i Form Name: FAXASSET Form Version: 11.110 110.sql or FAGDA_test. 7) Mini-pack Level If unsure of the mini-pack.255 115.109 110.X FAXASSET Version From To 110.173 115.149 110.203 - Mini Patch Pack Number A B C D E F G A B C D E G 681385 733163 811357 1042202 1350298 1391289 1626136 1345671 1405177 1483543 1509971 1584277 1794240 11.183 115. 4) Output from FAXAGTST.sql.143 115. 6) System changes. Navigate to Assets/Asset Workbench Select Help/About Oracle Applications from the menu.233 110.123 110.5. especially regarding FA Account Generator workflow changes.

FB_ERROR_MSG IN OUT VARCHAR2) RETURN BOOLEAN. FB_SEG_DELIM VARCHAR2(1) DEFAULT NULL. END OPS_CORP_ASSET_COST. BEGIN /* Initialize all OUT parameters to NULL */ FB_FLEX_SEG := NULL.SEGMENTARRAY. FB_ERROR_MSG := NULL. X_ACCOUNT_SEGMENT IN VARCHAR2 DEFAULT NULL.Appendices APPENDIX A – Sample Source Code for Upgraded Flexbuilder Rule SQL> select text 2 from dba_source 3 where name = 'OPS_CORP_ASSET_COST' 4 and owner = 'APPS' 5 and type = 'PACKAGE'. X_DISTRIBUTION_CCID IN VARCHAR2 DEFAULT NULL. X_ACCOUNT_CCID IN VARCHAR2 DEFAULT NULL. DISTRIBUTION_CCID IN VARCHAR2 DEFAULT NULL. FB_FLEX_SEG IN OUT VARCHAR2. (Line Numbers added for readability) 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 PACKAGE BODY OPS_CORP_ASSET_COST AS FUNCTION BUILD_PRIVATE ( FB_FLEX_NUM IN NUMBER DEFAULT 101. /* Build Code Combination for Structure 101 */ 46 . ACCOUNT_SEGMENT IN VARCHAR2 DEFAULT NULL. 13 rows selected. FB_ERROR_MSG IN OUT VARCHAR2) RETURN BOOLEAN IS FB_SEGMENTS FND_FLEX_EXT. FB_DONE BOOLEAN DEFAULT FALSE. X_DEFAULTS_CCID IN VARCHAR2 DEFAULT NULL. PACKAGE OPS_CORP_ASSET_COST AUTHID CURRENT_USER AS FUNCTION BUILD ( FB_FLEX_NUM IN NUMBER DEFAULT 101. SQL> select text 2 from dba_source 3 where name = 'OPS_CORP_ASSET_COST' 4 and owner = 'APPS' 5 and type = 'PACKAGE BODY'. ACCOUNT_CCID IN VARCHAR2 DEFAULT NULL. FB_STATUS BOOLEAN DEFAULT TRUE. FB_FLEX_SEG IN OUT VARCHAR2. DEFAULTS_CCID IN VARCHAR2 DEFAULT NULL.

EXIT. END LOOP..5 LOOP IF (FB_SEGMENTS(i) IS NULL) THEN FB_DONE := FALSE.GET_ENCODED. END IF. END IF. END IF. /* Assignment rule #3 */ BEGIN IF (FB_SEGMENTS(1) IS NULL) THEN SELECT SEGMENT1 INTO FB_SEGMENTS(1) FROM GL_CODE_COMBINATIONS WHERE CODE_COMBINATION_ID = TO_NUMBER(X_DISTRIBUTION_CCID). END IF.. FOR i IN 1. IF (FB_DONE) THEN GOTO FB_CONCAT_SEG_VALS.SET_TOKEN('CCID2'. 'SET='). 'GL#'). /* Check if we are done */ FB_DONE := TRUE. FND_MESSAGE.SET_TOKEN('QTSET'. /* Check if we are done */ FB_DONE := TRUE. FOR i IN 1.24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 IF (FB_FLEX_NUM = 101) THEN BEGIN /* Initialize segment values */ FOR i IN 1. FB_STATUS := FALSE. END IF. END LOOP. /* Assignment rule #1 */ BEGIN IF (FB_SEGMENTS(1) IS NULL) THEN SELECT SEGMENT1 INTO FB_SEGMENTS(1) FROM GL_CODE_COMBINATIONS WHERE CODE_COMBINATION_ID = TO_NUMBER(X_DEFAULTS_CCID). END LOOP.5 LOOP FB_SEGMENTS(i) := NULL. END IF. FND_MESSAGE. END. FB_ERROR_MSG := FND_MESSAGE. '101'). EXIT. END IF. 47 .5 LOOP IF (FB_SEGMENTS(i) IS NULL) THEN FB_DONE := FALSE. FND_MESSAGE.SET_TOKEN('FLXCODE'. GOTO FB_CONCAT_SEG_VALS. 'FLEX-FLEXFIELD COMB NOT FOUND').. IF (FB_DONE) THEN GOTO FB_CONCAT_SEG_VALS. FND_MESSAGE.SET_TOKEN('CCID'. X_DISTRIBUTION_CCID). /* Assignment rule #2 */ IF (FB_SEGMENTS(3) IS NULL) THEN FB_SEGMENTS(3) := X_ACCOUNT_SEGMENT. EXCEPTION WHEN NO_DATA_FOUND THEN FND_MESSAGE.SET_NAME('FND'.

87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149

IF (FB_SEGMENTS(2) IS NULL) THEN SELECT SEGMENT2 INTO FB_SEGMENTS(2) FROM GL_CODE_COMBINATIONS WHERE CODE_COMBINATION_ID = TO_NUMBER(X_DEFAULTS_CCID); END IF; IF (FB_SEGMENTS(4) IS NULL) THEN SELECT SEGMENT4 INTO FB_SEGMENTS(4) FROM GL_CODE_COMBINATIONS WHERE CODE_COMBINATION_ID = TO_NUMBER(X_DEFAULTS_CCID); END IF; IF (FB_SEGMENTS(5) IS NULL) THEN SELECT SEGMENT5 INTO FB_SEGMENTS(5) FROM GL_CODE_COMBINATIONS WHERE CODE_COMBINATION_ID = TO_NUMBER(X_DEFAULTS_CCID); END IF; EXCEPTION WHEN NO_DATA_FOUND THEN FND_MESSAGE.SET_NAME('FND', 'FLEX-FLEXFIELD COMB NOT FOUND'); FND_MESSAGE.SET_TOKEN('CCID', X_DEFAULTS_CCID); FND_MESSAGE.SET_TOKEN('FLXCODE', 'GL#'); FND_MESSAGE.SET_TOKEN('QTSET', 'SET='); FND_MESSAGE.SET_TOKEN('CCID2', '101'); FB_ERROR_MSG := FND_MESSAGE.GET_ENCODED; FB_STATUS := FALSE; GOTO FB_CONCAT_SEG_VALS; END; <<FB_CONCAT_SEG_VALS>> /* Concatenate segment values */ FB_SEG_DELIM := FND_FLEX_EXT.GET_DELIMITER('SQLGL', 'GL#', 101); FB_FLEX_SEG := FND_FLEX_EXT.CONCATENATE_SEGMENTS(5, FB_SEGMENTS, FB_SEG_DELIM); RETURN FB_STATUS; END; END IF; /* Structure not found. Error! */ FND_MESSAGE.SET_NAME('FND', 'FLEX-BUILD NO ID_FLEX_NUM'); FND_MESSAGE.SET_TOKEN('FUNCTION', 'OPS CORP ASSET_COST'); FND_MESSAGE.SET_TOKEN('CODE', 'GL#'); FND_MESSAGE.SET_TOKEN('NUM', TO_CHAR(FB_FLEX_NUM)); FB_ERROR_MSG := FND_MESSAGE.GET_ENCODED; RETURN FALSE; EXCEPTION WHEN OTHERS THEN /* Handle Generic PLSQL Errors */ FND_MESSAGE.SET_NAME('FND', 'SQL_PLSQL_ERROR'); FND_MESSAGE.SET_TOKEN('ERRNO', TO_CHAR(SQLCODE)); FND_MESSAGE.SET_TOKEN('REASON', SQLERRM); FND_MESSAGE.SET_TOKEN('ROUTINE', 'OPS_CORP_ASSET_COST.BUILD'); FB_ERROR_MSG := FND_MESSAGE.GET_ENCODED; RETURN FALSE; END BUILD_PRIVATE; FUNCTION BUILD ( FB_FLEX_NUM IN NUMBER DEFAULT 101, ACCOUNT_CCID IN VARCHAR2 DEFAULT NULL, ACCOUNT_SEGMENT IN VARCHAR2 DEFAULT NULL, DEFAULTS_CCID IN VARCHAR2 DEFAULT NULL, DISTRIBUTION_CCID IN VARCHAR2 DEFAULT NULL,

48

150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 END

FB_FLEX_SEG IN OUT VARCHAR2, FB_ERROR_MSG IN OUT VARCHAR2) RETURN BOOLEAN IS BEGIN RETURN OPS_CORP_ASSET_COST.BUILD_PRIVATE ( FB_FLEX_NUM, ACCOUNT_CCID, ACCOUNT_SEGMENT, DEFAULTS_CCID, DISTRIBUTION_CCID, FB_FLEX_SEG, FB_ERROR_MSG); END BUILD; OPS_CORP_ASSET_COST;

49

APPENDIX B –FAXAGTST.sql Test Script
/*===========================================================================+ | Copyright (c) 1994 Oracle Corporation | | Redwood Shores, California, USA | | All rights reserved. | +===========================================================================*/ /* $Header: faxagtst.sql 115.2 2001/04/18 19:19:57 pkm ship $ */ /* simulating FAFBGCC function. */ whenever sqlerror exit failure prompt prompt &&Account_Type prompt Book &&Book prompt &&distribution_ccid prompt &&account_segment prompt &&account_ccid set serveroutput on DECLARE X_flex_account_type varchar2(30) := '&&account_type'; X_book_type_code varchar2(30) := '&&Book'; X_flex_num number; X_dist_ccid number := &&distribution_ccid; X_acct_segval varchar2(30) :='&&account_segment'; X_default_ccid number ; X_account_ccid number := &&account_ccid; X_distribution_id number default null; X_return_ccid number; itemtype varchar2(30) :='FAFLEXWF'; itemKey varchar2(30); h_concat_segs varchar2(2000); h_concat_ids varchar2(2000); h_concat_descrs varchar2(2000); h_errmsg varchar2(2000); h_encoded_msg varchar2(2000); result boolean; h_return_ccid number; char_date varchar2(27); h_appl_short_name varchar2(30); h_message_name varchar2(30); h_num number; h_string varchar2(100); BEGIN fnd_flex_workflow.debug_on; /* added for BUG# 1735689 to be consistent with 11.0 */ select accounting_flex_structure, flexbuilder_defaults_ccid into X_flex_num, X_default_ccid from fa_book_controls where book_Type_code=X_book_type_code; itemkey := FND_FLEX_WORKFLOW.INITIALIZE ('SQLGL', 'GL#', X_flex_num, 'FAFLEXWF'

50

avalue => X_distribution_id). => 'DISTRIBUTION_CCID'. avalue => X_account_ccid). h_return_ccid.SetItemAttrNumber(itemtype => itemtype. aname => 'ACCT_SEG_VAL'. itemkey. h_concat_descrs.SetItemAttrText(itemtype => itemtype.SetItemAttrNumber(itemtype => itemtype. => h_message_name). aname =>'ACCOUNT_TYPE'. dbms_output. Now dump the concatonated segs and the FND * error returned in encoded format from Workflow * -. aname => 'DISTRIBUTION_ID'.put_line('Failed to Generate CCID'). aname => 'ACCOUNT_CCID'.SetItemAttrNumber(itemtype itemkey aname avalue => itemtype. itemkey => itemkey.put_line('Segments : ' || h_concat_segs).SetItemAttrText(itemtype => itemtype.put_line('Error Message: ' || h_message_name). wf_engine. wf_engine.bridgway 04/12/01 */ FND_MESSAGE.GENERATE('FAFLEXWF'. => itemkey. itemkey => itemkey. result := FND_FLEX_WORKFLOW. =>X_book_type_code). wf_engine. itemkey => itemkey. aname => 'DEFAULT_CCID'.SetItemAttrText(itemtype itemkey aname avalue */ => itemtype. itemkey => itemkey.SetItemAttrNumber(itemtype => itemtype. => X_dist_ccid ). h_concat_segs. =>'BOOK_TYPE_CODE'. avalue =>X_flex_num). 51 . dbms_output.SetItemAttrNumber(itemtype => itemtype. IF (not result) THEN dbms_output. wf_engine. h_errmsg). /* Initialize the workflow item attributes wf_engine. h_concat_ids. wf_engine. /* BUG# 1504839 * enhancing the messaging here for fagda and for form level * transactions. avalue => X_acct_segval).). wf_engine. wf_engine. => h_appl_short_name. itemkey => itemkey. avalue =>X_flex_account_type). aname =>'CHART_OF_ACCOUNTS_ID'. => itemkey. itemkey => itemkey. --h_encoded_msg. avalue => X_default_ccid).PARSE_ENCODED (ENCODED_MESSAGE APP_SHORT_NAME MESSAGE_NAME => h_errmsg.

X_dist_ccid. h_concat_segs).put_line('Segments : ' || h_concat_segs). ltrim(rtrim(h_string)).context('FA_FLEX_PKG'. dbms_output. h_num + 8. FA_SRVR_MSG. NAME=>h_encoded_msg). END IF.ADD_MESSAGE (CALLING_FN=>'FAFLEX_PKG_WF. / exit.put_line('Success'). raise. 16). dbms_output. if (h_return_ccid = 0 ) then dbms_output. 'MESSAGE'.if (h_message_name = 'FLEX-EXCLUDED BY XVAL RULE' or h_message_name = 'FLEX-EXCLUDED BY SEC.'FAFLEXWF'). elsif (h_message_name = 'FLEX-VALUE IS DISABLED') then h_num h_num h_string h_string := := := := INSTR(h_errmsg. end if. exception when others then wf_core. end if.SET_ENCODED(h_errmsg).put_line('CCID is :' || to_char(h_return_ccid)).put_line('Value: ' || h_string). FND_MESSAGE. dbms_output. ltrim(rtrim(h_string)). h_return_ccid := FND_FLEX_EXT.put_line('Failed to generate CCID'). h_encoded_msg := FND_MESSAGE.'StartProcess'.get_ccid( 'SQLGL'. 'VALUE'. h_num + 6.X_book_type_code. RULE') then h_num h_num h_string h_string := := := := INSTR(h_errmsg. substr(h_errmsg. 'GL#'. 1). return. 52 . char_date. /* end BUG# 1504839 */ return. dbms_output.put_line('XVAL Message: ' || h_string).GET_ENCODED.START_PROCESS'. else null. if (h_return_ccid = -1) then select to_char(sysdate. h_num). /* if h_return_ccid = -1 */ dbms_output. substr(h_errmsg. END . end if.X_default_cc id. h_num).'DD-MON-YYYY') into char_date from dual. X_flex_num.

INITIALIZE 2 APPLICATION_SHORT_NAME = SQLGL 3 CODE = GL# 4 NUM = 101 5 ITEMTYPE = FAFLEXWF 6 ITEMKEY GENERATED IS 35403 7 PROCESS SELECTED IS DEFAULT_ACCOUNT_GENERATION 8 APPLICATION ID IS 101 9 NUMBER OF SEGMENTS IS 5 10 START FND_FLEX_WORKFLOW.UNIQUE_QUALIFIER_TO_SEGMENT 25 APPLICATION_ID = 101 26 CODE = GL# 27 NUM = 101 28 QUALIFIER = GL_BALANCING 29 SEGMENT NAME IS Company 30 START FND_FLEX_WORKFLOW_APIS.UNIQUE_QUALIFIER_TO_SEGMENT 47 APPLICATION_ID = 101 48 CODE = GL# 49 NUM = 101 50 QUALIFIER = FA_COST_CTR 51 SEGMENT NAME IS Department 52 START FND_FLEX_WORKFLOW_APIS.START_GENERATION 15 START FND_FLEX_WORKFLOW_APIS.COPY_SEGMENT_FROM_COMBINATION 38 APPLICATION SHORT NAME = SQLGL 39 APPLICATION ID = 101 40 CODE = GL# 41 NUM = 101 42 SEGMENT_IDENTIFIER = QUALIFIER 43 SEGMENT = FA_COST_CTR 44 CCID = 12831 45 REPLACE_CURRENT_VALUE = FALSE 46 START FND_FLEX_WORKFLOW_APIS.ASSIGN_TO_SEGMENT 53 .GENERATE 11 ITEMTYPE = FAFLEXWF 12 ITEMKEY = 35403 13 INSERT_IF_NEW = FALSE 14 START FND_FLEX_WORKFLOW_APIS.sql Test Script (Line Numbers added for readability) 1 START FND_FLEX_WORKFLOW.GET_SEGMENT_NUMBER 31 APPLICATION_ID = 101 32 CODE = GL# 33 NUM = 101 34 SEGMENT = Company 35 SEGMENT NUMBER IS 1 36 VALUE ASSIGNED : 01 37 START FND_FLEX_WORKFLOW_APIS.GET_SEGMENT_NUMBER 53 APPLICATION_ID = 101 54 CODE = GL# 55 NUM = 101 56 SEGMENT = Department 57 SEGMENT NUMBER IS 2 58 VALUE ASSIGNED : 000 59 START FND_FLEX_WORKFLOW_APIS.APPENDIX C – Successful Run of FAXAGTST.COPY_SEGMENT_FROM_COMBINATION 16 APPLICATION SHORT NAME = SQLGL 17 APPLICATION ID = 101 18 CODE = GL# 19 NUM = 101 20 SEGMENT_IDENTIFIER = QUALIFIER 21 SEGMENT = GL_BALANCING 22 CCID = 12831 23 REPLACE_CURRENT_VALUE = FALSE 24 START FND_FLEX_WORKFLOW_APIS.

UNIQUE_QUALIFIER_TO_SEGMENT APPLICATION_ID = 101 CODE = GL# NUM = 101 QUALIFIER = GL_ACCOUNT SEGMENT NAME IS Account START FND_FLEX_WORKFLOW_APIS.END_GENERATION PROCESS STATUS IS COMPLETE PROCESS RESULT IS SUCCESS CCID IS 13528 CONCATENATED SEGMENTS IS 01-000-1570-0000-000 CONCATENATED IDS IS 01-000-1570-0000-000 CONCATENATED DESCRIPTIONS IS Operations-Balance Sheet-Asset Clearing-No Sub Account-No Product NEW COMBINATION IS FALSE VALIDATION_STATUS IS VALID 54 .60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 APPLICATION ID = 101 CODE = GL# NUM = 101 SEGMENT_IDENTIFIER = QUALIFIER SEGMENT = GL_ACCOUNT VALUE = 1570 REPLACE_CURRENT_VALUE = FALSE START FND_FLEX_WORKFLOW_APIS.VALIDATE_COMBINATION APPLICATION SHORT NAME = SQLGL APPLICATION ID = 101 CODE = GL# NUM = 101 NSEGMENTS = 5 VALIDATION_TYPE = GENERATE_CCID DYNAMIC_INSERTS_ALLOWED = TRUE INSERT IF NEW COMBINATION = FALSE FND_FLEX_SEGMENT1 IS 01 FND_FLEX_SEGMENT2 IS 000 FND_FLEX_SEGMENT3 IS 1570 FND_FLEX_SEGMENT4 IS 0000 FND_FLEX_SEGMENT5 IS 000 CONCATENATED SEGMENTS TO BE VALIDATED IS 01-000-1570-0000-000 VALIDATION SUCCEEDED CCID IS 13528 START FND_FLEX_WORKFLOW_APIS.GET_SEGMENT_NUMBER APPLICATION_ID = 101 CODE = GL# NUM = 101 SEGMENT = Account SEGMENT NUMBER IS 3 VALUE ASSIGNED START FND_FLEX_WORKFLOW_APIS.COPY_FROM_COMBINATION APPLICATION SHORT NAME = SQLGL APPLICATION ID = 101 CODE = GL# NUM = 101 CCID = 12831 REPLACE_CURRENT_VALUE = FALSE VALUE ASSIGNED TO SEGMENT 4 IS 0000 VALUE ASSIGNED TO SEGMENT 5 IS 000 START FND_FLEX_WORKFLOW_APIS.

'CATEGORY'.1. account_source varchar2(60). 'asset_cost_acct'. 'reval_reserve_account_ccid'). insert into agt_accounts_temp values('ASSET_COST'.'asset_clearing_account_ccid'). null). 'wip_cost_account_ccid').'reval_amort_account_ccid'). 'BOOK'. 'cip_clearing_acct'. account_seg_cn varchar2(60).APPENDIX D – FAGDA_test. 'BOOK'. insert into agt_accounts_temp values('DEPRN_RSV'. insert into agt_accounts_temp values('REV_AMORT'. -. 'reserve_account_ccid'). 'deprn_expense_acct'. 'asset_cost_account_ccid'). insert into agt_accounts_temp values('REV_RSV'. 'CATEGORY'. 'BOOK'.Author: Ian Freeberg -----------------------------------------------------set echo off set define _ set define & set serveroutput on size 1000000 set trimspool on set trimout on set verify off set pagesize 0 set linesize 9999 set heading off set feedback off set timing off spool FAGDA_test. 'reval_amortization_acct'. 'ASSET'. 'reval_reserve_acct'. null).sql <Asset_id> "<book_type_code>" -. 'CATEGORY'. 'wip_clearing_account_ccid'). 'CATEGORY'.Prompt Inserting Rows<BR> -. 55 . null). insert into agt_accounts_temp values('COR_GAIN'.Prompt *************************<BR> -.@FAGDA_test. -.sql Test Script This script is on Metalink under NOTE:146661.Prompt Creating Temporary tables<BR> -. null). 'proceeds_of_sale_loss_acct'.sql 1234 "CORP" -. 'BOOK'.Prompt *************************<BR> -.Ex : @FAGDA_test.Prompt *************************<BR> begin -Account Type Source Type Column1 varchar2(25) Column2 number insert into agt_accounts_temp values('DEPRN_EXP'. insert into agt_accounts_temp values('CIP_CLEARING'. 'cip_cost_acct'. insert into agt_accounts_temp values('NBV_GAIN'. null). 'CATEGORY'.Prompt *************************<BR> create table agt_accounts_temp ( account_type varchar2(60). 'proceeds_of_sale_gain_acct'. 'cost_of_removal_gain_acct'. 'CATEGORY'. insert into agt_accounts_temp values('POS_LOSS'. 'asset_clearing_acct'. insert into agt_accounts_temp values('CIP_COST'. 'deprn_reserve_acct'. account_ccid_cn varchar2(60) ) pctfree 0 storage (initial 100K). insert into agt_accounts_temp values('ASSET_CLEARING'. 'CATEGORY'.html -. 'nbv_retired_gain_acct'. insert into agt_accounts_temp values('POS_GAIN'.

boolean. 'proceeds_of_sale_clearing_acct'. null). 'deferred_deprn_expense_acct'. varchar2(30) := user_book. null). varchar2(27). varchar2(2000). null). varchar2(30) := '&2'. varchar2(2000). 'reval_rsv_retired_gain_acct'. / set serveroutput on DECLARE user_asset_id user_book X_flex_account_type X_book_type_code X_flex_num X_dist_ccid X_acct_segval X_default_ccid X_account_ccid X_distribution_id X_return_ccid itemtype itemKey h_concat_segs h_concat_ids h_concat_descrs h_errmsg h_encoded_msg result h_return_ccid char_date 'cost_of_removal_loss_acct'. end. 'reval_rsv_retired_loss_acct'. 'BOOK'. null). insert into agt_accounts_temp values('NBV_LOSS'. 'BOOK'. distribution_id. varchar2(30). insert into agt_accounts_temp values('POS_CLEARING'. account_ccid_cn from agt_accounts_temp. varchar2(30). number. code_combination_id from fa_distribution_history where asset_id = user_asset_id and transaction_header_id_out is NULL. 'BOOK'. null). insert into agt_accounts_temp values('AR_INTERCO'. number. varchar2(2000). number. 'deferred_deprn_reserve_acct'. null). number := &1. number. number default null. insert into agt_accounts_temp values('COR_CLEARING'. insert into agt_accounts_temp values('DEPRN_ADJ'. varchar2(2000). 'cost_of_removal_clearing_acct'. 'ap_intercompany_acct'.insert into agt_accounts_temp values('COR_LOSS'. varchar2(30) := 'FAFLEXWF'. varchar2(2000). 'BOOK'. */ 56 . account_source. account_seg_cn. null). 'BOOK'. null). insert into agt_accounts_temp values('DEF_DEPRN_EXP'. 'BOOK'. varchar2(25). 'BOOK'. insert into agt_accounts_temp values('DEF_DEPRN_RSV'. 'BOOK'. 'BOOK'. /* finding distribution_ccid */ cursor dist_ccid_cursor is select asset_id. commit. 'deprn_adjustment_acct'. 'BOOK'. null). number. 'BOOK'. insert into agt_accounts_temp values('REV_RSV_LOSS'. insert into agt_accounts_temp values('AP_INTERCO'. insert into agt_accounts_temp values('REV_RSV_GAIN'. number. /* creating cursor for the 23 acct types cursor acct_type_cursor is select account_type. 'ar_intercompany_acct'. null). null). 'nbv_retired_loss_acct'.

wip_cost_account_ccid number. reval_amortization_acct varchar2(25). hold_debug varchar2(1). asset_clearing_acct varchar2(25). reval_amort_account_ccid number. asset_cost_account_ccid number. deferred_deprn_expense_acct varchar2(25). reval_reserve_acct varchar2(25). v_ErrorText varchar2(200). asset_clearing_account_ccid number.put_line('<html><head><title>Account Generator Test</title></head>'). v_dummy integer. cnh2_alais number. reserve_account_ccid number. deferred_deprn_reserve_acct varchar2(25).put_line('<body>'). err_status number := 0. book_type_code from fa_book_controls where book_type_code = user_book.put_line('<font color="Blue" size=+2>'). cip_clearing_acct varchar2(25). v_ErrorCode number. cip_cost_acct varchar2(25). account_segment_rec account_segment_type. cost_of_removal_loss_acct varchar2(25). dbms_output. dbms_output. nbv_retired_loss_acct varchar2(25)./* accounting_flex_structure */ cursor flex_num_cursor is select accounting_flex_structure from fa_book_controls where book_type_code = user_book. column_name_hold1 varchar2(30). proceeds_of_sale_loss_acct varchar2(25). cost_of_removal_clearing_acct varchar2(25). asset_cost_acct varchar2(25). column_name_hold2 varchar2(30). v_cursor_id number. error_position_end number. cursor_string varchar2(2000). reval_rsv_retired_gain_acct varchar2(25). ap_intercompany_acct varchar2(25). cost_of_removal_gain_acct varchar2(25). begin dbms_output. wip_clearing_account_ccid number. PRAGMA EXCEPTION_INIT(Too_Many_Distributed. 57 . /* default_ccid */ cursor default_ccid_cursor is select flexbuilder_defaults_ccid. error_position integer. deprn_reserve_acct varchar2(25). deprn_adjustment_acct varchar2(25). proceeds_of_sale_clearing_acct varchar2(25). reval_reserve_account_ccid number ). ar_intercompany_acct varchar2(25). Too_Many_Distributed EXCEPTION. reval_rsv_retired_loss_acct varchar2(25). deprn_expense_acct varchar2(25). cnh1_alais varchar2(25). -2042). nbv_retired_gain_acct varchar2(25). type account_segment_type is record ( proceeds_of_sale_gain_acct varchar2(25).

dbms_output.distribution_id). /* Parameter 2 Book_type_code */ dbms_output. /* Parameter 4 distribution_ccid */ X_dist_ccid := dist_ccid_rec.accounting_flex_structure.put_line('<tr><td>Flex_Structure:</td><td>' || X_flex_num || '</td></tr>'). if acct_type_rec. /* Parameter 3 Flex Structure */ for flex_num_rec in flex_num_cursor loop X_flex_num := flex_num_rec.PARSE(v_cursor_id.V7). dbms_output.asset_id). end loop. X_account_ccid := 0. 25).FETCH_ROWS(v_cursor_id) = 0 then exit. DBMS_SQL. cursor_string.put_line('</font><HR>'). 1.put_line('Asset_id: ' || dist_ccid_rec. dbms_output. dbms_output. /* Parameter 5 and 7 account_segment */ if acct_type_rec. v_dummy := DBMS_SQL.put_line('<tr><td>Account_type:</td><td>' || X_flex_account_type || '</td></tr>').put_line('<tr><td>Book_type_code:</td><td>' || X_book_type_code || '</td></tr>'). DBMS_SQL.account_seg_cn.put_line('<tr><td>Account_segment:</td><td>' || X_acct_segval || '</td></tr>').put_line('<tr><td>Account_ccid:</td><td>' || X_account_ccid || '</td></tr>').CLOSE_CURSOR(v_cursor_id).put_line('<BR>Book_type_code: ' || user_book ). /* Parameter 1 Account Type */ X_flex_account_type := acct_type_rec. dbms_output. X_acct_segval := cnh1_alais. end loop.put_line('<tr><td>Distribution_ccid:</td><td>' || X_dist_ccid || '</td></tr>'). 1. cursor_string := 'select ' || column_name_hold1 || ' cnh1_alais' || Chr(10) || 'from fa_book_controls' || Chr(10) || 'where book_type_code = '''|| user_book ||''''. DBMS_SQL.COLUMN_VALUE(v_cursor_id.account_seg_cn. dbms_output.account_type. end if. dbms_output. for dist_ccid_rec in dist_ccid_cursor loop dbms_output.EXECUTE(v_cursor_id).put_line('</font><HR>'). dbms_output. dbms_output. cnh1_alais).put_line('<BR>Distribution_id: ' || dist_ccid_rec.OPEN_CURSOR.account_source = 'CATEGORY' then column_name_hold1 := acct_type_rec.code_combination_id. end if.put_line('<font color="Purple" size=+2>'). loop if DBMS_SQL.put_line('Account Generator Test<BR>'). DBMS_SQL.DEFINE_COLUMN(v_cursor_id. dbms_output. 58 . v_cursor_id := DBMS_SQL. DBMS_SQL. for acct_type_rec in acct_type_cursor loop dbms_output.account_source = 'BOOK' then column_name_hold1 := acct_type_rec. cnh1_alais. dbms_output.put_line('<Table cellpadding="0" cellspacing="0" border=0>').

COLUMN_VALUE(v_cursor_id.' || Chr(10) || column_name_hold2 || ' cnh2_alais' || Chr(10) || 'from fa_category_books cb.DEFINE_COLUMN(v_cursor_id. DBMS_SQL. end if. dbms_output. cnh2_alais).account_source = 'ASSET' then column_name_hold1 := acct_type_rec. if acct_type_rec. cursor_string.put_line('<tr><td>Account_segment:</td><td>' || X_acct_segval || '</td></tr>').EXECUTE(v_cursor_id).FETCH_ROWS(v_cursor_id) = 0 then exit. DBMS_SQL.' || Chr(10) || 'fa_additions ad' || Chr(10) || 'where cb.account_seg_cn. 1. cnh1_alais). cnh1_alais.CLOSE_CURSOR(v_cursor_id). loop if DBMS_SQL. v_cursor_id := DBMS_SQL. cnh1_alais. DBMS_SQL. 1.column_name_hold2 := acct_type_rec. loop if DBMS_SQL. 2.category_id = ad. 25). cnh1_alais).OPEN_CURSOR. v_dummy := DBMS_SQL. 2. v_dummy := DBMS_SQL. DBMS_SQL.OPEN_CURSOR.V7).PARSE(v_cursor_id. cursor_string := 'select' || Chr(10) || column_name_hold1 || ' cnh1_alais. DBMS_SQL. 1.COLUMN_VALUE(v_cursor_id. DBMS_SQL.DEFINE_COLUMN(v_cursor_id. X_acct_segval := cnh1_alais. X_account_ccid := cnh2_alais.asset_id = ' || user_asset_id || Chr(10) || 'and cb.book_type_code = '''|| user_book ||''''. dbms_output. DBMS_SQL.account_ccid_cn. X_account_ccid := 0. dbms_output. cursor_string. end if.V7).asset_category_id' || Chr(10) || 'and ad. DBMS_SQL. v_cursor_id := DBMS_SQL. cursor_string := 'select ' || || Chr(10) || Chr(10) || Chr(10) || Chr(10) || Chr(10) column_name_hold1 || ' cnh1_alais' || 'from fa_category_books' || 'where book_type_code = '''|| user_book ||'''' || 'and category_id = (select asset_category_id' || 'from fa_additions' || 'where asset_id = '|| user_asset_id ||')'.EXECUTE(v_cursor_id). 25).COLUMN_VALUE(v_cursor_id.DEFINE_COLUMN(v_cursor_id.PARSE(v_cursor_id.put_line('<tr><td>Account_ccid:</td><td>' || cnh2_alais || '</td></tr>').put_line('<tr><td>Account_segment:</td><td>' || cnh1_alais || '</td></tr>'). DBMS_SQL. end if. 1. DBMS_SQL. DBMS_SQL.FETCH_ROWS(v_cursor_id) = 0 then exit. end loop.put_line('<tr><td>Account_ccid:</td><td>' || 59 . dbms_output. X_acct_segval := cnh1_alais. cnh2_alais).

wf_engine. itemkey => itemkey. itemkey => itemkey.put_line('<!-.SetItemAttrNumber(itemtype => itemtype. dbms_output. /* Initialize the workflow item attributes */ wf_engine.CLOSE_CURSOR(v_cursor_id). wf_engine. itemkey => itemkey.SetItemAttrNumber(itemtype => itemtype. aname => 'CHART_OF_ACCOUNTS_ID'. avalue => X_distribution_id). 60 . avalue => X_default_ccid).SetItemAttrText(itemtype => itemtype. wf_engine. avalue => X_dist_ccid ). itemkey := FND_FLEX_WORKFLOW. wf_engine. aname => 'DEFAULT_CCID'. 'GL#'.GENERATE('FAFLEXWF'. itemkey => itemkey. BEGIN fnd_flex_workflow.SetItemAttrText(itemtype => itemtype. end loop. end if.flexbuilder_defaults_ccid. avalue => X_account_ccid). aname => 'ACCOUNT_TYPE'. aname => 'ACCOUNT_CCID'.SetItemAttrNumber(itemtype => itemtype. wf_engine. 'FAFLEXWF' ). itemkey => itemkey. aname => 'DISTRIBUTION_ID'. avalue => X_flex_account_type). aname => 'DISTRIBUTION_CCID'. wf_engine.SetItemAttrNumber(itemtype => itemtype.SetItemAttrText(itemtype => itemtype. dbms_output. itemkey => itemkey. dbms_output.X_account_ccid || '</td></tr>'). wf_engine. X_flex_num. /* Parameter 6 Default_ccid */ for default_ccid_rec in default_ccid_cursor loop X_default_ccid := default_ccid_rec. DBMS_SQL. end loop. avalue => X_acct_segval).SetItemAttrNumber(itemtype => itemtype. result := FND_FLEX_WORKFLOW.put_line('<tr><td>Default_ccid:</td><td>' || X_default_ccid || '</td></tr>'). aname => 'ACCT_SEG_VAL'. itemkey => itemkey. avalue => X_flex_num). itemkey => itemkey.debug_on.INITIALIZE ('SQLGL'. aname => 'BOOK_TYPE_CODE'.put_line('</table><BR>').<font size=-2>'). avalue => X_book_type_code).

X_book_type_code. h_concat_segs).put_line('<br>Position: ' || error_position || ' of ' 61 . dbms_output. end if. dbms_output. h_encoded_msg := FND_MESSAGE. NAME=>h_encoded_msg). end if.itemkey. dbms_output. raise. dbms_output.put_line('Error : ' || h_errmsg || '<BR>'). X_dist_ccid.put_line('<BR><font color="red" size=+2>Failed to generate CCID</font><BR>'). if (h_return_ccid = -1) then select to_char(sysdate. h_concat_segs.put_line('Segments : ' || h_concat_segs || '<BR>'). dbms_output.GET_ENCODED.put_line('<BR><HR>'). dbms_output.put_line('CCID is :' || to_char(h_return_ccid) || '<BR>').get_ccid( 'SQLGL'.put_line('</font> -->'). dbms_output. if (h_return_ccid = 0 ) then err_status := 1.'StartProcess'. X_flex_num.put_line('Error : ' || h_errmsg || '<BR>'). FND_MESSAGE. dbms_output. -return. dbms_output. FA_SRVR_MSG.'FAFLEXWF').context('FA_FLEX_PKG'.'DD-MON-YYYY') into char_date from dual.SET_ENCODED(h_errmsg).ADD_MESSAGE(CALLING_FN=>'FAFLEX_PKG_WF. exception when others then wf_core.put_line('</body></html>'). end. dbms_output.X_default_ccid. 'GL#'. h_concat_ids. h_concat_descrs.START_PROCESS'.LAST_ERROR_POSITION. dbms_output. return.put_line('Segments : ' || h_concat_segs || '<BR>'). h_errmsg). exception when others then error_position := DBMS_SQL. dbms_output. IF (not result) THEN err_status := 1. end if. /* if h_return_ccid = -1 */ -- if err_status != 1 then dbms_output. char_date.put_line('<BR><font color="green" size=+2>Success</font><BR>'). end loop. h_return_ccid.put_line('<BR><font color="red" size=+2>Failed to generate CCID</font><BR>').put_line('<hr><font size=+2 color=red>Error: ORA' || SQLCODE || '</font>'). err_status := 0. h_return_ccid := FND_FLEX_EXT. END IF. end loop.

'<br>') || '<br>'). hold_debug := 'N'. commit.Prompt <BR>************************* -.Prompt <BR>*************************<BR> drop table agt_accounts_temp. chr(10).error_position+error_position_end+1).error_position).'<br>') || '</font>'). dbms_output. / -.error_position+1.Prompt <BR>Table Dropped -.Prompt <BR>Dropping Temporary tables -.put_line(replace(substr(cursor_string.error_position.CLOSE_CURSOR(v_cursor_id).'<br>')). -.Prompt <BR>*************************<BR> spool off 62 . dbms_output. end.|| length(cursor_string) || '<br>').Prompt <BR>************************* -.1.error_position+1) . error_position_end := instr(cursor_string. DBMS_SQL. error_position_end).put_line(replace(substr(cursor_string.' '.chr(10).chr(10).put_line('<font color=red>' || replace(substr(cursor_string. dbms_output.

Make sure that the user has write access to the directory from which the process is submitted. go to $FA_TOP/bin type in: FAGENID apps/apps 0 Y '&BOOK' and then press ENTER the process will generate a log file and a report in the same directory from which you submitted it --->$FA_TOP/bin. 63 .APPENDIX E – Submitting Generate Account from the Command Line To bypass the concurrent manager and submit the Generate Accounts from the command line.

Sign up to vote on this title
UsefulNot useful