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 QueryAfter 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:
Modifying an Existing Query: Adding FieldsNow 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.
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 SortNow 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. |