Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Contents
Learning the Basics of Report Painter/Report Writer.............................................2 Creating a Report with Report Painter.....................................................................7 Understanding the Report List...............................................................................27 Getting the Most from Report Painter/Report Writer: Tips & Tricks...................27 Review......................................................................................................................40 Where to Learn More...............................................................................................40
In this chapter you will: Understand the difference between Report Painter and Report Writer Learn how to create a simple report with Report Painter Explore helpful hints and information on the Report/Report Interface, formula variables, and creating your own evaluation structures
Overview
Report Painter/Report Writer can be used to easily create currency- or quantitytype reports in the R/3 System. Examples of such reports include, financial statements, sales reports, and inventory reports. Earlier releases of the R/3 System were delivered only with Report Writer. Later, the user interface of Report Writer was enhanced and offered to users as Report Painter. As shown in the graphic below, Report Painter adds an easy-to-use graphical interface to the core functionality of Report Writer.
Report Writer
Report Painter
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
Key figures can also be used in rows and data selection In addition to the levels supported by Report Painter, you can also select intermediate levels
Copying reports between Report Painter and Report Writer If you want to build a report using features that are only available in Report Writer, then the report must be created in Report Writernot Report Painter. As shown in the graphic on the following page, Report Painter reports can only be changed or displayed using Report Painter. Later, if you want to change a Report Painter report using Report Writer, you must first copy it into a Report Writer report (with a different name) and then modify the copied report. When the report is copied, the necessary sets are automatically generated; you can define a 5-character prefix for the set name. Note: In Release 4.5 you no longer have to define a prefix since the system automatically attaches one to your automatically created sets. The systemcreated set is deleted when you delete the report. Reports written in Report Writer cannot be edited using Report Painter.
o e R
R e p o r t P a i n t e r
p y t o p o r t W e p o r t
a r it e r D o C R is p la y r h a n g e e p o r t
D o C R
is p la y r h a n g e e p o r t
R e p o r t W r i t e r
Both Report Painter and Report Writer can be used to report on the following tables and tables types: Evaluation structures set up in the Logistics Information System (LIS). These structures normally begin with an S or ZF. Several different tables and views within the R/3 System can be added as evaluation structures. Note: You cannot add cluster tables, such as BSEG. CCSS is used for Cost Center Accounting (CO-CCA), Internal Orders (COOPA), Activity Based Costing (CO-ABC) and for cost element reports in Project Systems (PS). GLFUNCT is used for functional area reporting in cost-of-sales accounting. GLPCT and GLPCOP are used for Profit Center Accounting (CO-PCA/EC-PCA). FILC is used for Legal Consolidations (FI-LC). COFIT is used for the Controlling Reconciliation Ledger (CO-CEL). ZZ tables are created for the Special Purpose Ledger (FI-SL). FIMC is used for consolidations in the Enterprise Controlling module (ECLC). GLT0 is used for Financial Accounting (General Ledger) reports by account, company, and business area (FI-GL). KKBC, KKBE, and KKBU are used for the Controlling Product Costing module (CO-Costing). New in Release 4.0A: RWCOOM is used for CO-CCA, CO-OPA and CO-ABC. RWCOOM is used for special standard reports like internal order budget reports, cost center budget reports and cost component reports. Note: RPPS was used for Project Systems (PS). However, it is obsolete and is no longer supported in Release 4.0. In Release 3.x there were only two special reports (6P70 and 6P71) using RPPS. These reports cannot be called directly,
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
Related Terminology
The following is a list of key terms you need to understand when working with Report Painter/Report Writer tools.
Report Definition
A report definition has three main components: Rows: The rows of a Report Painter report contain characteristics that determine how the rows will appear in the report. In the first report example on page 8, materials and material types drive the outcome of the rows, therefore only these characteristics are included in the rows of the report. Columns: The columns of a Report Painter report must have key figures. If needed, columns may also contain characteristics. In the second report example on page 19, plants are shown across the page, which means the plant characteristic is included in the columns as well as a key figure for net value of a billing document. General Data Selection: The general data selection area contains the additional characteristics that should control the data included in the report. In the second example on page 19, you may want to limit the selected data by material group or industry. Since these fields do not affect the outcome of the rows or columns, they are included in the general data selection as additional selection criteria. Any required fields that are not in the rows or columns are also included in the general data selection. In the first example on page 8, ledger, version, and record-type are all required but not included in the rows or columns. Therefore, these fields must be included in the general data selection in order for the report to run. Each table has certain required fields. To check your report for missing fields, choose the Check icon in Report maintenance.
Key Figures
Key figures are the currency or quantity buckets for a report. Some examples of key figures include the local currency amount in profit center accounting, the costs bucket in cost center accounting, the net value of a billing line item, and the quantity of materials sold in a sales order.
Characteristics
Characteristics are the fieldsother than currency or quantityneeded to build the report. For example, company code, plant, sales organization, G/L account, cost center, or period. In a balance sheet report, G/L accounts probably appear in the rows of your report. In a customer sales report, customers are likely to appear in the rows of the report.
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
characteristics and key figures are different. For example, in the Special Ledger the key figures are based on currency: transaction, local, and group. In Cost Center Accounting structure CCSS, the key figures are based on currency and the type of cost: cost, quantity, statistical quantity, and variances. Sets: You will need to build sets that include the values for the characteristics that are needed for your report. Although the values can be directly entered into the report, it is recommended that you use sets. Sets can be used in multiple reports because when values change, only the sets are changed and not each individual report. As an example, cost center hierarchies (groups) are sets and can be used directly (as with profit center groups). The same holds true for cost elements, activity types, statistical key figures, orders, and business processes (you do not have to create technical sets for these characteristics in order to use Report Painter). Library: You must create a library for the table or evaluation structure. Most tables supported by Report Painter/Report Writer have one or more libraries you can use. When creating evaluation structures in the Logistics Information System, the system creates a library beginning with a 2. Since the Special Ledger is not delivered with the libraries, you will need to create a library on each new special ledger table.
Deerm eth ta leyoune dfor yourrep et rmin he ab ee r port D te inet e t bleyoun edfor you re ort
Findor creaereq iredset for yourrep s d at qu d ts r port Fin or cre tere uire ses for you re orts
4Traindor createvariables le? thefields inyour report Fine or cre t va b sfor t efie s inyou re ort Fin dEm loye Avalebfor h ld d r p pa e e ria ila 5
Addyourrep toarep grou d r port o port roup Ad you re ort t are ort g p
In this section you learn how to create the following two reports with Report Painter: Profit Center Accounting report Billing report For these sample reports, you should focus on the tables that correspond to the SAP application areas you are working with. For example, if your expertise is PCA (Profit Center Accounting), you should work with table GLPCT. Take a few minutes to familiarize yourself with the scenario and the desired report. For more information, see page 3-4. The examples shown in this section were created in Release 4.0B.
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
The rows in this report list the G/L accounts and the columns contain the current as well as prior years (with the company code currency key figure).
Guided Tour
10
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
To help you better understand how to create a report in Report Painter, this step has been divided into the following substeps: Define the rows Define the columns Define the general data selection
Define Rows
1. When defining the rows of a report, notice the Lead column at the top of the rows. Report Painter refers to the rows of a report as the Lead column. You can type over this with your own description. 2. To start defining the rows, double-click on Row 1.
1 2
3. In Row 1: Choose Characteristics, select the desired characteristics. For this example, select Account number from the list of available characteristics. 2. Choose Enter to continue.
3. Enter the account number(s) you want to include in the row definition. Either enter to/from values or a group (set). See Tips&Tricks on page 3-12 for more information. 4. Choose Enter.
11
5. Enter a name for the row you are defining. In this example, Row 1 is defined as Revenue. 6. Choose Enter.
7
You have now defined the first row. Repeat steps 1-8 shown above to 8 add the second row titled Cost of Goods Sold (not shown here). For Row 2, use accounts 400000490000. 9. In the Report Painter: Create Report screen, double-click on Row 3. 10.Select Formula as the row element type. 11.Choose Enter. 12.Enter the formula for Row 3. You can either type it in or use your mouse and the formula components buttons. If you type the formula, do not forget the spaces. In this example, Y001 and Y002 represent Revenue and Cost of Goods Sold respectively. 13.Choose Enter. 14.In the popup screen (not shown here), enter the text Gross Margin. You have now defined the three rows (Revenue, Cost of Goods Sold, and Gross Margin) you will need for this report.
10 11
12
13
12
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
Creating a set Instead of separately defining each row, you can also create a set to save you time. The set you use in a report row is referred to as a row block and may consist of one or more physical rows. If you create a basic set containing account numbers as a row block, then the system automatically creates a physical row for each account number in the set. In this example, you could have skipped steps 5 through 14 simply by creating a basic set called Gross Margin in step 3. This set (row block) would include the account numbers for Revenue (800000) and Cost of Goods Sold (400000-490000). The system automatically generates a physical row for Revenue and Cost of Goods Sold without requiring you to define it from scratch. To do this, you must set the explode option to explode or single values. After that, one will automatically get one line for each account, not 2 lines for each single value (800000) and the interval. You will only get 2 lines if the standard layout parameter form print is setbut this is not the default setting. For more information on how to use sets, refer to the online documentation in the R/3 Library.
Define Columns
1. Double-click on the first column, Column 1. 2. In the Select Element Type window, select Key Figure with characteristics. 3. Choose Enter.
1
2 3
4. In the Key figures window, select Amount in company code currency. 5. Choose Enter.
13
6. In the Choose Characteristics window, select Fiscal Year as the desired characteristic for column 1. 7. Choose Enter.
6
If you want to be prompted for the fiscal year at the time of running the report, you must make this a variable instead of a value. 8. Place your cursor in the From 10 value field and choose Variable on/off. 9. Select from the list of available variables or enter a variable for Current year. 10.Choose Enter. 11.Enter the texts for the column header. 12.Choose Enter. Column 1 has now been defined for your report.
12 11 8
Since the following steps are similar to those shown above, they have not been pictured in this guided tour. 13.Define column 2 (Prior Year): You can define column 2 either by repeating steps 1 through 12, or by copying columns. For column 2, choose Prior year as the desired variable. 14.Define column 3 (Variance): Enter a formula that calculates the difference between column 1 (current year) and column 2 (prior year). The column text should read Variance. Adding a column or formula is similar to adding a row formula. Follow steps 10 through 13 shown in the section Define Rows. You have now defined the three columns (Current Year, Prior Year, and Variance) needed for your report.
14
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
Now that you have defined the rows and columns, you are ready to enter the general data selection. 1. From the menu on the Report Painter: Create Report screen, choose Edit General data selection Display/Change. 2. Select the fields to add to the general data selection. 3. Choose Enter. 4. Enter the values for each field. The standard ledger for PCA is 8A.The U.S. company code in IDES is 3000. 5. In the Profit center field, we want to include a set variable so that we can enter the profit centers or profit center group when executing the report. Place your cursor in the group field for the profit center. 6. Choose Variable on/off. 7. Enter the variable name 8A-PC-1 in the group field. 8. This is a year-to-date report, so all 12 periods are in the range. The standard Version in PCA is 000 and the Record type for actual dollars is 0. 9. Choose Enter. 10.Choose Edit General data selection Variation (not shown here) 11.To create multiple lists for the characteristics, select Explode. 12.Choose Enter.
12 9
4 4
5 7 8
11
15
Your report is now ready. 13.Choose Save to save the report. 14.To go to the display mode of the report, choose Report Display.
14
13
15.Make sure the correct Library and Report names have been selected. 16.Choose Continue.
16 15
17.Review the report display. 18.To execute the report, choose Report Execute.
18
17
You need to display the report before you execute it so that you can later change the report layout directly from the report list.
16
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
You are prompted to include the report in a report group. 19.Choose Yes.
19
20.Enter the name of a report group. It must be four characters long and start with a letter. 21.Choose Enter.
20 21
22.Enter the variables used to execute the report. We will execute the report for fiscal year 23 1998 and profit centers 3010 through N999. 23.Choose Execute.
22
17
Change Layout
1. After executing the report, add the headers and footers while you are still viewing the report. Since there is no automatic centering, text blocks are easier to work with at this point. From the report choose Settings Texts Headers (or Footers). 2. Enter the title of the report and any text such as Date:, Time:, and so on. 3. To add the variables for the report, place your cursor where the variable should start, then click the Standard variables button. Select the variable by double-clicking on it. The variable will be included in the header. 4. To include the profit centers in the report, enter Profit Center, then click your cursor where the profit center is to be inserted. 5. Choose Characteristics. Select the profit center characteristic, the text type is Value, and the value is Value/Group. 6. Choose Save to save the headers. Layout settings
6 2
To change the layout settings in the report, choose Settings Layout. There are six layout screens to choose various settings such as the number of decimal places, column width, text column width, and rounding. Review each screen and make the necessary changes. To prevent report users from making permanent layout changes, deselect the Change allowed during execution field in the Layout: Page/Control screen. You have now successfully created a report in Report Painter!
18
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
Note: Before you start with this example, you may want to review LIS Evaluation Structures discussed on page 27. It describes how to create a view that combines tables and creates an evaluation structure.
19
Guided Tour
1. From the SAP main menu, choose Information Systems Ad hoc reports Report painter Report Create. 2. In Library, enter the name of 4 the library (for example, 2AF) to be used for the report. 3. In Report, enter the report name and a description. 4. Choose Continue.
2 3
5. When defining the rows of the report, notice the Lead column at the top of the rows. Report Painter refers to the rows of a report as the lead column. You can type over this with your own description. 6. To start defining the rows, double-click on Row 1.
5 6
To insert a row between two existing rows, select the lower row and choose Insert.
20
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
8. Select the characteristics to include in the first row of the report. 9. Choose Enter.
8
10.Enter the values for the Material field and the Material type field. If you have built a set in advance, enter the set name in the group field. Note: You may use the asterisk 12 (*) to specify all values for material and material type. To specify the empty value/space/blank, you may use #. 11.To be prompted to enter the field value at the time of report execution, place your cursor in either the value field for a value variable (enter one value only) or in the group field for a set variable (enter one or more values). Then, choose Variable on/off. 12.Choose Enter. 13.Enter the row heading. Remember, this row totals all values entered in the section above for material number and material type. 14.Choose Enter.
13 11
10
14
21
15.To explode the row-detail and view the individual material numbers and material types, select the row. 16.Choose Explode. 17.Select Explode for Material type to view the individual values as well as the totals. Turn on Sing. Val option for Material to get all the individual material numbers. This selection for Material type will give you the subtotals you want. 18.To control the sort sequence of the fields in the row, review the number in the checkbox to the left of the field. Material should be sorted first and Material type second. 19.Choose Enter. You have defined the rows and are now ready to move onto the columns. 20.Double-click on Column 1.
15 17 19
16
18
20
22
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
21 22
24
25.Select Plant to include plant in the columns of the report. 26.Choose Enter.
25
26
27.In Plant, enter the plant(s) to be included in the first column of the report. 28.Choose Enter.
28
27
29.Enter the column header text for the column. 30.Choose Enter.
29
30
31.You can enter column 2 by repeating steps 22 through 30 (and enter plants 3100 and 3200), or you can copy columns.
23
32.To calculate the Total column, you must enter a formula. Double-click on the next available column and select 32 Formula. 33.Choose Enter. 34.Enter the formula to total the first three columns of the report. You may type in the formula or use the mouse to click on the formula components at the bottom of the screen. If typing in the formula, do not forget the spaces! 35.Choose Enter.
33 34
35
36.To enter the general data selection of the report, choose Edit Gen. data selection Display/Change. 37.Select the characteristics you 37 want to include. 38.Choose Enter.
38
24
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
39.Enter the values to be included in the report for Division and Industry sector. 40.To enter multiple ranges or multiple single values for one of the fields, place your cursor in the from or to fields. 42 Choose the More icon. 41.If a field should be a variable, place the cursor in the field and choose Variable on/off. 42.Choose Enter. 43.Save the report. 44.Go to the display mode of the report: Report Display. 45.Choose the Continue button on the display screen. 46.To execute the report, choose Report Execute. A window prompts you to include the report in a report group. Choose Yes. 47.Enter the name of the report group. 48.Choose Enter. A window prompts you to create the report group if it does not exist. Choose Yes to automatically create and generate the report group.
39
41
40
47 48
25
50.After executing the report, add the headers and footers while viewing the report. From the report, choose Settings Texts Headers (or Footers). 51 51.Enter the title of the report and any text such as Date:, Time:, Report:. To add variables for the report, place your cursor where the variable should start then choose Standard Variables. Select the variable by double clicking. The variable will appear in the header. All titles can also be entered as text type description. 52.Choose Save.
52
53.To change the layout settings in the report, choose Settings Layout. There are six layout screens containing various settings such as the number of decimal places, column width, text column width, and rounding. Make necessary changes and save your report. Your billing report is now ready.
26
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
Getting the Most from Report Painter/Report Writer: Tips & Tricks
LIS Evaluation Structures
A common misconception among users is that Report Painter/Report Writer only supports FI-CO applications. However, the Report Painter/Report Writer tool can also be used against user-defined evaluation structures created in LIS. These structures can be created on many of the tables in the R/3 System, allowing Report Painter/Report Writer to be used across most SAP applications. Adding your own evaluation structures Make sure you have checked all the standard tables and LIS structures and are certain that the report cannot be created using one of these standard options. The Report Painter/Report Writer tool works with system-generated code. Reading detailed line item tables without additional indexes to help with performance can cause performance problems! Most standard tables are summarized and contain a fraction of the data in the line item tables; these
27
tables should be used whenever possible. Below is an example of how to add an evaluation structure in LIS using a user-defined view.
Guided Tour
1. From the SAP main menu, choose Logistics Logistics controlling Logistics information system Flexible analyses Evaluation structure Create. 2. Select the application for which you are building the evaluation structure. Note that this is for reference purposes only. 3. Enter the name and description of the new evaluation structure. The structure must begin with a ZF. 4. Choose DD table ref to continue.
4 2 3
Using views In the next step, a view is used as the data dictionary reference table. Views should only be created when all other options have been exhausted. It is also recommended that you check with an experienced basis/tools consultant before creating the new view. To create a view in SAP, choose Tools ABAP Workbench Dictionary. Enter the name of the new view beginning with a 'Z'. Select the View option and Create. 5. Enter the data dictionary table from which you want to build the evaluation structure. This choice may be virtually any table or view in the data 6 dictionary with the exception of cluster tables and tables
28
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
without key figure fields. ZZ_BILL is a view that combines tables VBRP and MARA. 6. Choose Enter. In the next step, the system determines the classification of fields from the table or view as characteristics or key figures. This is not configurable. Most currency and quantity fields are considered key figures while the other field types are considered characteristics. 7. When you first enter this screen, the Characteristics and Key Figures columns will be empty. To select the characteristics from the data dictionary table or view to be used in the evaluation structure, choose Characteristics. Select the fields from the list and copy them into the evaluation structure definition. 8. To enter the key figures from the data dictionary table or view to be used in the evaluation structure, choose Key Figures. Select the key figures you want from the list and copy them into the evaluation structure definition. 9. Choose Back. A window prompts you to save and generate the evaluation structure. When the structure is generated, it also adds the structure to the Report Painter/Writer control tables and creates a library for reporting. The library name will begin with the number 2.
29
Report/Report Interface
Report Call or Report/Report Interface allows for drilldown functionality from a report group. Remember that a report group contains one or many reports and is executed using Report Painter/Report Writer. All reports within the report group have access to the Report/Report Interface setup in the report group. Report Calls may also be assigned to a library. This means all reports created for that library have access to the reports/transactions that are assigned to the Report/Report Interface. To set up the Report/Report Interface, follow these steps: 1. To maintain a report group: Information Systems Ad hoc reports Report painter Report Writer Report group Change. 2. To maintain a library: Information Systems Ad hoc reports Report painter Report Writer Library Change. 3. Enter the name of the report group or library that you would like to add report call capability to. Choose Header. 4. From the Header screen, choose the Report/Report Interface button. 5. If any reports or transactions have been assigned to the report group or library, they will show up in the Report assignments list. 6. To add additional reports or transactions, choose Insert. 7. To view the technical name of the report or transaction, choose Tech name on <-> off.
8. When inserting a new report, the system automatically assumes you wish to add a report of the same type. In the example, it assumes report group because we are adding reports to a report group. To add a different type of report, choose Other report type.
30
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
9. Double-click on the type of report you would like to add to the Report/Report Interface.
10.In the example below, we are adding a transaction code. Transaction code FB03 is an FI document display transaction. This addition means you will be able to drill down to display an FI document. Note that there must be an FI document number and company code available from the sender report for this drilldown to be successful! 11.Choose Enter. 12.Choose Save to save the new report assignment.
10 11
Report/Report Interface
This interface spans applications by automatically converting field names and values. Example: A Report Writer report for an FI-SL table can directly call a Report Painter report from the CO module (Table CCSS). The interface converts field
31
names (for example, G/L account RACCT to cost element KSTAR) and values (for example, get controlling area CCSS-KOKRS from company code GLT1BUKRS). When calling an ABAP program, the interface retrieves the selection parameters of the program and automatically fills these parameters from the selected data of the sender report. This way any program can be called without the need to adapt the program for the report/report interfaceprovided, of course, that all relevant selection fields are part of the selection parameters of the program. As an example, consider the new line items RGUGLS12 and RGUGLS11. These programs have all the necessary fields as selection parameters. There is no specific coding for the report/report interface. If you need to actively read the interface data, there are a number of function modules available in function group RSTI. The online documentation of function group RSTI gives detailed information on how the report/report interface works and what function modules are available.
32
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
calculates the period and fiscal year of the preceding period. The year will change when going back from period 1. Column
Column 12 Column 11
Period Variable
&0R-RP00 &0R-RP01
Formula
'#S002' IF '0R-RP00' > 1 THEN '0R-RP00' - 1 ELSE 12 IF '0R-RP01' > 1 THEN '0R-RP01' - 1 ELSE 12 IF '0R-RP02' > 1 THEN '0R-RP02' - 1 ELSE 12 IF '0R-RP03' > 1 THEN '0R-RP03' - 1 ELSE 12 IF '0R-RP04' > 1 THEN '0R-RP04' - 1 ELSE 12 IF '0R-RP05' > 1 THEN '0R-RP05' - 1 ELSE 12 IF '0R-RP06' > 1 THEN '0R-RP06' - 1 ELSE 12 IF '0R-RP07' > 1 THEN '0R-RP07' - 1 ELSE 12 IF '0R-RP08' > 1 THEN '0R-RP08' - 1 ELSE 12 IF '0R-RP09' > 1 THEN '0R-RP09' - 1 ELSE 12 IF '0R-RP10' > 1 THEN '0R-RP10' - 1 ELSE 12
Year Variable
&0R-RY00 &0R-RY01
Formula
'#S001' IF '0R-RP01' < '0R-RP00' THEN '0R-RY00' ELSE '0RRY00' - 1 IF '0R-RP02' < '0R-RP01' THEN '0R-RY01' ELSE '0RRY01' - 1 IF '0R-RP03' < '0R-RP02' THEN '0R-RY02' ELSE '0RRY02' - 1 IF '0R-RP04' < '0R-RP03' THEN '0R-RY03' ELSE '0RRY03' - 1 IF '0R-RP05' < '0R-RP04' THEN '0R-RY04' ELSE '0RRY04' - 1 IF '0R-RP06' < '0R-RP05' THEN '0R-RY05' ELSE '0RRY05' - 1 IF '0R-RP07' < '0R-RP06' THEN '0R-RY06' ELSE '0RRY06' - 1 IF '0R-RP08' < '0R-RP07' THEN '0R-RY07' ELSE '0RRY07' - 1 IF '0R-RP09' < '0R-RP08' THEN '0R-RY08' ELSE '0RRY08' - 1 IF '0R-RP10' < '0R-RP09' THEN '0R-RY09' ELSE '0RRY09' - 1 IF '0R-RP11' < '0R-RP10' THEN '0R-RY10' ELSE '0RRY10' - 1
Column 10
&0R-RP02
&0R-RY02
Column 9
&0R-RP03
&0R-RY03
Column 8
&0R-RP04
&0R-RY04
Column 7
&0R-RP05
&0R-RY05
Column 6
&0R-RP06
&0R-RY06
Column 5
&0R-RP07
&0R-RY07
Column 4
&0R-RP08
&0R-RY08
Column 3
&0R-RP09
&0R-RY09
Column 2
&0R-RP10
&0R-RY10
Column 1
&0R-RP11
&0R-RY11
If you only need one column with the total for all periods, create an additional formula column that adds up all period columns. Hide the period columns (In Report Writer, you must set the column width to zero).
33
Create a value variable &QUARTER for the period and call it Quarter. This will be the independent variable. Create three formula variables for the three periods of the quarter. Column
Column 1 Column 2 Column 3
Period Variable
&QPER1 &QPER2 &QPER3
Formula
'QUARTER' * 3 - 2 'QUARTER' * 3 - 1 'QUARTER' * 3
This example assumes that the first quarter consists of periods 1, 2, and 3, etc. You can use the formula variables &QPER1, &QPER2, and &QPER3 in data-set entries or directly in the column definition (Report Painter). The independent variable &QUARTER is not used directly in the report, only indirectly through the formula variables. When running the report, only the independent variable &QUARTER leads to the input field Quarter on the selection screen. The user is expected to enter quarter 1, 2, 3, or 4.
Period Variable
&QPER1 &QPER2 &QPER3
Formula
(('PERIOD'-1) DIV 3)*3 + 1 (('PERIOD'-1) DIV 3)*3 + 2 (('PERIOD'-1) DIV 3)*3 + 3
Again, this assumes that the first quarter consists of periods 1, 2, and 3, etc. The DIV operator in the formula denotes division without a remainder (for example, 8 DIV 3 = 2).
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
Column
Column 1 Column 2 Column 3 Column 4 Column 5 Column 6 Column 7 Column 8 Column 9 Column 10 Column 11 Column 12
Period Variable
&PER01 &PER02 &PER03 &PER04 &PER05 &PER06 &PER07 &PER08 &PER09 &PER10 &PER11 &PER12
Formula
IF 1 < '&PER_FROM' OR 1 > '&PERI_TO' THEN 16 ELSE 1 IF 2 < '&PER_FROM' OR 2 > '&PERI_TO' THEN 16 ELSE 2 IF 3 < '&PER_FROM' OR 3 > '&PERI_TO' THEN 16 ELSE 3 IF 4 < '&PER_FROM' OR 4 > '&PERI_TO' THEN 16 ELSE 4 IF 5 < '&PER_FROM' OR 5 > '&PERI_TO' THEN 16 ELSE 5 IF 6 < '&PER_FROM' OR 6 > '&PERI_TO' THEN 16 ELSE 6 IF 7 < '&PER_FROM' OR 7 > '&PERI_TO' THEN 16 ELSE 7 IF 8 < '&PER_FROM' OR 8 > '&PERI_TO' THEN 16 ELSE 8 IF 9 < '&PER_FROM' OR 9 > '&PERI_TO' THEN 16 ELSE 9 IF 10 < '&PER_FROM' OR 10 > '&PERI_TO' THEN 16 ELSE 10 IF 11 < '&PER_FROM' OR 11 > '&PERI_TO' THEN 16 ELSE 11 IF 12 < '&PER_FROM' OR 12 > '&PERI_TO' THEN 16 ELSE 12
Create a basic set for period and enter the 12 formula variables (or enter in the column definition in Report Painter). In the report layout, select the parameter Suppress zero columns. If the from-period is always 1, the formulas simplify to IF p > '&PERI_TO' THEN 16 ELSE p p stands for the period (values 1 to 12). If you only need four columns for quarters 1 to 4, create four additional columns with formulas that add up the necessary columns for each quarter, and also suppress the individual period columns by assigning a column width of zero.
35
Description
Calendar year from system date Calendar month from system date Shifted fiscal year from system date Period from system date
Formula
'#S001' '#S002' IF '#S002' > 9 THEN '#S001' + 1 ELSE '#S001' IF '#S002' > 9 THEN '#S002' - 9 ELSE '#S002' +3
You can define formula variables so that the user enters calendar year and period and these values are internally converted to the fiscal year and period. You need the following formula variables (the example assumes that fiscal year 1999 starts in October 1998): Description
Calendar year from system date Calendar month from system date Shifted fiscal year Fiscal period
Variable
&CYEAR &CPER &FYEAR &FPER
Formula
'#S001' '#S002' IF '&CPER ' > 9 THEN '&CYEAR' + 1 ELSE '&CYEAR' IF '&CPER' > 9 THEN '&CPER' - 9 ELSE '&CPER' + 3
The report can now be defined using the variables &FYEAR and &FPER (fiscal year and period). When running the report, the selection screen has input fields only for the independent variables &CYEAR and &CPER (calendar year and period) with defaults taken from the system date. Upon execution, the calendar values are converted to the fiscal values.
36
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
(Release 3.0C and greater) (overtype RGSVU000 with name of your formpool). OSS note 22878 gives detailed instructions how such an exit can reference the value of other value variables. Also see OSS note 21084 for general instructions.
processing. By grouping them, the system only reads the data from the table once and then produces each report. If the reports were all in individual report groups, the system would read the data once for each report group and then produce the report. Exception: If all the reports are very large they may need to be broken up into smaller groups. Timeout errors may occur if you are executing too many large reports online in a single report group.
38
Chapter 3: Report Painter/Report Writer Getting the Most from Report Painter/Report Writer: Tips & Tricks
Use Variation
Variation is useful in a Report Painter/Writer report. Variation can be performed on any field in the general data selection of a report. This functionality allows an individual report to be created for each level and single value of any field in the general data selection area. If the report contains multiple cost centers and you would like to see an individual report for each cost center as well as the total, variation accomplishes this for you. To use variation for a Report Painter report definition, choose Edit General Data Selection Variation. Note: Variation can be used in combination with the creation of an extract. As of Release 4.0A, the system finds extracts by checking the selection criteria the user filled in on the selection screen. The crucial point is: if there is an extract created with variation, the system will find the extract even if the user specifies any of the nodes or single values that have been part of the varied hierarchy. If the user chooses to display the extract, the user will be directly guided to the users node or value. Before Release 4.0, extracts with variation could only be entered at the top node. Thus, the best scenario is to create an extract with variation for the complete hierarchy by starting a batch job at night. The next day each end user will be able to get their report from the extract just by filling out the selection screen according to their responsibilities (e.g. month-end-reporting scenario).
39
Naming Conventions
All customer-defined reporting elements within Report Painter/Writer should begin with an alpha character. Numerical prefixes are reserved for SAP-delivered elements, including libraries, sets, variables, reports, and report groups.
Review
Report Painter/Report Writer is a user-friendly tool for currency and quantity type reports from the R/3 System. You can use Report Painter/Report Writer with various tables, both standard and user-defined. Because of this flexibility, several applications can benefit from the tool. Reports can be printed, downloaded, used with graphics, saved as extracts, mailed via SAP mail, faxed, or simply viewed on the screen. The following steps are necessary to create a report with the Report Painter/Writer tool: 1. Determine the table needed for the report. 2. Find the library for that table, or create one if necessary. 3. Find or create required sets and variables that may be needed for the characteristics in the report. 4. Create the report, including the row and column definitions and general data selection. 5. Add the report to a report group for execution. While viewing the executed report, add texts (headers and footers) and adjust the layout settings. Additionally, the drilldown function can also be used to access reports throughout R/3. Similarly, you can create evaluation structures which let you view data in LIS information structures.
40