CO std report - Report Painter

Report Painter – Beginners Guide

Report Painter is an easy and effective tool for SAP ERP reporting. This is Report Painter tutorial for beginners. Screen by screen you will learn  how to use this tool. When you master the basics, you’re ready to start with your own reports.  Avoid reinventing the wheel, use the existing standard reports as models.

1 Report Painter in SAP menu
2 Creating your first report
2.1 Report Design
2.2 Create report (GRR1)
2.3 Main elements of a Report Painter Report
2.4 Row definition
2.4.1 Lead Column
2.4.2 Row 1 – Cost Elements
2.4.2.1 Cost Element interval
2.4.2.2 Set
2.4.2.3 Variable
2.4.2.4 Set Variable
2.5 Column Definition
2.5.1 Key figure with characteristics
2.5.2 Predefined key figure – Actual costs
2.5.3 Predefined key figure – Plan costs
2.5.4 Formula
2.6 General Data Selection
2.7 Save and execute
2.7.1 Report Group
2.7.2 Errors?
2.7.3 New trial
2.8 Add Cost Centers to the report
2.8.1 Cost Centers in Rows
2.8.2 Cost Centers in Columns
2.8.3 Cost Center in General Data Selection
2.8.4 Variation
2.9 Column Heading Texts
2.10 Fiscal Year and Periods
2.11 Add and delete columns
2.11.1 Delete a Column
2.11.2 Insert a Column
2.12 Report title
2.13 Report / report interface
2.13.1 Drilldown to line item reports
2.15 Report Layout
2.15.1 Format Group
2.15.2 Report Layout
2.16 Sections
2.15.1 Create New section
2.16.1.1 Section with characteristics and key fig
2.15.1.2 Section with calculated key figures
3 Main elements of Report Painter
3.1 Library 1VK and Report Table CCSS
3.1.1 Characteristics
3.1.2 Basic Key Figures
3.1.3 Key figures (predefined key figures)
3.2 Create your own library
3.3 Report Group YREP
3.4 Sets and Variables

 

1     Report Painter in SAP menu

You find the Report Painter report from SAP Menu under:  Information Systems / Ad hoc Reports/ Report Painter / Report

Report Painter in SAP Menu

Or under Controlling / Cost Center Accounting (or Profit Center Accounting) / Information Systems /Tools / Report Painter / Report

Report Painter in Controlling menu

Library, Report Group and other important elements of Report Painter are under Report Writer menu.

SAP Menu Ad-hoc Reports

In which system or client you should do your exercise? If your Company has Sandbox client, use it. Otherwise use the test system.

2     Creating your first report

2.1  Report Design

Before jumping into Report Painter, spend a while planning your report.

We want to create a simple actual vs. plan cost accounting report.

Cost Center Report

2.2  Create report (GRR1)

Start the Report Painter and select from menu Create Report (or use transaction GRR1).

First you need to enter a library. Use the search help (F4) and open the library view.

Create Report GRR1

Take a closer look at the available libraries. Libraries beginning with a number are SAP standard libraries. You find libraries that contain cost accounting reports (cost centers, orders, projects, product costing), Financial Accounting reports and Logististic information system (LIS) etc.

Find Library / Report Table

A reporting table is always assigned to the library. This table contains characteristics and key figures that you can use in reports. Examples of characeristis are cost elements, cost centers, periods etc. Key figures are numerical value fields, such as Actual Costs or quantities.

Most SAP standard cost center reports are in library 1VK. Reporting table of 1VK is CCSS.

You can use an existing library or create your own library. Let’s use the library 1VK for our new report.

Give your report an id and description. The name must not start with a number or special character. Start the report name with Z or Y.

You can also copy the definitions from an existing report.

Create a Report Painter report

Press CREATE.

2.3  Main elements of a Report Painter Report

The main elements of every Report Painter report are Rows, Columns and General Data.

Main elements of Report Painter Report

Press CREATE.

Creating a report begins from an empty report with four rows and columns. You are going to use this report structure as a basis for your own report. It displays the report rows and columns as they will appear in the final report.

Report Painter report - create

2.4  Row definition

2.4.1     Lead Column

Double-click on the ‘Lead Column’ (1) and replace the text  with ‘Cost Elements’

Lead Column - text

Confirm with enter or green check mark.

2.4.2 Row 1 – Cost Elements

The title of the lead column is now Cost Elements.

Lead Column: Cost Elements

Double-click on Row 1. The Element Definition box opens.

Report Painter: Element Definition box

Select Cost Element from the ‘Available characteristics’ and move it to the left.

Report Painter: Available characteristic

Report Painter: Cost element

If you try to confirm the selection, you get a message: “Enter a set, a single value or an interval”.

Confirm

You need to define the cost element values and how they are presented in the report.

There are a couple of options how to do that.

2.4.2.1 Cost Element interval

You can use the actual cost element numbers (single or interval).

Row: cost element interval

In case you wish to enter several individual values or intervals, press ‘More’ to insert multiple lines. To compress the inserted lines press the ‘More’ with green arrow on the first line.

Row: cost element interval - more

Scroll to the end of the line. There you can choose how the values are presented in the report. You can choose between No explode, Explode and Single values. In the standard system, the No explode indicator is set as the default.

Row: cost element interval - explode

No explode: the values of an interval are summarized to one row.

Row: cost element interval - No explode

Explode: the values are singled out and totaled

Row: cost element interval - Explode

Single values: cost elements are shown separate with no  grand total.

Row: cost element interval - Single values

2.4.2.2 Set

Instead of the actual cost elemement values you can use a set. A set is a collection of cost elements. For example, all Cost Element Groups are sets.

Row: cost element SET

Row: Cost Element Set

Check the ‘Set’ and write the cost cost element group in From. If you don’t know any cost element groups, you can search for them with Row: Cost Element Variable (F4)

In the ‘Selection of set’ box, click on the small triangle.

Selection of Set

Choose Set Class ‘Cost Elem Grpr’ and enter the name of your Chart of Accounts under Organizational Unit.

Selection of Sets

Confirm your choices.

Select the Cost Element Group you want to use in your report. In this example group OAS is chosen.

Sets: cost element group OAS

Scroll to end of the line. Choose between No explode, Explode and Single values.

Row: cost element interval - explode

