Formatting Report Output

Objective

After completing this lesson, you will be able to create reports with enhanced reporting output results

Data Output

SAP includes an Ad Hoc Query screen that allows you to define and output data as per your requirements.

The Ad Hoc Query screen provides the SAP List Viewer that helps you to create the required reports. The lower part of the Ad Hoc Query screen contains a preview of output in the SAP List Viewer. It enables you to use sample data to gain an impression of the appearance of the output list.

The Refresh function enables you to replace the sample data with the real data. The data is output to the SAP List Viewer on the Ad Hoc Query screen. This means that the definition and result of a query are both included in a single screen.

After you have output the real data, you can use the following SAP List Viewer functions on the Ad Hoc Query screen:

  • Search for entries
  • Calculate totals and subtotals
  • Display the output list in Excel and then use all Excel functions
  • Use the SAP List Viewer export and display options

Note

For more information about the functions of the SAP List Viewer, refer to the SAP Library. To access the SAP Library, go to Getting StartedWorking with Tools and FunctionsWorking with ListsSap List Viewer for Sap GUI.

Definition and Formatting of Output

The output preview displays the layout of the output list before data is finally output. It also enables you to format the output list.

You can perform the following tasks once the output list is formatted:

The context menu for ranked lists and statistics enables you to determine whether additional columns, such as mean value, share in %, and total number, are output.

  • Sort the list by one or more columns.
  • Calculate totals for numeric columns in basic lists and calculate subtotals by using specific criteria (non-numeric columns).
  • Delete all output fields at once.
  • Initialize formatting.
  • Determine the position of the currency column in basic lists or hide it completely.

Types of Output

You can select the type of output, which determines how data is displayed when output. You can choose from various types of list output and export functions. For example, you can output data for spreadsheets. In this case, a list is not output to the screen. Instead, the report is copied to a file that you can then edit by using a spreadsheet program.

Output and Export Settings

To specify various output and export settings in a single dialog box, choose Edit → Settings.

You can specify the following settings:

  • Select the type of output list, such as basic list, ranked list, or statistics.
  • Start a query through the standard selection screen of the logical database.
  • Use selection conditions for output.
  • Reference the currency and counter.
  • Export to Crystal Reports.
  • Specify field selection as a value or a text.

You can use the following tab pages to specify various output and export settings:

Output tab page:
On the Output tab page, you can select the type of output list (such as basic list, statistics, and ranked list) and the type of output (such as standard list, word processing, and spreadsheet). You can also determine whether the query is started through a selection screen. Ad Hoc Query uses the SAP List Viewer as the standard type of output.
Stats/Ranked List tab page:
On the Stats/ranked list tab page, you can determine the reference currency that is used to translate currency fields and the reference unit that is used to translate units of measurement. You can also specify the number of lines included in a ranked list.
Crystal Reports tab page:
On the Crystal Reports tab page, you can determine how data is exported to Crystal Reports if Crystal Reports is started directly from InfoSet Query. You can also create a Crystal Report each time data is exported. Alternatively, you can export data to an existing Crystal Report on your local PC.
Default: Val/Text tab page:
On the Default: Val/Text tab page, you can determine whether the value or text is used when a field is selected by drag and drop or by checkbox. You can override these defaults by using the context menu to select a field.

Output List

Output lists are of the following types:

  • Basic list
  • Statistics
  • Ranked list

While basic lists enable you to output detailed overviews, statistics and ranked lists enable you to output aggregated data.

Output List – Examples

The following table shows examples of the different types of output lists:

Output List

Output ListExample
Basic listYou want to output an overview of monthly salaries received by employees in an organizational unit. To do so, you use the required organizational unit as a selection criterion and output the name and monthly salary. You select basic list as your output type. When the output is defined in this way, the currency field is output automatically.
StatisticsInstead of an overview of individual salaries, you want to output monthly salary totals for each organizational unit. In this case, you use the required organizational units as selection criteria, and the organizational unit and monthly salary as output fields. You select statistics as your output type.

The total of monthly salaries is output for each organizational unit. The number of values included in the total is output if you have defined output accordingly. A totals row is also output for each statistic. In this example, it contains the total of monthly salaries, and the total number of values included.

Ranked listYou want to determine the investment types that are most frequently selected as savings plans at your enterprise. To do so, you select all of the employees at your enterprise, and ranked list as your type of output list. You use the investment type as the only output field.

The output list contains the investment types, which are sorted by the number of employees who selected the investment types. The number of rows output in ranked lists is limited. The rank and number columns are output automatically.

