Working on Your Existing SAP Queries


Now that you have learned how easy it is to create queries, copy them, and delete them, you need some real-world practice with editing and making changes to a query that already exists. Here is your opportunity to practice receiving report requests, performing maintenance, and editing them.

As your first exercise, create an SAP query from scratch and name it DLS_Query_03 (replacing DLS with your initials). The query should contain the following output: flight class, airline carrier ID, arrival city, maximum capacity, plane type, and airfare. Your finished output should be similar to what is shown in Figure 4.4.

Figure 4.4. Your report output will vary from what is shown here, based on your system's data, but the column format should appear the same.


Navigating Through an Existing SAP Query

After a query is created, quite often you need to return to it and make modifications. You have a couple options for editing existing queries and the related navigation:

  • You can navigate to the main screen of the SAP Query tool by using transaction code SQ01 and select from the list the query you want to copy (or type the query's name in the Query box at the top of the screen).

  • You can click the Change button to open your existing SAP query for editing. You are then presented with the first of the five basic screens of the SAP Query tool.

  • You can navigate between the screens of the SAP Query tool by using the directional arrows at the top left of the screen and by clicking the Basic List button on the Application toolbar to get to the last screen.

  • You can navigate between the five basic screens of the SAP Query tool by using menu paths. From any screen in the SAP Query tool, you can select Goto, Field Selection, and then select one of the first four screens to jump directly to it. You can access the last screen, the Basic List screen, by selecting Goto, Basic List, Structure.

Modifying an Existing Query: Adding Fields

Now that you have mastered navigating an existing query, you can move on to the next exercise: Modify the SAP query you created in the preceding exercise (refer to Figure 4.4) by implementing the following changes: Add a Weight of Luggage field between the Plane Type and Airfare fields. Also add the Flight Date and Destination Airport fields at the end of the report. Your finished output should appear similar to Figure 4.5.

Figure 4.5. Your revised report output will vary from what is shown here, based on your system's data.


Names of Fields in SAP

You may have noticed the field I have been referencing called Airfare (see Figure 4.6, which has a column heading of Flgtprice, and Figure 4.7). In most cases within SAP logical databases, the field name (as it appears within query tool creation screens) and the column header (as it appears in the finished report output) are the same. However, in the SAP Flight Scheduling System logical database, it is different for this particular field and may cause confusion. Be aware of these types of differences. If you want to alter a column heading for a field, you can do so by accessing the InfoSet as described in Chapter 2, "One-Time Configuration for Query Tool Use," in the section "Changing the Name of a Field or Column Header."


Helpful Hint

Recall from Chapter 3 that it is a best business practice to list your sequence of fields on the Basic List screen in increments (refer to Figure 3.13 in Chapter 3). That way, if you need to modify the report output, add a field, or delete a field, you do not need to renumber the entire sequence in the report. A popular way to do this is to use increments of 5.


Modifying an Existing Query: Removing Fields and Modifying the Sort

Now that you have finished editing your query, you can move on to your next exercise: Modify your query by removing the output of the Flight Class, Airline Carrier ID, and Arrival City fields, but continue to indicate that you want to sort on the Flight Class field (see Figure 4.6). Your finished output should look similar to what is shown in Figure 4.7.

Figure 4.6. You use the Basic List screen of the SAP Query tool to define the report output.


Figure 4.7. My sample report output when displayed in the SAP List Viewer auto-sizes each column to fit its contents.


To test all the skills you have learned in this chapter, you can try one final exercise: Make a copy of your existing SAP query and name it DLS_Query_04 (replacing DLS with your initials). Change the title of the query on the first screen of the SAP Query tool to reflect that it is SAP Query 4. In this copied version, add the following fields: Text:Maximum Capacity (as the first field in the report output), Text:Flight Class (to the right of the Flight Date field), and Smoker and Text:Smoker (as the last two fields in the report). Add totals to appear in the report for the Maximum Capacity and Weight of Luggage fields. Your finished output should look similar to what is shown in Figure 4.8.

Figure 4.8. In this example, some of my column data is blank; this will vary based on what is stored in the database.





SAP Query Reporting
SAP Query Reporting
ISBN: 0672329026
EAN: 2147483647
Year: 2006
Pages: 161

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net