No explode: all the values are totaled to one line.

Row: cost element set -explode

Explode: the report displays single values, subtotals, and a grand total. The cost element group is exploded and subtotals are calculated based on the hierarchical structure.

Row: cost element set -explode

Row: cost element set -explode

Single Values: the levels of the cost element group are not displayed; only individual cost elements are shown. No grand total.

Row: cost element set -single values

2.4.2.3 Variable

Next alternative is to use Variables. You can only use variables that are defined in the reporting table of the library.

Row: variable

Reporting table CCSS (the table of our library 1VK) has no variables defined, why this choice is not possible.

Row: selection of variable

Look for available variables with (F4). Sort By Tables.

2.4.2.4 Set Variable

You could not use variables, but you can use something called ‘Set variables’. When you check both the Set and Variable, you indicate that you want to use a Set variable.

Row: Set Variable

There are several ‘Set variables’in table CCSS.

Row: Selection of variable 1KSTAR

Display variable (transaction GS13).

Set variable 1KSTAR contains all cost elements of the Controlling Area.

Row: Set variable 1KSTAR

Scroll to end of the line. Choose between No explode, Explode and Single values.

Row definition - explode

No explode: totals the values to one row.

Row definition - No explode

You might wonder why the total value of Actual costs is not the same as above, when we used the cost element group OAS? The explanation is that cost element group OAS does not contain all the cost elements of the Controlling Area, while 1KSTAR does.

Explode: 1KSTAR explodes only to one level. The report contains all cost elements and a grand total.

CE group OAS_EXT

You can replace 1KSTAR with a Cost Element Group in the report selection. In that case, it will be opened.

Row: cost element set -explode

Single values: cost elements are singled out. No grand total.

Row definition cost element group single values

Set variables enable the use of groups, sub-groups and value(s) in the report start. Variable 1KSTAR adds the selection group Cost Element Group or value(s). 1KSTAR has only one level, but you can replace it with any Cost Element group.

Selection Groups

In our report we will use the Set variable 1KSTAR for cost elements.

CE choice 1KSTAR explode

Click on the pen and maintain the default row text.

Maintain Row text

Enter the text: Total Costs.

Row texts

Confirm the entry.

Confirm

Now you can see the text ‘Total Costs’ and a * before it. It means that, the row contains a one-level group or set.

Total Costs

You cannot save the report before at least one column is defined.

Error: No columns

2.5 Column Definition

Columns contain a combination of characteristics and basic key figures. You can also use predefined key figures, which contain ready to use combinations defined by SAP.

Double-click on Column 1.

A box with two choices opens.

Let’s take a closer look at both of them.

2.5.1 Key figure with characteristics

Select first ‘Key figure with characteristics’ and press enter.

Columns: element type

Empty Element definition opens. If you are not familiar with Report Painter, you probably don’t know, what to choose.

Element definition: column 1

2.5.2 Predefined key figure – Actual costs

Let’s try the second option – Predefined key figure.

Element type: predefined column

You get at list of choices. Pick ‘Actual Costs in current year’.

predefined column: actual cost curr.yr.

This looks better. The Basic Key figure (SWKG Costs) and characteristics are automatically filled in.

predefined column: actual cost curr.yr.

CO version is 0 = plan/actual version, value Type is 4 = Actual, 1GJAHLJ is a formula variant that defaults the current fiscal year.

Take a peek at the variable definitions (transaction GS13). The value #S001 in the formula field brings the current year to the variable. If you use a formula variable, you don’t need to maintain the report definition, when the fiscal year changes.

Formula variable 1GJAHLJ

Let’s stick to this choice. Don’t worry about the Column text. We will deal with it later. Double-click next on Column 2. Now there is also a third option ‘Formula’.

Column 2: predefined column

2.5.3 Predefined key figure – Plan costs

In column 2 we want to present the planned costs. Let’s experiment with the Predefined key figures, if we can find something useful there.

Column 2: predefined column choices

Total plan costs in curr. year  brings the plan costs for the total year,  for periods 1-13.

Column 2: plan costs, periods 1-13

Plan costs, curr. year, curr. period brings the plan costs for the current month (1PERIK)

Column 2: plan costs, periods 1PERIK

Cumulative planned cost in curr year’ brings the plan costs from the beginning of the year (period 1) to the current period.

Column 2: plan costs, periods 1-1PERIK

Formula variable 1PERIK contains value ‘#S006’ = current period (check with transaction GS13).

There is no exact match with the actual cost definition. Let’s try the option ‘Cumulative planned cost in curr year’.

2.5.4 Formula

Now we have the actual costs in column 1 and planned costs in column 2. In column 3 we want to show the difference between actual and plan. Double-click on Column 3. Select this time Formula.

Column 3: formula

A formula editor opens. In the ‘formula components’ part you see X001 and X002, which are the two columns we just have defined.

Column 3: formula box

We want the absolute difference of these two columns in Column 3. It is easy. Just type X001-X002 in formula line, or choose the formula elements from formula components.

Column 3: formula actual-plan

Enter a text.

Column 3: formula text

Now we have the last column left. We want to show here the difference in percentage. Double-click Column 4.

Column 4: formula

Select Formula and type the formula (x001/x002)*100 or choose the formula elements from formula components..

Column 4: formula actual-plan %

Maintain the text.

Column 4: formula actual-plan % texts

This is how our report looks now.

report definition completed

Try to save it. Still something missing. Controlling Area must be specified somewhere.

error: co area missing

2.6 General Data Selection

Besides rows and columns, we need to maintain General data selection (under the Edit menu). Specify in General data selection all characteristics not needed in report rows or columns .

General Data Selection Menu

Empty Element definition opens.

Element Definition: General Data Selection

Move CO Area from the right to the left. If your company only has one controlling area, you can put the value here.

Element Definition: General Data Co Area 1000

2.7 Save and execute

Now you can save the report and take a first look at it.

Element Definition: General Data Co Area 1000

Start with the clock.

Execute report - clock

2.7.1 Report Group

You get a message on report group. All Painter Reports must be assigned to a Report Group before executing. On initial creation of a report the system will let you create a new report group.

No report group

Answer YES.

You can put the report in an existing report group, or you can create a new one. Create a report group YREP.

Report group YREP

Create report group

