If you use generic reporting tools, such as SAP Query and InfoSet Query, the source code is automatically generated using the Query Generator. The source code generated in this way is regulated by the generation logic of the Query Generator and query definition.
Using the Query Generator available in SAP Query, you can configure the query logic at the InfoSet level. This gives you more flexibility when you want to define queries to meet different requirements.
You can make the settings using a switch, which the Query Generator processes. General switches and infotype-specific switches can be used.
The Query Generator generates the source code automatically.
Switches are of the following types:
- General switches:
General switches are used to control the settings that are valid for the entire InfoSet.
- Infotype-specific switches:
Infotype-specific switches control the settings that are defined for each infotype.
General Switches
The following list contains examples of general switches and their descriptions:
General Switches
| General Switch | Description |
|---|---|
| BL_ALLOW DUP_LINES | Output identical (double) lines in the basic list |
| REPORT_CLASS | Set up the report category (PNP and PNPCE) |
| PROCESS_LOCKED_RECORDS | Process the locked data records (PNP and PNPCE) |
| PROC_PERNR_PARTIAL_AUT | Process persons for which only partial authorization is available (PNP and PNPCE) |
| PERSON_ONLY_ONCE | Process each person once only (PNPCE) |
Infotype-Specific Switches
The following list contains examples of infotype-specific switches along with their descriptions:
| Infotype-Specific Switch | Description |
|---|---|
| LAST_RECORD_ONLY | Process only the last data record |
| PROVIDE | Merge neighboring or overlapping data records |
| PROVIDE_FIELD | Select relevant fields for merging data records |
| PRIMARY_INFTY | Determine infotype relationship to primary infotype (infotype views) |
| TIME_DEPENDENCE | Determine time dependence |
| DATA_REQUIRED | Determine existence of data records required |
| SPLIT_DATA_REQUIRED | Determine existence of data records required in split period |
| NO_INDIRECT_EVALUATION | Specify indirectly reported wage types are not calculated |
| IGNORE_WAGE_TYPE_OPERA | Ignore operation indicators (for deduction wage types) |
| NO_DUPLICATE_LANGU | Determine data records to be output in one language only |
| CASE_SENSITIVE_SEL | Determine case-sensitive selection |
| ADD_FIELDS_SPLIT_DEP | Determine HR additional fields considered split-dependent |
| SPLIT_DEPENDENT_AF | Determine technical name of an HR additional field that is split-dependent |
| SPLIT_INDEPENDENT_AF | Determine technical name of an HR additional field that is split-independent |
For detailed information about the switches and how they are used, see the documentation for the Customizing activity Create InfoSets for HR. To access these Customizing activities, choose Personnel → Management → Human Resources Information System → HR Settings for SAP Query → Create InfoSets for HR.
- "You're going to work in two-person teams to discuss the following question using private chat".
- "I'll give you 5 minutes to work with your partner and then we'll summarize briefly as a group".
- sign participants to two-person teams.
- Remind participants about how to use private chat.
- Explain that the purpose of this activity is to discuss the question on the whiteboard or PPT slide.
- Debrief by asking several groups to answer the question and stop when groups start repeating what was expressed by other groups.
- Remind students to participate actively in the class discussion, noting information of interest in their Participant Handbook.
- Type the names of the groups on the whiteboard.
- During the full group debrief, capture the participants’ suggestions on the whiteboard for the immediate discussion and for later reference or distribution.
Example – General Switch
The REPORT_CLASS switch is used to define a report category that enables you to control the structure of the selection screen. This report category concept applies to the logical databases PNP and PNPCE. Each report that is based on either of the two logical databases can be assigned to a specific report category.
You maintain report categories in Customizingunder Personnel Management → Human Resources Information System → Reporting → Adjusting the Standard Selection Screen → Create Report Categories.
A default report category is assigned in the standard system according to the logical database on which the InfoSet is based. If the InfoSet is based on the logical database PNP, the report category ___X2001 is used. If this report category does not exist, the report category ___22002 is used. If the InfoSet is based on the logical database PNPCE, the report category QUEPNPCE is used.
Because PNP and PNPCE use different report categories, you must ensure that the specified report category is created for the logical database used in the infotype.
Note
- The REPORT_CLASS switch cannot be used for InfoSets that are based on databases other than the logical databases PNP and PNPCE.
- Because each query is a generated report, you can assign report categories to queries too.
- Ad Hoc Query does not use the data selection screen of the logical database to define the selection conditions. The specification of a report category in Ad Hoc Query has no obvious effect.
Examples of switches are as follows:
- *$HR$ [COMMON]
- *$HR$ REPORT_CLASS = ’0MYREPCL’
Example – Infotype-Specific Switch

Data does not always exist for all infotypes that are displayed in a query. By default, queries display initial values for persons or objects for which no data records exist. Alternatively, you can choose not to display persons or objects for which no data records exist. To do this, use the DATA_REQUIRED switch. If the switch is set, a person or object is displayed only if at least one data record exists in the evaluation period.
The DATA_REQUIRED switch can be set to any one of the following values:
- "X" = Only persons and objects that have at least one data record in the evaluation period are displayed.
- " "= This is the default value. All persons and objects that fulfill the selection conditions are displayed. If no data records exist for one of these persons or objects, the initial values are displayed.
Examples of the DATA_REQUIRED switch are as follows:
A similar switch, SPLIT_DATA_REQUIRED, allows even more control.
- *$HR$ [P0004]
- *$HR$ DATA_REQUIRED = ’X’
Use of Switches in InfoSets – Step 1
Enter the short text and choose Create. Then select the logical database PNPCE.
Use of Switches in InfoSets – Step 2
To make InfoSet specific settings, on the Change InfoSet <Name of InfoSet> screen, choose Goto → Code → Data.
Use of Switches in InfoSets – Step 3
In the right screen area (coding tab or coding section DATA), enter the switch and the value for the setting you require. See the documentation in Customizing under HR Settings for SAP Query → Create InfoSets for HR.
General switches have the following syntax:
- *$HR$ [COMMON]
- *$HR$ NAME_OF_SWITCH = "VALUE"
Infotype-specific switches (NNNN = infotype number) have the following syntax:
- Definition of an infotype
- *$HR$ [PNNNN]
- *$HR$ NAME_OF_SWITCH = "VALUE"
- Specification of different infotypes
- *$HR$ [P0000, P0004, P0006]
- Specification of an area
- *$HR$ [P0006 # P0009]
- Templates or placeholders (+ for one character, * for several characters)
- *$HR$ [P00++]
- *$HR$ [P*]
- *$HR$ [P0+1*]
Use of Switches in InfoSets – Step 4
Check the generated code for the query.
In the maintenance transaction for queries, choose Query → More Functions → Display Report Name.
In the ABAP editor, enter the <report name> → Display and find "HR-LOG".