Restriction of the Reporting Set

You often require reports for a specific set of objects, such as the employees assigned to an organizational unit or a group of persons who meet certain conditions. If you do not restrict the reporting set, selections are performed for all of the objects of an object type that are stored in the system. You can include only the required set of objects in your reports by restricting the reporting set as appropriate.

You can use one of the following restrictions for sets of persons:

  • The current hit list that you obtained by making a specific selection
  • A set of persons that you selected by using the organizational structure
  • A set of persons that you determined by using set operations

You can define further restrictions for the reporting set of persons. For more information, access Customizing for the Human Resources Information System and read the section on Selection IDs.

Set Operations

The Set Operations tab page enables you to use hit lists from more than one selection to perform set operations.

A set operation involves the following steps:

  1. Make a selection.
  2. Copy the hit list to set A.
  3. Make a second selection.
  4. Copy the second hit list to set B.

You can then perform the following set operations:

  • Create intersections
  • Create unions
  • Add sets
  • Subtract sets

The resulting set can be used for the following purposes:

  • For further set operations
  • As a precondition for further selections
  • As a hit list, and, therefore, as the basis for data output

Examples of how set operations can be used are as follows:

  • You can make negative selections. For example, if you want to find employees for whom a specific infotype record, such as temporary residence, does not exist, you need to perform set operations.
  • You can make combinations of person sets that have been selected by using different selection criteria, and for whom data must be output in a joint list.

Personnel Planning

You can use data from personnel planning as selection fields to define various reports.

You can now use the infotypes of related objects as selection and output fields for persons and personnel planning objects, for example, to find persons with specific qualifications. The prerequisite for this is an existing InfoSet based on logical database PNP or PNPCE (HR master data). In this example, it would also need the added Object Type Qualification Fulfils to give you the requisite data.

Reporting on Data from Personnel Planning

With the use of an InfoSet specially created for selecting a specific object type, such as courses (based on PCH), you can select personnel planning objects and report on related objects. ​

Create a Report by Copying the Reporting Set Hit List

Business Example

As part of your job, you need to create special reports for specific employees of a personnel area. For this reason, you must know how to define these reports by copying the Reporting Set Hit List.

Create a report by copying the hit list so that you can report only on employees in personnel areaCABB Hamburg. The query must display the following data in the specified order:

  • Personnel number
  • Last name
  • First name
  • Nationality
  • Age of employee

Hint

  • Work in the Standard area (client-specific) in your user group S4HR58## for this exercise.
  • Use InfoSet PA_## unless instructed otherwise. Use today’s date as the reporting period unless instructed otherwise.