Answer YES and the system will create the Report Group.

2.7.2 Errors?

Successful generation of a Report Group requires that Controlling Area, Fiscal Year and Period all have been correctly defined.

We have defined Controlling area in General data and Fiscal year in Columns. Something is wrong with the characteristics Period.

Error: period

Characteristics Period was used in Plan Costs column.

Plan: characteristics Period

Actual Costs doesn’t  have Period, only Fiscal year is defined.

Actual:No period

We need to add the Period also to Actual column.

Actual:add Period

After this correction the system generates the Report Group and the programs necessary to run the report.

2.7.3 New trial

Start the report again with the clock.

This time we pass all the checks and the report selection screen opens.

Report Selection

The fiscal year, period and plan version get default values from the used variables. If you are using SAP IDES system, you probably need to change the defaulted fiscal year to an earlier one. I have changed the defaulted 2018 to  2013. The use of Set Variable 1KSTAR for cost elements adds the selection group for cost elements. Select group OAS.

Our first report looks like this.

Cost Center Report

This report displays all the costs of controlling area 1000. To see the costs per cost center, we need to define the cost centers somewhere in the report.

2.8 Add Cost Centers to the report

A characteristic can only appear once either in rows, columns or general data selection. What would be the best place for cost centers?

2.8.1 Cost Centers in Rows

We could add characteristic Cost Center to the row definition. Double-click on row 1. Select Cost Center and move it from the right to the left.

Row: cost elements, cost centers

We will use a Set Variable 1KOSET that contains all cost centers.

Choose Explode (at the end of the line) for both Cost Element and Cost Center.

Save the report and execute it.

The selection screen has now changed. Cost Center Group or value(s) has been added to the Selection group. The Set variable 1KOSET enabled that.

IDES has very old data, why I change the defaulted fiscal year. The selection is restricted to Cost Center Group H2410 and Cost Element Group OAS_PERS.

Selection screen

The report lists Cost Centers by Cost Elements. The Cost Element group is exploded with subtotals and a grand total.

Report: cost elements, cost centers

Is it possible to change the order?

We can change the order of characteristics in the report definition. Select under menu Edit Rows/Explode.

Menu: Edit / Rows

In the Explode Characteristics you see the order of the elements.

Explode: Cost element, cost center

Change the indicator from 2 to 1 for Cost Center.

Explode: cost center, cost element

Save and run the report with same selection as above.

Now we have the report in reverse order.

cost center / cost element report

You can experiment with different choices. For example you could choose Single values for Cost Elements.

cost center / cost element report

The report shows then the Cost Elements for each Cost Center without Cost Element hierarchy levels.

cost center / cost element report

2.8.2 Cost Centers in Columns

Columns are used to display key figure values, why the idea of placing characteristic Cost Center there may seem strange.

However, you might want to create a report consisting of a few Cost Centers and their values. You can then define the characteristic Cost Center in each column and use the cost center number as header text.

cost centers in columns

Double-click on the first column. Move Cost Center to the elemements.

cost centers in columns

Change the the column heading to Cost Center Name. Save and execute the report.

The report looks like this.

cost centers in columns - report

2.8.3 Cost Center in General Data Selection

We have still one option. We can specify the characteristics Cost Center in General data selection.

Remove the Cost Center from column definition and add it as a Set Variable 1KOSET to General data selection (under Edit).

cost centers in general data

Choose Explode.

When you run the report, the Cost Center Group opens in the navigation area on the left.

cost centers in general data - report

To hide the Navigation Area, click on the Hierarchy Button on the left. The variation buttons on the right allow you to navigate between hierarchy levels.

2.8.4 Variation

The variation function allows you to print several reports at one go. It is possible to print a report for each element in a group (set) defined in General data selection.

print_variation_reports

The hierachy in the picture has 3 levels and 6 individual cost centers. When you print, you can choose, whether you want to print the selected level (H2010) or 9 separate reports of all variation levels.

Variation is defined in report definition and is related to General data selections . Characteristics defined as groups (sets) in General data selection show up in variation (menu Edit/Variation).

menu: variation

variation: expand

The characteristic Cost Center is expanded, because it was exploded in the General data selection.

If you execute the report in expert mode, you can change the variation setting.

Selection screen: variation

In Expert mode Variation is displayed in report selection.

Selection screen: variation

How to set expert mode:

Menu: Environment Options

Expert Mode

If Expert Mode is not checked, variation is not visible.

Selection screen: no variation

2.9 Column Heading Texts

Our report looks now like this. What if you wanted to show the periods in the column headings? This can be done with variables.

Column headings

We used element Period in columns 1 and 2 with values 1-1PERIK. Let’s change the From-value from 1 to 1PERIV. The default value of 1PERIV is 1, but the the value of can be changed at report start. Make this change in both columns.

Double-click on the column header and maintain the texts in the Element definition.

Column headings - texts

If you want to use the period interval in column text, enter the text in the Long text like this Actual &1PERIV – &1PERIK. It is also possible use arrow heads (Actual <&1PERIV> – <&1PERIK>)

Column headings - texts

Column headings - texts

Short text is defaulted, why you need to change the header text lenght to One-line long text.

Menu: Header text length

Menu: Header text length

You can now see the variables in column headings.

Menu: Column headings - variables

When you execute the report, the variables are replaced with their values.

Menu: Column headings - variables

2.10 Fiscal Year and Periods

So far we have defined Cost Elements in the row, Cost Centers and Controlling Area in General Data selection, Fiscal year and Period in Columns.

Fiscal year and Period interval are in both Actual and Plan columns. We could consider moving them to General data selection. In this report it would be OK, as the values are the same in both columns. For now we will leave the Fiscal year and Period as they are in column definition.

Next we want to add a new column for previous years values. Select the predefined column Act.costs prev.yr. It adds fiscal year but no periods.

Menu: Column 5 - prev.yr

Menu: Column 5 - prev.yr elements

Because of the missing period, we get an error when we try save and to run the report.

Menu: Column 5 - error: period

We have two alternatives to correct the error:

1. add period definition also to the previous year column

2. move the period definition to General data selection

We choose alternative 2. First remove Period from all columns and then add it to General Data. Now it is valid for all columns.

Menu: Column 5 - elements with period

