Chapter 13. Creating Advanced Statistics Lists with the SAP Query Tool


Chapter 13. Creating Advanced Statistics Lists with the SAP Query Tool

In this chapter

Creating a Basic List for Reference by Using the SAP Query Tool 170

Creating an Advanced Statistics List by Using the SAP Query Tool 172

Chapter 12, "Creating Simple Statistics Lists with the SAP Query Tool," covers how to create very basic statistical lists by using the SAP Query tool. This chapter takes that information to the next level, explaining how to create advanced statistical lists, which combine the functionality of calculated fields and statistical lists. If you are not comfortable with creating a basic list or a basic statistical list, you should practice the skills described in earlier chapters before proceeding.

Very often in report writing, it is most meaningful to view summarized data to make business decisions. This chapter uses the SAP IDES flight scheduling system as an example. Line item details, such as a basic list report displaying a list of scheduled flights for each day, are helpful for planning and being prepared for the day's schedule. However, sometimes it is helpful to analyze the average number of flights by each day of the week or to look at how many flights one airline had in each month of the year compared to another airline. Advanced statistics are ideal for this type of summarized data.

The following sections show the syntax to use within calculated fields and also show how you can use calculated fields in conjunction with statistics to provide a summarized statistics report. You will begin by creating a basic list report (as discussed in Chapter 3, "Creating Basic Reports with the SAP Query Tool)." This report will serve as detail data and will be used for reference only. Next, you will create an advanced statistics report that summarizes the detail data in four quarterly views, using calculated fields plus statistics.



Creating a Basic List for Reference by Using the SAP Query Tool

To create a basic list report by using the SAP Query tool, you follow these steps:

1.

Navigate to the Maintain Queries Initial screen by using transaction code /nSQ01.

2.

Ensure that you are in the standard query area by selecting Environment, Query Areas and then choosing Standard Area (Client-Specific).

3.

In the Query field, enter DLS_Exercise_13 (where DLS is your initials) as the name for the query you are creating, and then click the Create button.

4.

When the InfoSets of User Group ZTEST window appears, listing all the available InfoSets (that is, data sources) for your Query Group, select the ZTEST InfoSet and then click Enter. The Create Query Title Format screen appears, allowing you to save the basic formatting specifications for your query, including the name (title) and any notes you want to store for the query. The only required field is Title (for example, Sample Advanced Statistics Report). Click the Save button on the toolbar.

5.

To navigate to the Select Field Groups screen, click the Next Screen button on the Application toolbar.

6.

When the Select Field Groups screen appears, listing all the field groups available in your InfoSet, place a check mark next to each field group whose fields you want to include in your report. (In my example, I selected all three.) Click the Next Screen button on the Application toolbar.

7.

When the Select Fields screen appears, giving you a list of all the available fields within the selected field groups, place a check mark next to each field that you want to include in your report. You can use the Page Up and Page Down buttons to navigate between all the fields. For this example, include the following fields in the following order:

  • Flight Date

  • Airline Carrier ID

  • Departure Time

  • Arrival Time

  • Airfare

  • Text: Flight Class

  • Airport of Departure

  • Destination Airport

  • Arrival City

8.

Click the Next Screen button on the Application toolbar to continue. The Selections Screen appears, listing all the fields you selected on the Select Fields screen, giving you the opportunity to add fields to your report's selection screen.

9.

You can add to your report's selection screen any fields you want by placing a check mark next to each field. (In my example, I did not add any.)

10.

Click the Basic List button on the Application toolbar to create a basic list in the SAP Query tool. The Basic List Line Structure screen appears, showing a list of the fields you selected to include in your report.

11.

For each field, specify the line and sequence number as you want them to appear on your report (see Figure 13.1). You can also use the Basic List Line Structure screen to indicate sort order, totals, and counts, if needed.

Figure 13.1. Unlike the Statistics screen, the Basic List Line Structure screen requires only line and sequence numbers.


12.

Proceed directly to the report's selection screen by pressing F8. The report's selection screen gives you an opportunity to specify any criteria for the output of your report.

13.

Press F8 to execute your finished report. Your report output should look similar to that in Figure 13.2, but keep in mind that the actual values vary by organization.

Figure 13.2. This report displays all the line item details of scheduled flights in your IDES test database.