Creating a Basic List Query by Using the SAP Query Tool
To create a basic list query by using the SAP Query tool, follow these steps:
1. Log in to your SAP client where your query reports will be created. (Best practice dictates that they be maintained in your live Production client.)
2. Navigate to the Maintain Queries Initial screen by using the transaction code /nSQ01. Beginning with R/3 release 4.6A, SAP offers a graphical version of the SAP Query tool, called the Graphical Query Painter; if you have not used the SAP Query tool, the Graphical Query Painter is set as your default. To turn off the Graphical Query Painter and learn to create easy step-by-step reports by using the SAP Query tool, select Settings, Settings and then deselect the Graphical Query Painter check box.
3. The title bar lists the query group you are currently in. For example, your title bar might read Query from User Group ZTEST: Initial Screen. If you are assigned to multiple query groups, press F7 to see a list of all of them.
4. As discussed in Chapter 1, "Getting Started with the SAP R/3 Query Reporting Tools," it is recommended that you create your queries in the standard query area. Ensure that you are in the standard query area by selecting Environment, Query Areas and then selecting Standard Area.
5. In the Query field, type DLS_QUERY_01 where DLS is your initials) as the name for the query you are creating, and then click the Create button (see Figure 3.1).

6. The InfoSets of User Group ZTEST window appears, listing all the available InfoSets (that is, data sources) for your query group. Because you created only one (in my example, I called it ZTEST), in Chapter 2, "One-Time Configuration for Query Tool Use," it will be the only one listed. Select the InfoSet you created (ZTEST, in my example) and then click the green check mark button.
7. The Create Query Title Format screen appears. This screen allows 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 the Title (long report description). For this example, fill in only the Title field, as shown in Figure 3.2, and then click Save. (For my example, I used the title (DLS) SAP Query Exercise #01.)

8. Navigate to the next screen in the SAP query creation process by selecting the Next Screen (white navigational arrow) button from the Application toolbar. (You can use the navigational arrows to navigate between the different screens of the SAP Query tool.) The Select Field Group screen appears, listing all the Field groups available within your InfoSet. Figure 3.3 shows this screen with the field groups Flight Schedule [SPFLI], Flight Demo Table [SFLIGHT], and Flight Booking [SBOOK] listed.

9. Place a check mark next to each field group from which you want to include fields in your report. Navigate to the next screen in the SAP query creation process by selecting the Next Screen (white navigational arrow) button on the Application toolbar. The Select Field screen appears, showing a list of all the available fields in the selected field groups.
10. 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 keys to navigate between all the fields (see Figure 3.4). Select the Next Screen (white navigational arrow) button from the Application toolbar to open the Selections screen, which lists all the fields you have selected.

Figure 3.4. All the fields listed in the field groups at the top right of the InfoSet screen during configuration are listed here.
11. If desired, add any of the fields to the selection screen that will be presented when you execute your report. You can add a field to the Selections screen by placing a check mark next to each one (see Figure 3.5).

Figure 3.5. Having fields available on the report's selection screen gives you the ability to specify your report output upon execution.
12. Click the Basic List button from the Application toolbar to create an SAP basic list query. The Basic List Line Structure screen appears, showing a list of the fields you selected to include in your report.
13. For each field, specify the line and sequence number as you want them to appear on your report. Also use this screen to indicate sort order, totals, and counts, if needed. Start by entering the line and sequence numbers, like the ones shown in Figure 3.6.

Figure 3.6. Basic output options are defined on the SAP Query tool Basic List Line Structure screen.
Note
You can use Figure 3.6 as follows:
- Line column The values in this column correspond to the line numbers the fields will appear on in the report.
- Sequence column The numbers in this column determine the order of the fields for the line.
- Sort column This column dictates the order in which the data will be sorted.
- Line Structure box After you click the Save button, a preview of the format appears in the Line Structure box at the bottom of the screen.
14. For this example, proceed directly to the report by pressing F8, which causes the report to execute.
15. As with almost all other reports in SAP, when you execute this report, you see the report's selection screen. Specify any criteria for the output of your report. Notice that any fields indicated on the Selections screen are included on your selection screen, under the heading Program Selections (see Figure 3.7).
Figure 3.7. Selection screens enable you to further specify
output.
16. Select the F8 Execute button on your Application toolbar (it looks like a clock) to display your finished report. Your report output appears; it should look similar to what is shown in Figure 3.8. (Keep in mind that the actual values vary by organization: The output of the report corresponds to the specification entered on the Basic List Line Structure screen.)
Figure 3.8. In SAP 4.6 and higher, by default, your report displays in the SAP List Viewer.
Reviewing the Options on Each of the Five Basic Screens
The Title, Format Screen
The Title, Format screen, shown in Figure 3.9, is where you insert the basic data about your report, including its title and the format in which you want it displayed. The Title, Format screen stores the basic report processing options for your report. For organizational purposes, it is a good idea to enter the name of the user who created the report in the Notes section of this screen. The following sections describe the options available on this screen.
The Title, Format screen, shown in Figure 3.9, is where you insert the basic data about your report, including its title and the format in which you want it displayed. The Title, Format screen stores the basic report processing options for your report. For organizational purposes, it is a good idea to enter the name of the user who created the report in the Notes section of this screen. The following sections describe the options available on this screen.
Select Field Group Screen
In the Select Field Group screen, shown in Figure 3.10, a list of all the available field groups is populated during the creation of the InfoSet. (See Chapter 2 for more information.) This example has only three field groups; however, some logical databases contain hundreds. You place a check mark next to any field group that contains fields you want to include in your SAP query.
Figure 3.10. All the field groups listed at the top right of your InfoSet screen during configuration of the InfoSet are listed on this screen.
The Select Field Screen
In the Select Field screen, shown in Figure 3.11, a list of all the available field groups populated during the creation of the InfoSet is expanded to display all the fields contained within them. You place a check mark next to any field you want to include in your SAP query.
Figure 3.11. All the fields listed in the field groups at the top right of your InfoSet screen during configuration are listed here. This screen is also used for advanced functions covered later in this book.
The Selections Screen
In the Selections screen, shown in Figure 3.12, a list of all the previously selected fields appears. You place a check mark next to any field that you want to include on the Selections screen that appears upon report execution. This gives you the option to specify particular data.

Figure 3.12. Having fields available on your report's selection screen gives you the ability to specify your report output by varying your input prior to report execution.
For example, in Figure 3.12, I selected that I wanted the Airfare, Maximum Capacity, and Weight of Luggage fields to appear on my report's Selections screen. This means that when I execute my report and see the Selections screen, those three fields will be listed there, under the heading Program Selections. Having them there allows me to run the report based on specific airfares, maximum capacity, or weight of luggage. (For example, I could run a report that contains a list of flights between $50 and $200.)
The Basic List Line Structure Screen
By default, only the first few selected fields of your report appear on the Basic List Line Structure screen, shown in Figure 3.13. They are all there, but with the default view, they are not all visible. You can use the Page Up and Page Down buttons on the right side of the screen to navigate between them, or you can select the Without Explanation button (at the bottom left of the screen) to view more fields on a single screen. The Basic List Line Structure screen lists all the fields you want to include in your output. You can have fields listed here for sorting purposes but not included in the output by simply leaving the Line and Sequence fields blank.
ไม่มีความคิดเห็น:
แสดงความคิดเห็น