Change the name of the Prev.yr. column heading to &1GJAHVJ &1PERIV – &1PERIK

Menu: Column 5 - texts

Run the report.

Menu: Report with 5 columns

Where did the variable 1GJAHVJ get the value 2012?

The explanation is found in variable definition (transaction GS13). The 1GJAHVJ is a formula variable with value ‘&1GJAHLJ’-1. Variable 1GJAHLJ contains value ‘#S001’ = current year.

formula variable 1GJAHVJ

In my example I changed the defaulted current year to 2013, because IDES does not contain current data.

We need to keep the Fiscal year in columns, because it is not the same in all columns.

In table CCSS we find several variables for Fiscal year. Does it matter which of them we use? If you check the variable definition (transaction GS13), you find out that several of them default the current year (‘#S001’)

selection of variable

Let’s experiment a little.

Change the Fiscal year variable as follows:

Actual: 1GJAHR, Plan 1CGJAHE, Previous year 1GJAHVJ.

Run the report. The Fiscal year appears three times in the selection.

selection of variable

report 5 columns

Change the definition as follows:

Actual 1GJAHR, Plan 1GJAHR, Previous year 1GJAHVJ.

Run the report.

report selection: fiscal years

report / fiscal years

Why do we still get two Fiscal Years? The cause is variable 1GJAHVJ that we used for Previous year. It is derived from the current year variable 1GJAHLJ, which is displayed in the selection.

If you use in the report figures for previous years, use 1GJAHLJ for current year. Variables 1GJAHVJ and 1GJAHVV are derived from 1GJAHLJ.

1GJAHVJ = 1GJAHLJ-1, 1GJAHVV= 1GJAHLJ -2.

selection of variable 1JAHVJ,1GJAHVV

You can avoid the problem of multiple selection fields caused by inconsistent variables, if you can move the characteristics to general data selection. We did this with the characteristics Period. However, you need to keep the Fiscal Year in column definition, because it is not same for all columns.

2.11 Add and delete columns

2.11.1 Delete a Column

If you need to delete a column from the definition, right-click on the column and select Delete from the menu.

delete column

2.11.2 Insert a Column

If you need to a column between existing columns, click inside the column before which you want to add the new column. Right-click to open the menu. Select Insert element. Select element type.

insert column select element type

2.12 Report title

You might wonder where you can change the “: Selection” displayed at the beginning of the report.

report title :selection

You do it in the Report Group (GR52). Enter there the text you want to see in ‘Description’.

report group: description

The description text is added before ”: Selection” .

Cost centers Plan/actual description

2.13 Report / report interface

In the SAP standard reports we can drilldown to line items and original documents. How do we get this functionality to our own reports? This is also done in the Report Group.

2.13.1 Drilldown to line item reports

You find Reports Groups in Ad Hoc reports under Report Writer. SAP Menu: Information Systems / Ad hoc Reports/ Report Writer/Report Group

Menu: Report Group

Our report group was YREP.

Report Group YREP

The drilldown feature is called Report/Report Interface. It can be defined at Library or Report Group level.

Report/report interface

Click on Configure.

Report/report interface configure

To add a report definition, click on Plus.

Report/report interface add

Enter the name of the Report Group. Our group was YREP. Select ‘Other Report Type’.

Report/report Other report type

Select Report type TR Transaction.

Report/report type TR

Check in the SAP menu, which are the transactions for Cost Center line item reports. KSB1 in sap menu

Return to Report Group and add transaction code KSB1 Actual line items.

TR KSB1

When you return back to Assign Report, click on Plus to add the Plan line items report. Enter the report group YREP, select Other Report Type and TR. Enter the transaction KSBP Plan line items.

You can change the order of the reports, if you want.

Change order

Select (1) first Actual line items, place then the cursor on Plan Line items and click on Move (2).

Save

Save the definition.

There are now two reports assigned to the report group.

configure

Test run your report. Double-click a figure in actual column.

test drilldown

A report selection box opens. Select Actual line items.

drilldown report selection

You come to the Actual line items report.

cost center line items

Here you can choose a line, double-click it and move over to the original document. In this example to the accounting document.

fi document

Return to your cost center report with the green arrow.

2.14 Report Layout

Next we will take a quick look at the report layout.

2.14.1 Format Group

Above every column you can see a format group (0).

format groups

You find the format settings from menu Formatting/Columns.

menu formatting columns

The format groups controls: the column width, scaling 1-1.000.000, decimals 0 – 0,00000 etc.

format group 0

Change the scaling to thousands.

report in thousands

This setting is not a very good for column 4 Var (%). We can change the format group for this column. Double-click on the format group 0 above the column. Assign format group 1 for this column.

assign format group

Change the scaling in group 1 to 0, with no decimals and check the outcome.

format group assigned

2.14.2 Report Layout

Select Report Header from menu Edit

menu: edit / report header

SAP standard layout is the default setting.

maintain report header

SAP standard layout is the default, but you can also define your own layout and set it as standard layout.

sap menu: standard layout

sap menu: SAP standard layout

sap menu: SAP standard layout

Use transaction GR11 to create own layouts.

sap menu: Create standard layout

Copy the new layout from existing standard layout and make the changes you want.

menu: formatting report layout

The Report layout is in menu Formatting/Report Layout.

formatting report layout

If you run the report in Expert Mode, you can change the Layout settings under Settings/Report Layout.

2.15 Sections

2.15.1 Create New section

You can use sections in your reports.

menu: edit section/new section

First you define the type of the section.

new section

2.15.1.1 Section with characteristics and key figures

The definition of Sections with characteristics and key figures is the  same as for columns. You can present statistical postings, statistical key figures, acticity types, quantieties in report sections.

SAP Help: “If cost centers, orders and project wbs are needed together, they are usually in separate sections of the report. The cost cost center is repeated in each sections lead column.”

As you already know how define Report Painter rows and columns,  I will not repeat it here.

section characteristics with keyfigures

2.15.1.2 Section with calculated key figures

Here you can present all kind of key figures. In our report we had in columns 3 and 4 the difference between Actual and Plan. We could present them as calculated Key figures.

section calculated keyfigures

Before you start with the section definition, you need to define cells that you use in the key figures. Double click the intersection of row and column. A check mark is added. It indicates the cells you can use in calculations.

section selected cells

Move to the section with section buttons.

next section

Enter the header texts.

section: calculated keyfigures

Double-click on the first row the lead columns and add the name of the first key figure. Repeat for the next key figure. In the adjacent column  + xxx.xxx is added. It is a placeholder for the formulas.

section: formula table

Double-click on the placeholders. The formula editor opens. The cells defined are already there. Write the formula to the formula line.

Save and test run the report.

report test

report test - section report

3 Main elements of Report Painter

The main elements of Report Painter reports are:

· Reporting tables

· Report Libraries /

· Report Group

main element of report painter report

We have already encountered them, when creating our report.

3.1 Library 1VK and Report Table CCSS

Let’s take a closer look at library 1VK (tx. GR23)

display library

1VK Most Standard Cost Center reports are in here

display library

The keystone of the library is a reporting table (1) that provides the characteristics and key figures you can use in reports. Library 1VK uses table CCSS. If you create your own library, the first thing to do is to choose a reporting table.

Below some of the most commonly used reporting tables.

display library

3.1.1 Characteristics

Characteristics (2) are elements you will use in the report rows, columns and selections. Such as cost center, cost element, profit center, account.

characteristics

3.1.2 Basic Key Figures

Basic Key Figures (3) are numerical value fields. Such as costs, quantity, Total costs in trans. or object currency.

Basic characteristics

3.1.3 Key figures (predefined key figures)

Predefined key figures (4) combine key figures and characteristics. Examples of key figures: actual costs in current year, plan costs in closed year.

Key figures

3.2 create your own library

menu: library create

Start the names of your own libraries with Y or Z.

create library zvk - initial

create library zvk - header

copy report to library zvk

3.3 Report Group YREP

A Report Painter report contains only the report definition. Everything else is in the Report Group. When you run a new report for the first time, the system checks the Report Group assignment. If the report is not in any Report Group, you can either choose an existing Report Group or let the system create a new group.

The system executes all the reports in the Report Group at the same time. Usually there is only one report, but there can be several, e.g. month end reports. You can assign a report to several Report Groups.

change report group

If the report group contains several reports these can be executed as a set. For example you have two reports in report group YREP.

report group: reports

Start the reports from the report group.

report group: execute

Both reports show up on the report screen, where you can start them.

report group: executed

In the report group header you entered the description that shows up in the report selection screen.

The drilldown to line items was defined in the Report/Report interface of the Report Group.

report group

3.4 Sets and Variables

We have in our definitions used different sets and variables.

All the cost element, cost center, order, profit center groups are sets that you can use in the report definitions.

For cost elements and cost centers we used Set variables.

cost element group 1KSTAR

variables

Variables are in Report Writer menu.

menu: GS13

Set variable 1KSTAR contains all cost elements. Set variable 1KOSET contains all cost centers.

The use of set variables adds to report selection the possibility to select groups. For example 1KOSET -> Cost Center Group or values(s), 1KSTAR -> Cost Element Group or value(s).

Depending on their definition the variables can get different default values.

menu: GS13

We used variables also in the column headings. Before the variable a prefix  “&” was added. Numerical variables enable calculations, such as  “&CURYEAR – 1”.

menu: GS13

You can maintain the variables with transactions GS13 Display, GS12 Change.

Set variable 1KSTAR contains all cost elements. Set variable 1KOSET contains all cost centers.

display set variable 1KSTAR

We explored the use of variables to define Fiscal year and Period.

1GJAHLJ contains a system variable #S001= current year.

variable 1GJAHLJ

Variable 1GJAHVJ contains a formula ‘current year – 1

variable 1GJAHVJ

Variables 1PERIV, 1PERIK define the period interval.  The default value of 1PERIV is 1, which you can be change in the report selection.

variable 1PERIV

The variable 1PERIK contains a system variable  #S006 = current period.

variable 1PERIK

Use standard variables for the reporting tables, if possible. Table T802G contains the variables per the tables.

What next?

At this stage of the exercise you should have the basic skills necessary to work with your own reports. Keep in mind that there are lot’s of standard reports in the system that you can copy and mofify to suit your own purposes.

How to get the reports to production? That depends on the IT policies of your company. It is possible to create transport requests or export the report definitions as text files to other systems (DEV, PRD). It is possible to  generate transactions and attach the reports to report trees (Area Menus).

SAP area menu - steps

More on the subject:

SAP Area Menus

How to export/import report groups

 

SAP QuickViewer SQVI

SAP QuickView

SAP Reporting Tools: QuickView

Managers often want all kinds of reports about accounts, customers and vendors and business transactions that cannot be answered with existing reports. You need to ask the sales, purchases, production, and then try put it together in Excel. However, there are tools in SAP that can help you. Without programming skills, with only a little knowledge about the tables. One of these tools is SAP QuickView.

QuickView is an easy tool that can be used to answer simple questions or perform ad hoc analysis of data without programming skills. QuickView is a personal tool. Only you can see queries created by you.

In many companies using the reporting tools like QuickView is not allowed. The reasons are that badly created queries can harm the system perfomance, or are considered security risk. In case you have access to SQWI in the test system, create and test the report there. If it fulfills the requirements, you can convert the QuickWiew report to SAP Query. You can then copy the Query to Development, assign it as a report to an Area Menu, assign necessary authorization and finally transport all to production.

To give you a picture of how the QuickWiev works, below you find an example of a simple SD billing  report created with QuickView. This presentation is aimed for absolute beginners. For others there are plenty of material online. Just google SAP QuickViewer.

Table of contents

SD Billing Report
Table Join Definition
Initial Screen
Data Fields – VBRK
Data Fields VBRP
Run the Report
Report Result
Remove unnecessary fields
ALV Functions
Report Layout
Sort ascending / descending
Filter Columns
Save Layout
Export to Excel
Output format
SD billing report, customer level
Change Join Condition
Header vs. Item level Data
Amount and signs
Logical Databases
QuickViewer SAP Query

SQVI_toolbox

Start Quick View from the System Menu under Services or with transaction SQVI.

SQVI_Menu

SQVI_Menu

The Initial Screen opens. On the right side is the work area and on the left Welcome information.

SAP QuickViewer SQVI

SQVI_Create_Quick_view_report

SQVI_welcome

SQVI_welcome.

Using the QuickView requires some knowledge of SAP tables and fields in them.
The documents usually have a header section and items section, which both are separate tables. In this exercise we are building a customer billing report. A billing document (SD Invoice) consists of header and items. The transaction for Display Invoice is VF03.

The header level data of a billing document is saved in a table called VBRK. The item level data is in table VBRP. You can look closer at the content of the tables with SE16/SE16N Data Browser.

Below you can see a simple SD billing document with a header and one item.

SQVI_BillingDocument_VF03

SQVI_BillingDocument_VF03

You find the table and field names with F1-help. Put the cursor on the field (e.g. Invoice Number), press F1 and click the “Technical Information” icon in the Performance Assistant Screen.

icons_technical_information

Icons_technical_information

SQVI_BillingDocument_VF03_F1

SQVI_BillingDocument_VF03_F1

You can see that the name of the screen field is “VBRK-VBELN”. The first part is the table name and second the field name.

SQVI_BillingDocument_VF03_F1_field_name

SQVI_BillingDocument_VF03_F1_field_name

SD Billing Report

Let’s get started. Name your new QuickView report and press Create. I often name the query after the tables used. I will call this report VBRK_VBRP.

SAP QuickViewer SQVI

Enter a title and select a data source. You can choose between table, table join, Logical Data base and SAP Query Info Set.

SQVI_Choose_data_source_choices

SQVI_Choose_data_source_choices

If you get all the data needed for the report from a single table, you choose table. In the billing report, if you only need customer level data, you get it from the header level table (VBRK). Later in this presentation I have an example for this.

Table join is needed when you have two or more tables involved. In case of billing report, when also product level data is needed, the item table VBRP must be included.

Some header + item tables cannot be used in joins, for these SAP has created packaged joins, called Logical Data base. For example accounting document data (BKPF and BSEG) are such tables.

Info sets defined for Sap queries and can be used in QuickViewer.

Here we choose Table join.

Accept the data source definition.

At the end of the Initial Screen you can see something called Mode. You can select the mode you want to work with (basis mode / layout mode). This can be changed later. The Basis mode is defaulted.

SQVI_basis_mode_layout_mode

SQVI_basis_mode_layout_mode

Table join definition

Next you are required to define the tables to be joined. Click on the Insert Table icon. Add the first table VBRK.

SQVI_table_join_selection_table1

SQVI_table_join_selection_table1

The table content comes visible. Click again on the Insert table icon and add the item table VBRP.

SQVI_table_join_VBRK

SQVI_table_join_VBRK

SQVI_table_join_VBRK_VBRP

SQVI_table_join_VBRK_VBRP

The join condition VBELN Billing Document number is automatically proposed.
Back with the green arrow.
Now you can start building your report.

Initial Screen

The work area opens in Basis mode. You can switch to Layout mode, if you prefer the graphical layout. In this presentation the Basis mode is used.

SQVI_Initial_Screen_Basis_mode

SQVI_Initial_Screen_Layout_mode

SQVI_Initial_Screen_Layout_mode

On the left you can see the fields of the joined tables VBRK and VBRP. The fields used in our report will be chosen from these tables.

SQVI_Initial_Screen_Basis_mode_2

 

SQVI_Initial_Screen_Basis_mode_2

You can select fields from Available fields on the right and move them to Fields in the list. When you do that the Data Field on the left becomes green and List Field is ticked.

I prefer to select the fields directly from the Data Fields on the left and tick both the List Field and  the Selection filed at the same time. It is also possible to look for the fields using the binoculars

Data Fields – VBRK

Mark the fields you want to appear in the report (List Fields) and fields that you want to use as selection parameters when starting the report (Selection Fields).

SQVI_table_join_VBRK_VBRP_header_data

SQVI_table_join_VBRK_VBRP_header_fields

The List fields show on the right in Fields of the List. You can change the order with the black arrows.

SQVI_table_join_VBRK_VBRP_data_header_fields

SQVI_table_join_VBRK_VBRP_header_data

From the billing document headers following field are selected to our report:

  • Billing Document
  • Billing Type
  • Sales Organization
  • Billing Date
  • Company Code
  • Payer
  • Sold-to-Party

List Fields – VBRP

When you have selected the Header fields, continue with the Item fields. Mark the list and selection fields on item level. Notice that the join condition ‘Billing Document’ is also in the item table. It is already selected in the header level.  The rule is that always select the fields on the highest levels.  Select the Billing Item at this level.

SQVI_table_join_VBRK_VBRP_data_fields_items

SQVI_table_join_VBRK_VBRP_data_fields_items

Order the list fields on the right. You can change the order later, if you want to.

SQVI_table_join_VBRK_VBRP_data_fields

SQVI_table_join_VBRK_VBRP_data_fields

The fields in my selection are:

Company Code, Sales Organization, Sold-to party, Payer, Billing Document, Billing item, Billing Type, Billing date, Profit Center, Plant, Material Number, Short text for sales order item, Actual Invoiced Quantity, Unit of Sales, Cost in document currency, Net Value in document currency, Sub total 1, currency.

Save the report.

Run the report

Now the query is ready to run.  On the initial selection screen you can see the fields that were marked as Selection Fields. Make your selections. You can also start the query without selection. Then number of data sets to be read is defaulted to 100.

SQVI_execute_selection_screen_filled

SQVI_execute_selection_screen_filled

Click the Clock icon to start the report.

Report result

Look at the outcome. The fields are in the same order as in the Fields in List. Maybe some reordering is needed.

Notice that the Sales Unit (PC) appears twice in the list. When you chose the Sales Quantity, it came with the unit and Sales Unit is not needed. The same goes with the Cost and value fields (Net Value, Subtotal 1). The currency column is automatically added.

SQVI_result_1

SQVI_result_1

In SD there are several fields for values. How do you know which one to choose? There are several files called Subtotal that contain SD condition values. What’s in these fields depends on the pricing procedure. In this example the Net value and Subtotal 1 seem to have same value. We can drop the other one from the query. The Cost fields shows the inventory value of the product from the material master.

SQVI_table_join_VBRK_VBRP_data_fields_items_subtotals

SQVI_table_join_VBRK_VBRP_data_fields_items_subtotals

Let’s go back to the QuickView definition and remove Sales Unit and Subtotal1 from the query.

Remove unnecessary Fields

Remove fields Sales Unit, Subtotal 1 and currency from the Fields in List. Choose the item either in the Fields in the List and move it to the right, or delete the check mark in table VBRP on the left.

SQVI_remove_sales_unit

SQVI_remove_sales_unit

SQVI_remove_sales_unit_1

SQVI_remove_sales_unit_1

Save after changes and start the report again. Below the Subtotal column and the Sales unit are removed. The columns are rearranged. In an ALV report you can move the columns by dragging them with the mouse.

SQVI_result_1B

SQVI_result_1B

ALV-functions

SQVI_ribbon_numbered

SQVI_ribbon_numbered

QuickViewer reports use SAP Abap List Viewer (ALV) functionality. This offers a several tools to format the layout.

  1. Details
  2. Sort in ascending/descending order
  3. Find / Find next
  4. Set Filter / delete Filter
  5. Total
  6. Subtotal
  7. Print
  8. Views (List Output, Grid, Excel inplace)
  9. Export (File, spreadsheet etc.)
  10. Layout (Choose, Change, Save, Manage)
  11. Report Calls
  12. Display Graphic
  13. End User Documentation
  14. Launch to SBO Explorer (Business Objects)

ALV layout functions that let you to sort the fields, drag the fields with mouse, add totals and sub totals, save the layout and define it as default layout to be used always when the report is started.

Below the report is sorted and sub totaled by the Sold-to-Party column.

SQVI_Result_3

SQVI_result_3

Layout

You can choose, change (rearrange columns, sort, filter, add totals and subtotals), save and manage the layouts with the Layout button.

SQVI_result_2

SQVI_result_2

icons_choose_layout_2

icons_choose_layout_2

The Change Layout out screen opens. Here you can remove fields by dragging them to Column Set on the right. You can drag the fields other location. You can save the Layout for later use or to be used as default Layout.

SQVI_result_change_layout_screen

change_layout_screen

Sort ascending / descending

You can sort columns in ascending or descending order. The outcome depends wether you have You can select wether you ‘with or without cell merging’ selected. Below column Sold-to-party sorted and sub totaled with cell merging.

SQVI_result_cells_merged

SQVI_result_cells_merged

Below the same report without cell merging.

SQVI_result_without_cell_merging

SQVI_result_without_cell_merging

When the columns are sorted, the cells are merged. If you don’t want that, choose the Change Layout / Display. There you can select option without cell merging during sorts.

SQVI_change_layout_Display_Cell_Merging

SQVI_change_layout_Display_Cell_Merging

Filter Columns

You can filter the values of a selected columns. For example you could show only items, where the Net value is bigger than 50.000.

You can use either the Set Filter icon in the bar, or the right click the column and select Set Filter from there.

icons_filter

icons_filter_2 

SQVI_save_layout_right_click_menu

SQVI_save_layout_right_click_menu

Select the column and Filter. On the ‘Determine values’ pop up right click the Net value and select Options from the menu. Choose ‘Greater than or equal to’ and enter the threshold value 50.000.

SQVI_filter_options

SQVI_filter_options

Maintain selection options. Select Greater than Equal to and enter the threshold value 50000.

SQVI_filter_net_value

SQVI_filter_net_value

SQVI_filter_options_2

SQVI_filter_options_2

Below you can see the result. The small markings in the column headers tell you which columns have been sorted, totaled or filtered.

SQVI_result_filter_50000

SQVI_result_filter_50000

Only values greater than 50.000 are displayed.

The filter is removed with Delete Filter.

icons_filter_2

icons_filter_2

If you want to cancel a sort, you can do it in the Change Layout Sort Order tab. Move the column name to Column Set.

SQVI_result_change_layout_sort

 

Save Default layout

When you are happy with the styling of your report, you can save the layout.

icons_choose_layout_2

SQVI_save_layout

Start the layout name with /. If you want a user specific layout that only you can see, start the name with a letter (A-Z). You can also define the layout as Default. A default layout is always chosen, when you start the report.

SQVI_result_change_layout

SQVI_result_change_layout

Export to Excel

Maybe you want to transfer your report Excel. There a several ways to do it.

Click the Export Button. Select Spreadsheet.

icons_export

icons_export

icons_export_2

icons_export2

Select the Spreadsheet Format. I use ’08 Excel in Existing XXL Format’.

SQVI_export_excel_2

SQVI_export_excel_2

The outcome in Excel looks like this.

SQVI_export_excel_1

SQVI_export_excel_1

Another way is to choose Excel from the Views icon.

icons_views_2

icons_views_2

The outcome in Excel looks like this.

SQVI_excel_inplace

SQVI_excel_inplace

Output format

It is also possible to define the Excel Output in the QuickView definitions. SAP List Viewer is defaulted. If you choose another option, you will see an output selection list, when you start the report.

SAP SQVI output format

SQVI_export_as

If you have chosen Excel as output format, you will see all possible output formats at the end of the selection screen when you start the report. Select spreadsheet to use Excel as output form.

SQVI_export_as_excel

SQVI_export_as_excel

Below our report in Output format Spreadsheet.

SQVI_export_excel_1

SQVI_export_excel_1

SD billing report, customer level

Let’s create another report.  This time we are not interested in products. We only need the sales figures by customer. All information we need is in the header table VBRK

Start SQVI and choose Create. Name the report VBRK.

Enter a title.
As Data Source choose Table.
Give the name of the table.
Keep the defaulted Basis Mode.

SQVI_VBRK_Customer_billing_000

SQVI_VBRK_Customer_billing_000

Select the list and selection fields.

SQVI_VBRK_Customer_billing_001

SQVI_VBRK_Customer_billing_001

Order the fields with the arrow keys.

SQVI_VBRK_Customer_billing_002

SQVI_VBRK_Customer_billing_002

SQVI_VBRK_Customer_billing_005

SQVI_VBRK_Customer_billing_005

Save the report after changes. Start the report.

Make the selections and start the report with the clock.

SQVI_VBRK_Customer_billing_003

SQVI_VBRK_Customer_billing_003

The report is displayed.

SQVI_VBRK_Customer_billing_004

SQVI_VBRK_Customer_billing_004

Maybe you would like to have the customer name in the report.
The customer name is not in the table VBRK. It is in the Customer master data table KNA1. Showing the name would demand a join of these tables. However, at this point you cannot change the choice of the Data Source Table to Table join. If you want the Customer name in the report, you need to start from beginning and define a join between tables VBRK and KNA1. I don’t do it now. Instead I add the table in our first report VBRK_VBRP.

Changing the join conditions

Customer name could not be added to the report VBRK, because the the selected Data Source was Table, not Table Join. Let’s try to add it to our original report VBRK_VBRP.

Start SQVI, select report VBRK_VBRP and choose Change.

SQVI_Change

SQVI_Change

Open the Data Source tab and Change join.

SQVI_Change_table_join

SQVI_Change_table_join

We know that the customer name is in the table KNA1 and therefore want add this table to the join.

Click Insert Table and enter KNA1.

SQVI_Change_table_join_add_table

SQVI_Change_table_join_add_table

SQVI_Change_table_join_KNA1

SQVI_Change_table_join_KNA1

The system joins the KNA1 table to table VBRP and default a join condition. However, this is not a correct link. Right Click the join line and delete the link.

SQVI_Change_tab_join_KNA1_KUNNR

SQVI_Change_tab_join_KNA1_KUNNR

Click Join Conditions.

icons_propose_join_conditions

icons_propose_join_conditions

Insert the tables to be joined. We want to link the KNA1 table with the header table VBRK.

SQVI_Change_table_join_conditions_2

 

SQVI_Change_table_join_conditions_2

The system proposes a join. This time we a not happy with field proposal and change it manually linking fields KUNAG and KUNNR. When we go back to the QuickView determination screen, the KNA1 table is added on the left.

SQVI_Change_tab_join_KNA1_added

SQVI_Change_tab_join_KNA1_added

Choose the Field Name1 from table KNA1. Move it after the Sold-to-Party.

SQVI_Change_tab_join_KNA1_name1

SQVI_Change_tab_join_KNA1_name1

Save the report and run it. Looks like nothing has changed in the report. The reason for this, is that the name1 is missing from our default layout. Click the Change layout and move the Name1 to Displayed columns.

SQVI_change_tab_join_KNA1_report_Layout

 

SQVI_change_tab_join_KNA1_report_Layout

SQVI_Change_tab_join_KNA1_report_name1

SQVI_Change_tab_join_KNA1_report_name1

Now you can see the customer name.

Amounts and signs

The amounts are in document currency and values are shown as absolute values without signs. You cannot tell the difference between debit and credit notes.

In this example all items were F2 invoices and the sign is not a problem. But usually there are Credit Notes, Cancellations, Return, and the sign must be regarded. The billing type can be used to specify the signs.

In QuickWiew you cannot do anything. If this is the case, export the report to Excel and multiply the amounts that should be negative with -1.

You can not manipulate data in SQVI, you need SAP Query for that.

Header vs. item level data

Maybe your wondered why some fields appear both on header and item level. One example is the Net Value.

SQVI_net_values_header_vs_item

SQVI_net_values_header_vs_item

Let’s go back to our original QVI report VBRK_VBRP and do some experimenting. Select Net Value from both tables to the report. Save and start the report. The outcome looks somewhat funny. Same amount (the total of the items values) appears multiple times in the first Net value column. The net value taken from table VBRK is the total net value for the entire invoice. Item level Net value is the net value of individual product rows.

SQVI_result_net_value_header_vs_item

SQVI_result_net_values_header_vs_item

There is switch for technical names in the QuickView definition screen.

SQVI_net_values_tech_view

SQVI_net_values_tech_view

Logical Databases

Not all tables can be joined. For example accounting document tables BKPF (header) and BSEG (item) cannot be joined. Does this mean that you can’t create accounting reports? No it does not, instead of joins you can use Logical Databases. These are created by SAP and provide a particular view of database tables that can be used in queries.

SQVI_logical_database_BRF

SQVI_logical_database_BRF

QuickView vs. SAP Query

QuickViewer is an excellent tool for creating ad hoc reports and queries. However, it is a pretty simple tool with many restrictions. For example you cannot:

  • add additional logic (add additional fields, distinguish between a debit amount and a credit amount, change the column header texts)
  • drill-down to the documents is not possible
  • share the queries with other users.

QuickViewer lets you to get familiar with the tables and their contents. Learning to use it is easy, which encourages to experiment and improvise.

When more permanent reports are needed, you can move over to SAP Query, another reporting tool to be used without programming skills. SAP Query has more features than QuickViewer and reports are available for other users.
It is also possible to convert the QuickViewer report to a SAP Query. You do this from SQ01, not SQVI. Use the menu path Query / Convert QuickView and enter the quick view query name.

SAP Query: Creating a billing report

When you get familiar with the QuickViewer (SQVI), you probably would like overcome its restrictions and share your reports with other users. Allthough it is possible to convert the SQVI reports to SAP Queries,  maybe you’d rather  like to learn how to use use the SAP Query.

You create a SAP Query the same way as QuickViewer queries. The biggest difference is that you need first to create an  InfoSet that forms the basis of every query. Here you select the data source (tables, table joins, logical databases) and define the list and selection fields.  The information requirements of the users define the InfoSets.

SQ_InfoSet_Salesreport

SAP Query offers a broad range of ways to define reports. You can create different types of reports such as basic lists, statistics, and ranked lists. You are also able to drill down to documents and treat the problems with signs, You don’t need coding skills to do this, but it is also possible to add pieces of code to your queries.

Usually a reporting requirement, which the existing standard reports  cannot solve, triggers the need for a Query. Before jumping into details you should make a rough sketch. What information the report should contain, and how it should look. Next you need to find out where to find this information. Use Se16 and SQVI to help you. When you have are sure of the report, continue with InfoSet definition. Choose the infosource and select the fields. The InfoSet is assigned to a User Group. So, you must already have one or create a new. When all this is ready, you can start to create your query.

Query environment

It is not a good idea to do the queries directly in production. Usually this is also prevented by IT. Development is not so good either, because there is no data to test the query. You can create the queries in the test system. When they pass the tests,  and function without problems, you can copy them to production. It is also a good idea to copy them to development also.

SQ_phases

Steps to create a SAP Query

 

SAP Query Step-by-Step Guide:


Creating Reports with SAP Query < HTML>