Using InfoSet Switches

Objective

After completing this lesson, you will be able to outline InfoSet switches processed by the Query Generator

InfoSet Switches

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 SwitchDescription
BL_ALLOW DUP_LINESOutput identical (double) lines in the basic list
REPORT_CLASSSet up the report category (PNP and PNPCE)
PROCESS_LOCKED_RECORDSProcess the locked data records (PNP and PNPCE)
PROC_PERNR_PARTIAL_AUTProcess persons for which only partial authorization is available (PNP and PNPCE)
PERSON_ONLY_ONCEProcess each person once only (PNPCE)

Infotype-Specific Switches

The following list contains examples of infotype-specific switches along with their descriptions:

Infotype-Specific SwitchDescription
LAST_RECORD_ONLYProcess only the last data record
PROVIDEMerge neighboring or overlapping data records
PROVIDE_FIELDSelect relevant fields for merging data records
PRIMARY_INFTYDetermine infotype relationship to primary infotype (infotype views)
TIME_DEPENDENCEDetermine time dependence
DATA_REQUIREDDetermine existence of data records required
SPLIT_DATA_REQUIREDDetermine existence of data records required in split period
NO_INDIRECT_EVALUATIONSpecify indirectly reported wage types are not calculated
IGNORE_WAGE_TYPE_OPERAIgnore operation indicators (for deduction wage types)
NO_DUPLICATE_LANGUDetermine data records to be output in one language only
CASE_SENSITIVE_SELDetermine case-sensitive selection
ADD_FIELDS_SPLIT_DEPDetermine HR additional fields considered split-dependent
SPLIT_DEPENDENT_AFDetermine technical name of an HR additional field that is split-dependent
SPLIT_INDEPENDENT_AFDetermine 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 PersonnelManagementHuman Resources Information SystemHR Settings for SAP QueryCreate 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 ManagementHuman Resources Information SystemReportingAdjusting the Standard Selection ScreenCreate 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 GotoCodeData.

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 QueryCreate 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 QueryMore FunctionsDisplay Report Name.

In the ABAP editor, enter the <report name> → Display and find "HR-LOG".

Additional Reporting Fields

The term additional fields covers all the fields that do not exist in the database table of the corresponding infotype, but that are available for reporting purposes.

The additional fields can be grouped under the following categories:

  • Standard additional fields

    These fields are additional fields that are required by most customers. They are available in the standard system when InfoSets are created.

  • Additional fields defined by customers

    These fields are defined by customers to meet company-specific requirements. They can be created in Customizing for HR or when an InfoSet is created. If you create these fields in Customizing (under HR Settings for SAPQueryAdditional Information about InfoSet MaintenanceDefine Additional Fields), they are always available when you create InfoSets. If you create them in an InfoSet, they are only available in that particular InfoSet.

    Note

    Like additional fields, local fields are used to meet specific requirements. They are defined within a query and are available only for that query, such as SAP Query.

InfoSet Log

To use Ad Hoc Query to receive logs about the execution of queries, you must link an InfoSet to logging. You can do this in the maintenance transaction SQ02 in the Extras menu.

If you then create and execute a query using this InfoSet (the query does not have to be saved), the system saves information such as the user and entries on the selection screen (table AQPROT). You can report on this information using the data browser, existing queries from user group /SAPQUERY/QUERY_LOGGING (in the user group SAPQuery/SQ in the global work area), or with your own queries.

You can delete the logs in maintenance transaction SQ02 under ExtrasManage logs.

You access a selection screen on which you can restrict the logs that are deleted. For example, you can delete all the logs for a user.

Query Logs

Logs are optional. You can log the queries that have been started using Ad Hoc Query or InfoSet Query.

The following fields are logged:

  • Query area
  • InfoSet
  • User
  • Date and Time
  • Selection Fields
  • Selection Values
  • Selection Options
  • Output Fields

You can switch the log function on and off. You can delete any logs that you no longer require. Furthermore, you can add your own log function using the Business Add-In AQ_QUERY_PROT. You can also analyze the logs with InfoSet Query or Data Browser.

For more information about logs, in Customizing, choose SAP NetWeaverApplication ServerSAP QueryLogging.