
Process Example: Creating a Report Writer Report
Purpose
The following example shows you how to construct the cost center report 1 SIP-001 (described in the
Example process: Creating a Report Painter Report section) using the
Report Writers. You will learn how to create new reports using existing Report Writer sets and variables. To create a cost center report, access Cost Center Accounting and choose:
Information system
® Tools ® Report Painter ® Report Writer ® Report ® CreatePrerequisites
You first define your report requirements.
The cost center report should provide the following information:
Before you define the report, you must decide:

A characteristic can only be used once in a report, in report rows, report columns, or data selection criteria. You decide the most appropriate location for the characteristic.
The following characteristics are required for the example cost center report.
General data selection characteristics |
|
KOKRS |
Controlling Area |
KOSTL |
Cost center group |
GJAHR |
Fiscal Year |
PERBL |
Periods |
The characteristics "Fiscal year and "Period" can remain general data selection criteria, since every column of the report will contain values from the same time period. If you want the report columns to represent different reporting periods, however, you must place these characteristics in the appropriate columns.
Report row characteristics |
|
KSTAR |
Cost element |
BELKZ |
CO debit/credit indicator |
Report column characteristics |
|
WRTTP |
Value type (actual, plan) |
VERSN |
Version (actual version is always 0) |
Key figures in the report columns |
|
SWKG |
Costs |

The next step when defining the report is to check whether you can use existing sets for rows, columns, and general data selection criteria.
Process Flow
1. Defining Report Rows
To access row maintenance, choose Rows in the Report Definition screen.
You can use row sets to display the hierarchical structure of the cost elements and to calculate group totals at various levels. In the Cost Center Accounting menu you have created at least one cost element group. The SAP R/3 System created cost element sets, which you can now use as row sets. By entering such a set in the row definition, the report is always be generated using the cost elements entered for those rows.

Report 1BAB-001
If instead you wish to enter the cost element group when the report is started, you must enter a multi-dimensional set in a report row containing a set variable. This set variable acts as a placeholder for the cost element group. When such a variable is defined in the report, the SAP R/3 System allows you to enter the cost element group or interval in the report selection screen.

Set variable &1KSTAR
The example cost center report should also distinguish between debit and credit postings. This is done by including characteristic BELKZ in the multi-dimensional set in addition to the cost element. The value of characteristic BELKZ can either be D (for debit) or C (for credit).
Use multi-dimensional set 1-L-IP-SH for the example cost center report. Note that the single dimension set 1-S-BELKZ is located in the first set row, followed by the set variable &1KSTAR in the second set row. As a result, the report first displays all debit postings for the cost center, followed by all credit postings. The cost elements are be sorted and totaled in these logical rows according to the set structure for the indicated cost element groups. Report Writer generates a subtotal at every set level.

In addition to the group totals derived from the cost element structure, the report also generates a total for each BELKZ characteristic value and a grand total for the multi-dimensional set.

The SAP R/3 System automatically identifies a logical report row within a given report, based on the row set description (such as 1-L-IP-SH "Cost elements"). The system derives the ID for the highest order group total from the first set in the multi-dimensional set found in the report row (such as 1-S-BELKZ "Over-/underabsorption"). All other lower order group total IDs are likewise derived from the respective set description (such as 1-S-BELKZ-S "Total costs").
You can create other report texts that differ from the set descriptions defined in Set Maintenance. Choose Extras ® Additional texts from the row or column definition dialog box and enter the specific report text for the lead column and a grand total in either Texts for Column Block or Texts for Row Block.

You can use characteristic BEKNZ in addition to characteristic BELKZ. If you use characteristic BELKZ, the report totals the debit and credit postings per cost element for both manual or periodic repostings. These postings are displayed as total costs. Moreover, reversing FI documents with the cost center account assignment feature balances out any credit posting entries by using the original debit entry for the account. Alternatively, using characteristic BEKNZ results in the debit and credit postings being displayed in separate rows, even in the case of repostings.
2. Defining Additional Report Rows
Just as with report 1SIP-001, you can also define additional logical report rows for the example cost center report that represent activity types, statistical key figures, and statistical postings. The latter postings are those made to the cost element records, but which are updated later using a different cost element category.

You may use a characteristic value within the report rows more than once. The same applies to report columns. However, you cannot use a characteristic in a row and a column.
3. Defining Report Columns
Assume you now want to display the actual and plan figures for particular posting periods in the columns of the example cost center report, including absolute and percentage variances. You need to enter the predefined column 1-C-IP in the report, containing the predefined columns ISWKG (actual costs) and PSWKG (plan costs). The characteristics VERSN (=version) and WRTTP (=value type) are stored in additional sets for the predefined columns ISWKG and PSWKG.
Use the Layout variation function to establish how the values are displayed in the report. Each report has five variations available for this purpose. A single variation establishes column width, the column number for the value's unit, and the number of decimal places and exponents for the report output. You can change these values for a particular report with the report layout function or save them in a standard layout. You can assign a display variant to each column in the report. You define this in the "P" column in the basic entries for the predefined columns.

The first three columns have been assigned display variant "0" in data set 1-C-IP, and the fourth column has been assigned variant "2." The fourth column will thus be 10 characters wide, not 20.
You can only perform arithmetic calculations within a column block. This means that the formulas may not refer to other predefined columns.
In the event your report uses more than one logical row or column, you must be sure only to activate logically permitted combinations so that your report generates useful results.

Assume that the cost center report should now display statistical key figures. In this case, it only makes sense to use a column set that also displays the statistical key figure values. All other columns for these report rows should be deactivated. In this instance, the appropriate column set is 1-C-SSK.
To deactivate individual columns in the row definition dialog, place the cursor on the desired row and choose Inactive columns. In the Inactive Columns dialog box, select the columns you wish to deactivate.
4. Defining General Data Selection Criteria
Use general data selection to define the characteristics you wish to use to select the data for the entire report. You can only use characteristics as general data selection criteria that you have not yet used in the individual rows or columns of the report.
With the exception of multi-dimensional sets, you can use all set types as general data selection criteria. You can also use set variables. However, you can only use those characteristics that have not been entered in the row or column definitions.
In the case of the example cost center report, the reporting objects are the cost centers themselves. Set variable &1KOSET was used for this characteristic. As a result, you are able to enter a cost center set or individual cost center values when you call up the report. Report Writer creates a report that sums up all postings for the selected cost centers and displays the same by cost element.
On the other hand, you should use a variation if you want to generate a report for each individual cost center for the set and for all levels of the cost center set. Use the Vary function to enter the group level for characteristic KOSTL to which Report Writer should expand the cost center set. The default value is 1 to 99, with level 1 being the highest hierarchical node and level 99 the lowest. If you also want to create a report for each individual cost center, you must additionally set the "I" indicator (individual value).
If you do not want to vary your cost center set on all levels, use other values. Level 1 indicates the highest hierarchical node and level 99 the lowest.
You can only activate the variation when you start your report if you have set this indicator.

You must use the characteristic "Controlling area" for reports assigned to table CCSS. The controlling area characteristic can only be used as an individual value, and then only in the general data selection criteria.
Before saving the report and assigning it to a report group, check your report definition for syntax errors. Choose Report ® Check The SAP R/3 System generates an error log listing any errors found.