Download - abap
SAP AG
CSU Chico
Introduction to Report Writer
Fall 1998
RW: Lecture 1
SAP AG
CSU Chico
Report Writer: Introduction
Copyright 1998- Gail CorbittCopyright 1998- Gail Corbitt
Contents of this file are for the exclusive use of the specialContents of this file are for the exclusive use of the special
MINS 298C class dealing with SAP software at CSU Chico MINS 298C class dealing with SAP software at CSU Chico
for the Fall 1998 semester. Any other use in either electronicfor the Fall 1998 semester. Any other use in either electronic
or hardcopy form is prohibited without the express writtenor hardcopy form is prohibited without the express written
permission of the author. This material is confidential. permission of the author. This material is confidential.
Do not share it with anyone not enrolled in the class. Do not share it with anyone not enrolled in the class.
Lecture #3: Report Writer 1Lecture #3: Report Writer 1
SAP AG
CSU Chico
Report Writer: Introduction
Objectives:
Define Sets
Develop Examples of Sets and How They Are Used
Build a Simple Report
SAP AG
CSU Chico
Report Writer: Introduction
Advantages of Report Writer over Report Painter
More Flexible
Can Control Level of Detail Better (RP Explode or Not)
Can Modify RP Reports with RW (not the reverse)
Can Put Any Kind of Data in Rows OR Columns (RP has particular things in Columns and other things in Rows)
Extra Functionality
More Levels of Reporting
More Ways to Label and Use Text
Disadvantage: Not as User Friendly
SAP AG
CSU Chico
Converting a Report Painter Report
Column Set:
1-C-IPActual
Plan
Var.
RowSet:
Selection Set
1996 1 to 12
REPORT PAINTER
Z-GJAHR Z-PERBL
400000
400100
400200
400300
Z-KSTAR
SAP AG
CSU Chico
Report Writer: Sets
Set is the RW Building Block
Set = A Group of Values Having at Least One Common Characteristics
Example: Cost Elements 420000, 422000, 431000 are all Wages
Sets are Dynamically Linked to Report Definitions
Set Types:
Basic
Single Dimension
Multi-Dimension
Data
SAP AG
CSU Chico
Report Writer: Sets
Definitions of Types:
Basic Set = A Group of Specific Values of a Single Characteristic, I.e. All Cost Elements for Wages, etc.
Single Dimension Set = A Group of Values Based on Only One Characteristic but it can be Broken Down Further, as in Cost Center Group or Cost Element Group
Multi-Dimension Set = A Group of Values Based on More Than One Characteristic, Products Sold in the US Through Retail Channel
Data Set = Key Figures or the Number Values You Want in a Report, such as Quantities, Dollars, etc.
SAP AG
CSU Chico
Report Writer: Sets
Components to Building Sets
Menu Path: Info systems --> Ad Hoc Reports --> Report Painter --> Report Writer --> Set --> Create, Change, display, Delete
Specify:
Set Definition
Header
Basic Entries
Additional Entries (optional special functions)
SAP AG
CSU Chico
Set Definition
: Set ID: Report Writer table: Set type: Field name
: Set text: Ambiguity check: Authorization check
: From value: To value
: SpecialReport Writerfunctions
Basic entriesBasic entries
HeaderHeaderinformationinformation
Additional Additional entriesentries
SetSet
SAP AG
CSU Chico
Report Writer: Sets
Set Definition:
Set ID: Up to 12 Character Name (Start with Z)
Link ID to Reporting Structure, I.e. CCSS, LIS, SIS, etc.
Define the Set Type
If Basic or Single Dimension Set you Name the Field from the Reporting Structure
SAP AG
CSU Chico
Report Writer: Sets
Basic Entries:
Varies with Set Type
Order That You Enter Things Matters
Defines Selection Criteria for Data
What to Retrieve from the Database
Based on View (Reporting Structure) and Library (Sub-view)
If Entries are Expressed as a Range of Values..
As a Row Set the Default in that the Interval is Discrete Values (Broken Down for Each Value)
As a Column Set the Default is in Aggregate
SAP AG
CSU Chico
OAS-Cost elementsOAS-Cost elements
Basic Sets: Example
Material costsMaterial costs
430000434000
420000422000431000
432000440000
Salaries Inc. costsWages
EnergyEnergyPersonnel costsPersonnel costs
SAP AG
CSU Chico
Basic Set: Header Entries
Set IDSet ID :: WagesWages
Field typeField type : Alphanumeric: Alphanumeric PredefinedPredefined Numeric Numeric Data-DictionaryData-Dictionary Character Character FormatFormat
Ambiguity check: Overlapping values allowed?Ambiguity check: Overlapping values allowed?
Authorization groupAuthorization group :: GRP1GRP1
TABLE TBRGTABLE TBRG
ObjectObject AuthorizationAuthorization
G_800_GSEG_800_GSE GRP1GRP1
Header
USERAuthorization
SAP AG
CSU Chico
Basic Set: Basic Entries
Report layout
420000 Direct labor costs 20.000,00421000 Indir. labor costs 15.000,00422000 Part-time salaries 9.500,00431000 Overtime pay 25.500,00
*Wages 70.000,00
420000 . . .422000420000 . . .422000 431000431000
431000431000
420000 . . .422000420000 . . .422000
GXX-WAGES
Basic
Entries Random
Order
SetSet . . .GXX-WAGES. . .GXX-WAGES WagesWagesFieldField . . .KSTAR. . .KSTAR Cost elementCost elementNo.No. From valueFrom value To valueTo value
001001 XXXXXXXXXX
002002 XXXXXXXXXX XXXXXXXXXX
003003 XXXXXXXXXX
`X` : Selection option for set lines that are to be`X` : Selection option for set lines that are to be processed (for example, deleted) processed (for example, deleted) togethertogether
SAP AG
CSU Chico
Components
Basic Set Components
Set IDSet ID :: GXX - WAGESGXX - WAGES
TableTable :: CCSSCCSS
Set typeSet type :: XX Basic setBasic set
Ref. setRef. set ::
Field nameField name ::(Basic or(Basic orsingle-dim. set)single-dim. set)
SelectionSelectionKSTARKSTAR
Table CCSSTable CCSS
Field nameField name DescriptionDescription ::VERSNVERSN VersionVersionGJAHRGJAHR Fiscal yearFiscal yearKSTARKSTAR Cost elementCost elementKOSTLKOSTL Cost centerCost center ::
SAP AG
CSU Chico
Report Writer: Sets
Single Dimension Sets
Can Define a Hierarchy of Values Within a Characteristic
Similar to Hierarchy in the Module. I.e. Co, SD, etc. depending on the Reporting Structure You Use
Each Node in the Hierarchy Represents a Total in the Report
SAP AG
CSU Chico
Single-Dimension Sets
OAS Cost elementsOAS Cost elements
Personnel costsPersonnel costs Material costsMaterial costs EnergyEnergy
WagesWages SalariesSalaries Inc. costsInc. costs
420000 430000 432000 : : :422000431000
SAP AG
CSU Chico
Single - Dimension SetSingle - Dimension Set
Single-Dimension Set: Hierarchy
SD
BB BB BB
SD B B
SD
B B B B
SD SD BB
SD BB
SD
B
SDB
SDSD
B B
B
SAP AG
CSU Chico
Single-Dimension Sets: Examples
OAS Structure: Organizing costOAS Structure: Organizing costelement sets in a hierarchyelement sets in a hierarchy
ExampleExample
Set: GXX-OAS-CELMSet: GXX-OAS-CELM = Personnel, material, energy and other cost element sets= Personnel, material, energy and other cost element setsSet: GXX-PERSONNLSet: GXX-PERSONNL = Personnel costs= Personnel costs
OAS cost elementsOAS cost elements
Material costsMaterial costs
Report Layout: Total Costs
Wages Salaries Inc. costs
420000 430000 432000421000 434000 440000422000431000
420000 Direct labor costs 20.000,00421000 Indir. labor costs 15.000,00422000 Part-time salaries 9.500,00431000 Overtime pay 25.500,00
** WagesWages 70.000,0070.000,00430000 Salary 85.000,00434000 Vacation pay 14.000,00
** SalariesSalaries 99.000,0099.000,00432000 Sick pay 8.500,00440000 Legal social exp. 10.500,00** Inc. costsInc. costs 19.000,0019.000,00** PERSONNEL 188.000,00
:*** TOTAL COSTS 3.255.570,00
Personnel costsPersonnel costs
SAP AG
CSU Chico
Single-Dimension Sets: Basic Entries
001 420000 - 422000
002 431000
Basic
Entries
Set ID : GXX-PERSONNL Field: KSTAR
Set text : Personnel
Display contentsDisplay contentsDisplay contentsDisplay contents
No.No. Set IDSet ID Set textSet text
001001 GXX-WAGESGXX-WAGES WagesWages
002002 GXX-SALARYGXX-SALARY SalariesSalaries
003003 GXX-INCIDENTGXX-INCIDENT Incid. costsIncid. costs
Set ID entriesSet ID entries
Double-clickDouble-click
SAP AG
CSU Chico
Report Writer: Sets
Multi-Dimension Sets
Uses Multiple Characteristics to Define Data Needed in the Report
Order Determines What is Selected from the Database (like a where clause)
Order Determines the Presentation Levels in the Report
Can Consist of Basic Sets, Single Dimension Sets and/or other Multi-Dimension Sets
If an Error Occurs (Report Runs but Output is not What you Want check the Order of this Type of Set)
SAP AG
CSU Chico
Defining Multi-Dimension Sets
Basic
Entries
Set ID : GXX-WAG-ADMIGXX-WAG-ADMI
Set type : X X Multi-Dimension Set
Header : Set text Wages / Admin.Wages / Admin.
Multi - Dimension SetMulti - Dimension Set
No.No. Set IDSet ID Set textSet text Field nameField name
001001 GXX-WAGESGXX-WAGES WagesWages KSTARKSTAR
002002 GXX-ADM-CSTGXX-ADM-CST Amin.Amin. KOSTLKOSTL
Set ID entriesSet ID entries
SAP AG
CSU Chico
BasicBasicSetSet
BasicBasicSetSet
BasicBasicSetSet
BasicBasicSetSet
BasicBasicSetSet
BasicBasicSetSet
BasicBasicSetSet
BasicBasicSetSet
Combination of Different Set TypesMulti-
DimensionSet
Actual/Plan/Periods
Single-DimensionSet (Period)
Year
Single-DimensionSet (Period)
First Half
Single-DimensionSet (Period)Second Half
Data SetData Set
Actual total&
Plan total
Period Period Period Period 001 004 007 010 002 005 008 011 003 006 009 012
SAP AG
CSU Chico
Report Writer: Sets
Data Sets
Similar to Pre-Defined Columns in Report Painter
Specify Key Figures (Types of Numeric Data, I.e. Dollars, Quantity, Units, etc.)
Names Starting with 100 are Supplied by SAP
Copy to Modify
F4 Gives you a List of These in SAP
Defines What Goes into the Report Cells
SAP AG
CSU Chico
Data Sets
GXX-ACT-PLAN
ISWKG
PSWKG
Database value fields
Actual costs total (CO currency)
Plan costs total (CO currency)
SAP AG
CSU Chico
Actual/Plan costs Salaries / Administration
ACTUAL TotalACTUAL Total PLAN TotalPLAN Total32003200 Personnel dept.Personnel dept. 50,000.0050,000.00 45,000.0045,000.0034003400 AccountingAccounting 60,000.0060,000.00 80,000.0080,000.0035003500 PurchasingPurchasing 40,000.0040,000.00 39,000.0039,000.0036003600 CafeteriaCafeteria 25,000.0025,000.00 24,000.0024,000.00
** SalarySalary 175,000.00175,000.00 18,000.0018,000.00
32003200 Personnel dept. Personnel dept. 20,000.0020,000.00 22,000.0022,000.0034003400 AccountingAccounting 15,000.0015,000.00 17,000.0017,000.0035003500 PurchasingPurchasing 10,000.0010,000.00 11,000.0011,000.0036003600 CafeteriaCafeteria 6,000.006,000.00 5,550.005,550.00
** Vacation payVacation pay 51,000.0051,000.00 55,550.0055,550.00
**** SalariesSalaries 226,000.00226,000.00 243,550.00243,550.00
Data Sets: Example Report
ISWKGISWKG PSWKGPSWKG
The example shows a reportwith a data set of thefollowing structure:
DATA SETDATA SET
SAP AG
CSU Chico
Defining Data Sets
Basic
entries
Set ID: GXX-ACT-PLAN Set type: XX Data set
Set text: Actual/Plan CostsActual/Plan Costs 30-character text description
Authorization group
No. Name in data set Set line text
001 001 ISWKG Actual costs
002 002 PSWKG Plan costs
: : :
Header
SAP AG
CSU Chico
Data Set Entries (1)Required columnsin report
Current year Current year CumulativeCumulativeTotal planTotal planVersion VariableVersion Variable
Current yearCurrent yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
Previous yearPrevious yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
SAP AG
CSU Chico
Data Set Entries (2)Required columnsin report
Current year Current year CumulativeCumulativeTotal planTotal planVersion VariableVersion Variable
Current yearCurrent yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
DDAAT T AAFFIIEELLD D
SWKG
DATA SET ENTRY
ZCY-PLAN-CUMZCY-PLAN-CUMZCY-PLAN-CUMZCY-PLAN-CUM
Previous yearPrevious yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
SAP AG
CSU Chico
Data Set Entries (3)Required columnsin report
Current year Current year CumulativeCumulativeTotal planTotal planVersion VariableVersion Variable
Current yearCurrent yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
DDAAT T AAFFIIEELLD D
SWKG
DATA SET ENTRY
ADDITIONAL SET
CY-PLCUM
ZCY-PLAN-CUMZCY-PLAN-CUMZCY-PLAN-CUMZCY-PLAN-CUM
Previous yearPrevious yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
SAP AG
CSU Chico
Data Set Entries (4)Required columnsin report
Current year CumulativeCumulativeTotal planTotal planVersion VariableVersion Variable
Current yearCurrent yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
DDAAT T AAFFIIEELLD D
SWKG
DATA SET ENTRY
ADDITIONAL SET
CY-PLCUM
CurYearCurYear &CYR
ZCY-PLAN-CUMZCY-PLAN-CUMZCY-PLAN-CUMZCY-PLAN-CUM
Previous yearPrevious yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
SAP AG
CSU Chico
Data Set Entries (5)Required columnsin report
Current year CumulativeTotal planTotal planVersion VariableVersion Variable
Current yearCurrent yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
DDAAT T AAFFIIEELLD D
SWKG
DATA SET ENTRY
ADDITIONAL SET
CY-PLCUM
CurYearCurYear &CYR
ZCY-PLAN-CUMZCY-PLAN-CUMZCY-PLAN-CUMZCY-PLAN-CUM
PercumPercum 1 ...... &PER
Previous yearPrevious yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
SAP AG
CSU Chico
Data Set Entries (6)Required columnsin report
Current year CumulativeTotal planVersion VariableVersion Variable
Current yearCurrent yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
DDAAT T AAFFIIEELLD D
SWKG
DATA SET ENTRY
ADDITIONAL SET
CY-PLCUM
CurYearCurYear &CYR
ZCY-PLAN-CUMZCY-PLAN-CUMZCY-PLAN-CUMZCY-PLAN-CUM
PercumPercum 1 ...... &PER
ValplnValpln 01
Previous yearPrevious yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
SAP AG
CSU Chico
Data Set Entries (7)Required columnsin report
Current year CumulativeTotal planVersion Variable
Current yearCurrent yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
DDAAT T AAFFIIEELLD D
SWKG
DATA SET ENTRY
ADDITIONAL SET
CY-PLCUM
CurYearCurYearFyear &CYR
CYR-PLAN-CUMCYR-PLAN-CUMCYR-PLAN-CUMCYR-PLAN-CUM
Perbl PercumPercum 1 ...... &PER
ValplnValplnValtyp 01Versn VarversVarvers &VERSPLN
MU
LTI-S
ET
DATA SET ENTRYDATA SET ENTRY
otherconditions
CYR-ACT-CUMCYR-ACT-CUMCYR-ACT-CUMCYR-ACT-CUM
ADDITIONAL SET
CY-ACTCUM
ZPYR-ACT-CUMZPYR-ACT-CUMZPYR-ACT-CUMZPYR-ACT-CUM
ADDITIONAL SETCY-ACTCUM
Previous yearPrevious yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
SAP AG
CSU Chico
Data Set Entries (8)Required columnsin report
Current year CumulativeTotal planVersion Variable
Current yearCurrent yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
DATA SET ENTRY
Data set
CYR-PYR-PLCUMCYR-PYR-PLCUM
ZCY-PLAN-CUMZCY-PLAN-CUMZCY-PLAN-CUMZCY-PLAN-CUM
DATA SET ENTRYDATA SET ENTRY
ZCY-ACT-CUMZCY-ACT-CUMZCY-ACT-CUMZCY-ACT-CUM ZPY-ACT-CUMZPY-ACT-CUMZPY-ACT-CUMZPY-ACT-CUM
Previous yearPrevious yearCumulativeCumulativeTotal actualTotal actualVersion 000Version 000
*D
001 ZCY-PLAN-CUM002 ZCY-ACT-CUM003 ZPY-ACT-CUM
LI XX
Predefined columns:Name Short description
x ISWKG Total actualx PSWKG Total plan. .....X ZCY-PLAN-CUM Current year plan cum. X ZCY-ACT-CUM Current year act. cum. X ZPY-ACT-CUM Prev. year act. cum.
SAP AG
CSU Chico
Report Writer: Sets - Exercise
Create Some Sets to do the Following:
Basic Set for Wages: Uses CCSS, KSTAR (field name), Values 420000-422000 and 431000
Basic Set for Salaries: Uses CCSS, KSTAR, Values: 430000 & 434000
Single Dimension Set for Personnel costs: Uses CCSS, KSTAR, and the 2 Basic Sets you created above.
In Order to Make Sure Your Names are Unique Use the Naming convention Zxxx-Name, where xxx is your intials and Name is like Wages, or Salaries, Etc.
Menu Path: Information Systems > Ad Hoc Reports >Report Painter > Report Writer > Set > Create
SAP AG
CSU Chico
Report Writer: Formulae
Formulae Belong to Sets (Basic or Data Sets only)
Data Used in Formulae are Referenced in single quotes by line number, I.e. ‘001’ - ‘002’ subtracts line 2 from line 1.
Operators are available (see handout)
SAP Delivered Names start with a 1
Your names = &+name (Makes the Formula a Variable)
You can activate and give it a Default Value
You can activate and assign a default by user through PID
SAP AG
CSU Chico
Defining Sets: Formulas
Complete SetComplete Set
Set: GXX-ACT-PLAN
No. ID in data set Line text
001 ISWKG ACTUAL Total002 PSWKG PLAN Total
003 = '001'- '002' Variance
Basic
Entries
Set : GXX-ACT-PLAN Set text: Actual/Plan/Var.
No. ID in data set Line text
001 ISWKG ACTUAL Total
002 PSWKG PLAN Total
003
Formula in line 003
'001' - '002'
Set lines
001 ISWKG
002 PSWKG
003 =
InsertInsertFormulaFormula
SAP AG
CSU Chico
Formula Variables: Example 1
MILLER
1. Current year?
2. Previous year?
Default valuesfrom system
Formula variable 1GJAHLJ: Systemexit that determines current fiscal year fromcontrolling area and fiscal year variant.
Formula variable 1GJAHVJ: Internal variable that determines previous year1GJAHVJ = '1GJAHLJ' - 1
SAP AG
CSU Chico
Formula Variables: Example 2
Salaries / AdministrationSalaries / Administration32003200 Personnel dept.Personnel dept. 50,000.0050,000.0034003400 AccountingAccounting 60,000.0060,000.0035003500 PurchasingPurchasing 40,000.0040,000.0036003600 CafeteriaCafeteria 25,000.0025,000.00
** SalarySalary 175,000.00175,000.00
32003200 Personnel dept. Personnel dept. 20,000.0020,000.0034003400 AccountingAccounting 15,000.0015,000.0035003500 PurchasingPurchasing 10,000.0010,000.0036003600 CafeteriaCafeteria 6,000.006,000.00
** Vacation payVacation pay 51,000.0051,000.00
**** SalariesSalaries 226,000.00226,000.00
1. Quarter ?2. Quarter ?3. Quarter ?4. Quarter ?
1. Quarter ?2. Quarter ?3. Quarter ?4. Quarter ?
Value variable ZQUART
Value variable ZQUART
Formula variables
ZQUPERV: 'ZQUART' * 3 - 2
ZQUPERB: 'ZQUART' * 3
Quarter XQuarter XPeriod ZZ to YY
SAP AG
CSU Chico
Variables in Report Writer
Increases Flexibility at Run Time
Defined Once Used Many Times
Example of Good Variables: Fiscal Year, Controlling Area, Period(s), Version(s), Cost Element Groups, Sales Region, Project Number, et.c
Type of Variables:
Value (a Specific Characteristic)
Set Variables
SAP AG
CSU Chico
Defining Set Variables
VariableField Cost center
Default setDescriptionVariable typeTable
Authorization group
VariableField Cost center
Default setDescriptionVariable typeTable
Authorization group
1KOSET
KOSTL
1-S-KOSTL-AL1-S-KOSTL-AL
Cost center groupCost center groupSetCCSS
SAP AG
CSU Chico
Set Variables 1
WAGES Act Plan
420000420000Personnel dept.AccountingPurchasingCafeteria
421000421000Personnel dept.AccountingPurchasingCafeteria
:
GXX-CELM-CSTGXX-CELM-CST
Set VariableSet Variable
- Personnel dept.- Accounting- Purchasing- Cafeteria
GXX-ADM-CSTGXX-ADM-CST&GXX-CEG&GXX-CEG
Selection:......Cost element group GXX-WAGESGXX-WAGES
Multi - Dimension SetMulti - Dimension Set
SAP AG
CSU Chico
Set Variables 2
Salaries Act Plan
430000430000Personnel dept.AccountingPurchasingCafeteria
434000434000Personnel dept.AccountingPurchasingCafeteria
:
GXX-CELM-CSTGXX-CELM-CST
Set VariableSet Variable
- Personnel dept.- Accounting- Purchasing- Cafeteria
GXX-ADM-CSTGXX-ADM-CST&GXX-CEG&GXX-CEG
Selection:......Cost element group GXX-WAGESGXX-WAGES
Multi - Dimension SetMulti - Dimension Set
GXX-SALARYGXX-SALARY