Tips Tricks Reports
Tips Tricks Reports
Tips Tricks Reports
By Jeannie Dobney ASSIST Pty Ltd This paper attempts to list some of the things that I wish I had known when I started using Reports 2.5 in the Oracle Financials environment It was in response to perceived lack of information in this area amongst the user community. The author has attempted to collate wisdom gleaned from many sources. For much of the information in this paper I have to thank colleagues as well as friends I have yet to meet but feel I know through the OAUG email forum. This paper focuses on the use of Oracle Reports 2.5 and all references to Reports imply Oracle Reports 2.5. Much of what is said here is equally applicable to Reports 2.0 The substantial differences between Reports 2.0 and 2.5 are: Reports 2.5 uses a hierarchical navigator which makes identifying objects and viewing their properties easier than it was in Reports 2.0 Reports 2.5 includes a Confine Mode toggle which makes working with report layers much easier in version 2.5. These layers are not very well documented and are a major trap for new users of version 2.0 (where Confine Mode doesnt exist).
This paper also assumes users are running version 10.7 SC, however much of what is included is applicable for NCA and Release 11.0 (not 11i).
$FND_TOP
$GL_TOP
$[custom]_TOP
$INV_TOP
bin
sql
log
srw
mesg
lib
rpt
forms
out
plsql
[lang]
3. 4.
Ensure your report has the appropriate file permissions which allow the Oracle concurrent manager to execute it (using chmod etc). Register Your Report within Oracle Applications. This is frequently overlooked and is an essential step. Registration tells Oracle Financials that your report exists and where it can be found. There are several steps and these are outlined in the following section. 4.1 Identify the report to the AOL layer. Using the Application Developer Responsibility, Menu Path: Concurrent ~ Executable
The Execution File Name is the operating system file name (without the extension) and you must type this accurately including the correct case! The Application field tells the AOL layer where to look for this file. Applications are also registered which links the descriptive name seen here to an OS environment variable which in turn identifies the specific OS path to use to find your report. It is therefore important that when you place your report in a mod directory, you also select the appropriate application name here. Otherwise Oracle will not be able to find your report. ASSIST Pty Ltd 1999 Page 2
4.2 Define Concurrent Manager Submission Information Using the Application Developer Responsibility, Menu Path: Concurrent ~ Program
This step sets up the report so it can be submitted by the concurrent manager, identifying parameters which must be passed etc. The Executable Name field is the link to the previous step. The Program name field and Description will appear in the List of Values users see, so they should be functionally descriptive. Use the Parameters button to open the window shown below and define the parameters that the report should prompt the user for.
Notice that the Token field links the parameters you list here to the parameters which your report is expecting. It is not case sensitive.
If your report should not be run at the same time as any other report or process (perhaps even itself) the use the Incompatibilities button to open the window shown below and identify them.
Further information about specific fields shown here and the registration process can be found in Oracle Applications System Administration Reference Manual.
In the top half of the screen above, query back the Request Group to which you wish to add your report and then in the lower half of the screen create a new record, select your report name and save.
Tip Four: Dont Use Reports Features which the Financials Environment wont Support!
Basically try and keep your report as simple as possible. Its nice to be able to use bitmapped logos but remember that with every piece of complexity you add, you are increasing your debugging effort For example, it is now possible to add a list of values to a Reports 2.5 report parameter and whilst this seems like a good idea, it simply replicates the functionality available within Oracle Applications. Notice that in the parameter registration screen shown earlier in this paper the parameter displayed is using a SQL statement. This SQL populates the List of Values which the user sees within Standard Report Submission. For more information on Standard Report Submission parameter options, see the Flexfields manual (yes really: because Financials views the parameters as descriptive flexfield segments!)
When you attempt to run your report in Financials you may still get strange messages about Object F_Problem_object has zero length or width OR M-Headers is not fully enclosed by object BODY. Basically this is because Reports has done some rounding so that all objects fit on the grid and it has rounded half cell objects down to zero or rounded them up and off the page.
You can get around this by rearranging things in the Layout Editor of the Reports Designer and recompiling, but the quick fix is to register the concurrent program to run in bitmapped mode by entering VERSION=2.0b in the Executions Options field of the Concurrent Programs screen shown earlier in this paper. Note that this option must be written exactly as shown. Version=2.0b will not do! Setting this options means that a different executable ar25runb runs the report. Note that if you try to run an unmodified character mode report using VERSION=2.0b you are likely to get a Report contains uncompiled PL/SQL error. This can be solved easily by opening the report in the Reports Designer and recompiling it. The first time you open a character mode report in Reports Designer, a message box may pop up to warn you that it is being opened as a bitmapped report and that the page size and other things may have changed perhaps as a consequence of font-mapping. Ignore this. Having set up your modified report to run with VERSION=2.0b, typically you will now encounter a Formatter Error. The source of this error lies with the file UIPRINT.TXT which needs to be set up to use the appropriate .ppd file. This is best referred to the person in your organisation who understands most about printer configuration within Oracle Financials. (Some more details about this are included at the end of this section.) At this stage you should be able to get the concurrent request to complete normally but if you try to print it, all you get is gobbledegook which is Postscript output as text, pages and pages of it! Sometimes you will get just two or three lines with increasing indents, followed by many blank pages. This has to do with the initialisation string in the printer definition. In order to get the bitmapped report to print properly a bitmapped printer must be set up in AOL. Until then, you can still print the report properly using the lp command from the Unix command line. You can also use Ghostview (available free from http://www.cs.wisc.edu/~ghost/) to view postscript files on the screen. I have not tried this but if you set up your (GUI only) AOL to use Ghostview to open postscript reports, it ought to be possible to view the output in the Help-View my requests-Report screen. Using Word or Excel all you see is the text of the postscript commands. Note re Formatter Error: Once you select VERSION=2.0b you are instructing Oracle to use a bitmapped (postscript) printer. Im not sure if anyone really fully understands what happens next, but I include here what I have gleaned in the hope that it may be of some use to some of you! .prt files are only used with character mode reporting. they play no part at all in bitmapped reporting. .ppd files are supplied by the printer vendor (usually), and are used to describe the capabilities of a particular postscript printer to postscript applications The concurrent manager allows reports to be reprinted, but a report produced through ar20runb can only be reprinted to the printer type it was produced for. In the Unix world the file $ORACLE_HOME/guicommon/tk2/admin/uiprint.txt documents how printers are mapped to PPD files. The name of the printer has a PPD file associated with it in uiprint.txt. Formatter Error is caused by an incorrect setup of the D2K runtime on your DB / APPS server. You must add a line referencing your default printer as found in the associated environment variables. All necessary instructions are found in the header of uiprint.txt. TK2_PRINTER, ORACLE_PRINTER, and PRINTER are environment variables that are looked at (in order, I believe) to determine which printer should be used by default. The specified printer does not have to be in uiprint.txt. The DESNAME parameter determines which .ppd file used: 1) If DESNAME is set use that to look up the appropriate ppd file from uiprint.txt The PPD files are in $ORACLE_HOME/guicommon/tk2/admin/PPD 2) If DESNAME isn't set, but an environment variable $PRINTER is set, then the value in here is used to look up in the .ppd file. 3) If neither of these are used then the first entry in the uiprint.txt file is used. There seem to be some problems specific to Postscript capable HP printers. Oracle Print Drivers always default to PCL setup strings for HP printers. HP printers see the PCL string, and assume the entire job is ASSIST Pty Ltd 1999 Page 6
PCL. However, bitmapped reports are PostScript. Therefore, the HP printer dumps the PostScript commands as text. To solve this create a custom print driver which has no setup strings. Then the printer will see PostScript first, and will select that language and print it properly.
Tip Six: When All Else Fails Resort to Emp & Dept!
It might seem too obvious to state, but Financials reports can often be very complex. This complexity is often the reason that debugging them or solving problems with them is so hard. As with most things, however, there is usually some kind of solution / work-around if you are willing to invest enough energy in it! To simplify the problem solving process, try replicating the problem using a simpler scenario. Often the Emp and Dept tables will help you to figure out the principle you need to use.
FND FORMAT_CURRENCY This user exit formats the currency amount dynamically depending upon the precision of the actual currency value, the standard precision, whether the value is in a mixed currency region, the user's positive and negative format profile options, and the location (country) of the site. The location of the site determines the thousands separator and radix to use when displaying currency values. An additional profile determines whether the thousands separator is displayed. It is especially useful because it allows Oracle to display a list of amounts paid in various currencies using their correct formatting. It also picks up the users formatting preferences from their profile value settings. It can however be an annoyance if you have been asked to add a sub-total as you cannot add a column of characters! Oracle recommend defining two columns, one which you apply this user exit to for display and a second column containing the raw data which you do not display but which you use for calculations. Syntax FND FORMAT_CURRENCY CODE=":column containing currency code" DISPLAY_WIDTH="field width for display" AMOUNT=":source column name" DISPLAY=":display column name" [MINIMUM_PRECISION=":P_MIN_PRECISION"] [PRECISION="{STANDARD|EXTENDED}"] [DISPLAY_SCALING_FACTOR="":P_SCALING_FACTOR"] Arguments (for Format_Currency): CODE Specify the column which contains the currency code for the amount. The type of this column is CHARACTER. You will probably need to precede the call to this user exits with a call like SRW.REFERENCE(:C_COLUMN); Which allows you to accurately pass a column value here as a parameter. Specify the width of the field in which you display the formatted amount. Specify the name of the column which contains the amount retrieved from the database. This amount is of type NUMBER. Specify the name of the column into which you want to display the formatted values. The type of this column is CHARACTER. Specify the precision to which to align all currencies used in this report region. You specify the MINIMUM_PRECISION token in mixed currency report regions to ensure all currency values align at the radix character for easy readability. Your user can adjust the report by setting an input parameter when submitting the report to specifically tailor the report output to a desired minimum precision or accept the default which is determined from the profile option Your report submission must pass the value as a report argument. You use P_MIN_PRECISION as the name of this lexical. If specified as STANDARD, then standard precision is used. If the value is EXTENDED then the extended precision of the currency is used to format the number. Optionally, specify the scaling factor to be applied to the amount in that column. If this token is not specified or is negative no scaling is performed. You use P_SCALING_FACTOR as the name of this lexical parameter.
DISPLAY
MINIMUM_ PRECISION
Note: Colon ":" is placed in front of column names and lexical parameters for token values. This indicates that the value of that token is retrieved from the column or lexical parameter. If it is omitted the value within double quotes itself is used. For example, CODE=":C_CODE" indicates that currency code should be retrieved from column CODE while CODE="C_CODE" indicated that currency code is C_CODE. Here is an example: You are creating a column (C_NET_INCOME) which contains the user exit (FND FORMAT_CURRENCY) call. This is a formula column which formats the number and displays it. The user exit call is: SRW.REFERENCE(:C_CURRENCY); SRW.REFERENCE(:C_INCOME); SRW.USER_EXIT('FND FORMAT_CURRENCY CODE=":C_CURRENCY" DISPLAY_WIDTH="15" AMOUNT=":C_INCOME" DISPLAY=":C_NET_INCOME" MINIMUM_PRECISION=":P_MIN_PRECISION"'); RETURN(:C_NET_INCOME);
Note that one impact of the embedded user exits is that you will be unable to run your report from the client side Reports Designer because of them. You can get around this by commenting them out but you must remember to remove the comments before FTPing back to the server!
You always create this lexical parameter. "FND SRWINIT" uses this parameter to retrieve information about this concurrent request. You should have the following parameter: Name: Data Type: Width: Initial Value: P_MIN_PRECISION NUMBER 2
You reference this lexical parameter in your FND FORMAT_CURRENCY user exit call.
Please note the writer has not used this and cannot vouch for its effectiveness!
The lexical reference &P_TABLE1 refers to the user parameter P_TABLE1. Opening up the property sheet for P_TABLE1 shows that this parameter has the initial value of the RA_CUSTOMERS table. This does not help us much. What are the table aliases T, A, U and B? The answer to this puzzle is as follows.
The Before Report trigger of RAXINV.rdf calls a procedure arp_trx_select_control.build_where_clause to set the values of parameters such as :p_table1. The following information was obtained using SQL Plus to execute the statement: SELECT text FROM all_source WHERE object_name like 'ARP_TRX_SELECT_CONTROL%' / an extract of this follows... /*- | Define Tables and aliases |*/
table1 := ' AR_ADJUSTMENTS COM_ADJ, ' || cr || TEXT -------------------------------------------------------------------------------' AR_PAYMENT_SCHEDULES P, ' || cr || ' RA_CUST_TRX_LINE_GL_DIST REC, ' || cr || ' RA_CUSTOMER_TRX A, ' || cr || ' RA_CUSTOMERS B, ' || cr || ' RA_TERMS T, ' || cr || ' RA_TERMS_LINES TL, ' || cr || ' RA_CUST_TRX_TYPES TYPES, ' || cr || ' AR_LOOKUPS L_TYPES, ' || cr || ' RA_ADDRESSES A_BILL, ' || cr || ' RA_SITE_USES U_BILL ' || cr; So now we can see that T refers to RA_TERMS, U_BILL refers to RA_SITE_USES, and so on.
Less obvious errors you will have to deal with on a case by case basis with the help of Oracle Support to solve your problems because your operating system is doing exactly what its supposed to do to try and reduce the chances of crashing the system. Solutions may include relinking the executable or working with Support to tweak the report so that it doesn't cause the report to access UNIX memory in an incorrect manner. If the report gives no data, then do the following: Check for SRW.USER_EXIT(FND SRWINIT) in Before Report trigger Check for SRW.USER_EXIT(FND SRWEXIT) in After Report trigger Check for P_CONC_REQUEST_ID parameter in user parameters
with the standard Oracle Reports arguments, run the report with the arguments passed by the concurrent manager. The arguments passed by the concurrent manager can be found in the beginning of the concurrent request log under the title "Arguments". For example, the menu report can be run from the operating system as follows: ar20run userid=name/password@database \ destype=file desname=try.out \ desformat=$FND_TOP/srw/L batch=yes \ report=$FND_TOP/srw/FNDMNRMT ROOT_MENU="Y" \ MENU_APPL_ID="0" MENU_ID="0" Here, the last three arguments (ROOT_MENU="Y" MENU_APPL_ID="0" MENU_ID="0") appeared in a concurrent request log. If you can run the report from the command line, that indicates that there is a problem in the environment from which the concurrent manager was started. Ensure that you start the concurrent managers from the same environment you are trying to run the report. Use r20run In Place of ar20run If you cannot run ar20run as above, run a report without any Oracle Applications user exists using r20run. For this debugging step Application Object Library provides a report $FND_TOP/srw/FNDNOEXT.rdf (the UNIX path name) which has no user exits. If this report fails, you may be running Oracle Reports from the wrong environment or your Oracle Reports installation may be incorrect. Contact Oracle Tools Support if FNDNOEXT.rdf cannot run. Run the Print Environment Variable Values Report The concurrent manager inherits its environment variables from the shell from which it was started and then runs reports using this environment. This environment could be different from that a a user sees logging into the Applications because the concurrent manager may have been started by a different user with different environment settings. Due to this difference, it is sometimes difficult and confusing to determine the cause of errors in running reports. If you want to examine the value of few variables, you can run "Prints environment variable values" report to print out the variable as seen by the concurrent manager to see if it is correct. Very often problems such as a problem in compilation or the concurrent managers inability to locate a library happen due to an incorrect REP_PATH. Emulate Concurrent Manager Environment For UNIX platforms, to assist in determining where the problem lies, Oracle Application Object Library ships a program called $FND_TOP/srw/ar20run.oc. This program helps you emulate the concurrent manager environment when testing reports from the operating system command line. This program writes all the environment variables and arguments passed to it in a log file ar20run.log. Save the ar20run.oc source code to a file named ar20run.oc, compile it and rename the executable as ar20run (referred to as "new ar20run" from now on). Save $FND_TOP/bin/ar20run (referred to as "old ar20run" from now on) into some other file and place new ar20run into $FND_TOP/bin. For your convenience, compiling and relinking has been incorporated into fnd.mk which will, by default build an executable $FND_TOP/bin/ar20run.dbg which you can then rename to ar20run which would be your new ar20run. In the ar20run.oc code, you may hardcode the directory path for ar20run.log (for example, change ar20run.log to "/dev/fnd/6.0/log/ar20run.log") to direct the log file to a more appropriate directory. Submit the report from concurrent manager and look at the ar20run.log. Then run the reports from the operating system with the same arguments as shown by ar20run.log using old ar20run. If running with the same arguments does not help, emulate the same environment variables which ar20run.log shows. This can be done by printing your environment variables from the command line, sorting them and the ar20run.log environment variables properly, and then comparing them.
About the Author Jeannie Dobney is Training Manager for Accounting System Software Implementation and Support Team (ASSIST Pty Ltd) which is based in Canberra and specialises in Oracle Financials. She was previously Education Centre Manager for Oracle Canberra. Jeannie holds a B.A. Computing, M.B.A. and Oracle Masters Certificates in Developer 2000.