Steps

  1. Select all employees from personnel areaCABB. How many employees does this include?

    1. Extend the query GR##_AHQ_2 as follows:

      On the SAP Easy Access screen, choose Human Resources → Information System → Reporting Tools → Ad Hoc Query.

    2. To open an existing query, choose QueryOpen.

      In the Open Query dialog box, choose theGR##_AHQ_2 query and then choose Continue.

      1. In the Personal Data field group, deselect Year of Birth as a selection field and deselect Number of Children as selection and output fields.
      2. In the Organizational Assignment field group, deselect Personnel Area as an output field and select the Personnel Area field as a selection field
      3. In the Personal Data field group, select the Nationality and Age of Employee as output fields.
      4. In the Value field for Personnel Area enter CABB and choose the Hit list pushbutton. In the neighboring field, the number of selected persons is displayed.

  2. For performance reasons, use this set of persons as the reporting set. From this group of persons, select all employees whose nationality is German (DE) or American (US). How many employees does this include?

    1. To use the selected number of persons as the reporting set, choose No. of hits in the Reporting set area.

    2. In the Personal Data field group, select Nationality as a selection field.

    3. Access the Multiple selection screen for the Nationality selection field and enter the values, DE and US on the Select Single Values tab page and choose Copy.

    4. Choose the Hit list pushbutton and in the neighboring field, the number of selected persons is displayed.

  3. Start Output and sort the output list according to nationality.

    1. Choose the Output pushbutton.

    2. In the output list, select the Nationality column.

    3. Choose the Sort in Ascending Order or Sort in Descending Order pushbutton.

  4. Return to the InfoSet Query (Query: GR##_AHQ_2) screen and change the sequence of columns in the output preview as follows:

    • Age of employee
    • Nationality
    • Last name
    • First name
    • Personnel number
    1. Go back to the InfoSet Query (Query: GR##_AHQ_2) screen.

    2. Change the sequence of columns in the output preview by choosing one column at a time and using drag and drop to drag the column to the desired position.

  5. Use the outputpreview to sort the list according to Nationality (first sorting criterion) and Age of employee (second sorting criterion). Choose Spreadsheet (MS Excel) as the output form and then choose Standard List. Start the output and note the differences.

    1. To select a line, click in any row in the output preview.

    2. Choose the Sort in Ascending Order pushbutton. A dialog box is displayed in which you can choose all fields from the selection fields (= all selected output fields) that you want to use to sort the output list.

    3. Select the sorting fields you want and choose Add sort criterion (left arrow). Select the relevant field option to determine whether each field is to be sorted in ascending or descending order. Choose Transfer.

    4. Choose EditSettings.

    5. Select Spreadsheet as the Type of output and press Enter. To start the output, choose Output. In answer to the next two queries, enter Table and then Microsoft Excel.

    6. Repeat this procedure for the standard list output form.

  6. Save this query under the name GR##_AHQ_8.

    1. Return to the InfoSet Query (Query Group S4HR58##) screen and choose QuerySave As. On the Save Query screen, enter GR##AHQ8 in the Name and Title fields and choose Continue. Remain on this screen.

Create a Report with Set Operations

Business Example

As part of your job, you need to create sets of objects for which data must be output. For this reason, you must know how to create a report with set operations.

Steps

  1. Use set operations to output all employees in the CABBpersonnel area who do not have a temporary residence. Choose EditSettings and on the Output tab, check that the Selection Conditions indicator is not set.

    Note

    Choose output fields of your choice (such as Last Name, First Name, City, and Address Record Type). Save this query under the name GR##_AHQ_9.
    1. From the InfoSet Query (Query: GR##_AHQ_8) screen, choose Query -> New.

    2. In the Create New Query – InfoSet Selection screen, theWork area and User group fields default. Choose the InfoSet PA_## and choose Continue.

    3. Choose ExtrasShow set operations.

    4. Choose EditSettingsand choose the Output tab. Make sure that Use Selection Conditions is not selected.

    5. In the Field Group/fields section, open the Organizational Assignment field group and select Personnel Area as a selection field. In the Value field for the Personnel Area field name, enter CABB.

    6. In the Field Group /fields section, open the Personal Data field group and select Last Name and First Name as output fields.

    7. Choose the Hit list pushbutton.

    8. Choose Store hits in Set A (the first blank pushbutton). This copies the selected employees to Set A.

    9. In the Addresses field group, select Address Record Type as a selection field. In the Value field for the Address Record Type field name, enter 2 (address record type 2 indicates temporary residence).

    10. Choose the Hit list pushbutton.

    11. Choose Store hits in Set B (the second blank pushbutton). This copies all the employees in personnel area CABB who have a temporary residence to Set B.

    12. On the InfoSet Query PA_## screen, choose the Set operations tab. Sets A and B are both displayed.

    13. Select Set A minus set B, and choose, Perform Operation.

      The system displays all of the persons who belong to the CABB personnel area and do not have a temporary residence. The set of persons is displayed in the Results Set field. You may have to scroll down to see this.

    14. Select in hit list and choose Copy resulting set.

    15. Switch to the Selection tab.

      The hit list now only lists persons who do not have a temporary residence.

    16. Return to the InfoSet Query (Query Group S4HR58##) screen and choose QuerySave As. On the Save Query screen, enter GR##AHQ9 in the Name and Title fields and choose Continue. Remain on this screen.

Generate a Standard Report Using Ad Hoc Query

Business Example

As part of your job, you need to create special reports for HR master data because your requirements are not met by the standard reports. For this reason, you must know how to define these reports by using Ad Hoc Query.

Steps

  1. Use Ad Hoc Query to start the Employee List standard report (RPLMIT00) for all of the employees in either the CABBpersonnel area. Generate the employee list using the query GR##_AHQ_9.

    1. In the Field group/fields section, open the Organizational Assignment field group and select Personnel Area as a selection field.

    2. In the Value field for the Personnel Area field name, enter CABB.

    3. In the Field group/fields section, open the Addresses field group and deselect Address Record Type as a selection field

    4. Choose the Hit list pushbutton.

    5. Choose Go toStart report. In the Specify Report screen, in the Report field, enter RPLMIT00 and select Start via selection screen.

    6. Choose Continue. This takes you to the Employee List selection screen for the report. Choose Execute. There is no need to save this query.

    7. Return to the SAP Easy Access screen.​