Enter word you want search.

วันศุกร์ที่ 30 ตุลาคม พ.ศ. 2552

Chapter 2. One-Time Configuration for Query Tool Use


This chapter covers everything you need to know to make the SAP R/3 Query family of tools ready for use. The steps for the configuration are broken down in such a simple and easy-to-use format that anyone can perform them. However, the decision to use a particular tool or tools and the administrative methodology that will be put into place to use the tools requires deeper consideration.

Before you dive in and begin performing the one-time configuration that is necessary before you can use the SAP Query reporting tools, you should review Chapter 1, "Getting Started with the SAP R/3 Query Reporting Tools." As discussed in Chapter 1, the SAP R/3 Query tools (SAP Query, InfoSet (Ad Hoc) Query, and QuickViewer) are built on a foundation of four main components:
  • Query areas
  • Query groups
  • InfoSets
  • Administrative decisions (which are company-specific)
This chapter covers how to configure query groups and InfoSets so that you can begin using the Query family of tools.


Steps in Configuring the Query Tools


After you have made the administrative decisions described in Chapter 1, you can perform the one-time configuration of the Query tools in four quick and easy steps:

1. Create query groups.

2. Assign users to query groups.

3. Create InfoSets.

4. Assign each InfoSet to a query group.


Step 1: Create Query Groups

To create a new query group, you perform the following steps:

1. Log in to your SAP client where your query groups will be maintained. (As noted in Chapter 1, best practice dictates that they be maintained in your live production client.)

2. Navigate to the User Groups: Initial screen by using the transaction code /nSQ03, as shown in Figure 2.1


Figure 2.1. SAP query groups are created and modified using the User Groups: Initial screen.


3. Ensure that you are in the appropriate query area by following the menu path Environment, Query Areas and selecting Standard Area. (Best practice dictates that you maintain query areas in the standard area, as discussed in Chapter 1.

4. Type in the name for your query group in the User Group field. (For purposes of this example, I'm naming mine ZTEST.) Then click the Create button.

5. When a dialog box appears, asking you to provide a description for your query group, type Test Query Group 1 and then click the green checkmark Save button.


Step 2: Assign Users to Your Query Groups

To assign users to a query group, perform the following steps:

1. Click the Assign Users and InfoSets button.

2. Type in the SAP user IDs of any users you wish to include in your test group, making sure to include your own user ID (see Figure 2.2).


Figure 2.2. Input the SAP user IDs for any user you wish to belong to the query group.


3. Click the Save button on the toolbar. A message appears in your SAPGUI status bar, saying "User group ZTEST saved."

Now that you have a query group created, the next step is to create an InfoSet.


Step 3: Create InfoSets

You create InfoSets (known as functional areas in versions of SAP prior to version 4.6) on the InfoSet: Initial screen, shown in Figure 2.3. As stated in Chapter 1, an InfoSet is basically the data source from which you get the data to use in your reports. You can picture an InfoSet as an organized container that holds all your stuff. InfoSets can be built on a variety of different sources, but the most common is the use of a logical database.

Figure 2.3. A list of all previously created InfoSets is displayed on the InfoSet: Initial screen.


To create a new InfoSet, you perform the following steps:

1. Log in to your SAP client where your InfoSets will be maintained. (As noted in Chapter 1, best practice dictates that you maintain them in your development client.)

2. Navigate to the InfoSet: Initial screen by using the transaction code /nSQ02 (see Figure 2.3).

3. Ensure that you are in the appropriate query area by selecting Environment, Query Areas and then selecting Standard Area. (Best practice dictates that you maintain query areas in the standard area, as covered in Chapter 1.)

4. Type in a name for your InfoSet. (For purposes of this example, I'm naming mine ZTEST.) Then click the Create button.

5. On the InfoSet: Title and Database screen, type an InfoSet description in the Name field. (For purposes of this example, I'm naming mine Test InfoSet 1.)

6. On the InfoSet: Title and Database screen, select the Logical Database radio button and select or input logical database f1s in the field to its right (see Figure 2.4), and then press Enter.

Figure 2.4. There are several hundred logical databases to choose from.


A Change InfoSet screen, similar to the one shown in Figure 2.5, appears. The Change InfoSet screen displays a list of all tables available in the selected logical database for your InfoSet. The logical database selected, F1S, contains three test tables, called SPFLI, SBOOK, and SFLIGHT, which correspond to the three field groups listed at the top right. The field groups are what the end users see when they are creating reports using the SAP Query reporting tool.


Figure 2.5. The Change InfoSet screen is divided into three sections.


7. To view the fields in each of the three tables, use the expand subtree button next to each table name. The table selected expands and displays the fields underneath, as shown in Figure 2.6.


Figure 2.6. The left side of the screen lists the tables and fields, and the right displays the field groups.


8. Assign fields to the field groups (shown on the top right of the screen) within the InfoSet. These field groups will display in the SAP Query tool during reporting. Only the fields that you include in your field groups will be available for field selection in the SAP Query tool that uses this InfoSet as its data source. By default, these field groups are empty.

9. Place your cursor on the first field group, Flight Schedule, and double-click to highlight that field group as the selected field group. Next, select fields from the left side of the screen from the Flight Schedule table and add them to the Flight Schedule field group by placing your cursor on a field on the left side of the screen, right-clicking, and selecting the option Add Field to Field Group (see Figure 2.7).


Figure 2.7. You should only add fields to their corresponding field groups (for example, Flight Schedule table to Flight Schedule field group).


10. When the field you just added to the Flight Schedule field group appears at the top right of the screen, add fields to your selected functional group by following the procedure outlined in step 9. Be sure to add fields to the appropriate field groups. For example, fields in the Flight Schedule table should be added to the Flight Schedule field group, and fields from the Flight Booking table should be added to the Flight Booking field group.

11. After you have added a series of fields to your field groups, click the Save button on the toolbar. A message appears in the status bar, saying that your InfoSet was saved.

12. Generate the InfoSet by clicking the Generate button (the red beach ball) on the Application toolbar. A message appears in the status bar, saying that the InfoSet was generated.

13. Exit the Change InfoSet screen by clicking the green back arrow.


Step 4: Assign Each InfoSet to a Query Group

You have now created a Query group, assigned users to it, and created an InfoSet. The last step before you begin creating reports is to assign your InfoSet to your Query group. This is an easy task:

1.On the InfoSet: Initial screen (which you reach by entering transaction code //nSQ02), make sure your InfoSet name (in my example, ZTEST) is present in the InfoSet text box, and click the User Group Assignment button.

2. In the InfoSet: Assign to User Groups screen that appears, highlight your query group (in my example, ZTEST) by selecting the gray button to the left of it, and then click the Save button. A message appears in the status bar, saying that the assignment of InfoSet has been saved.

3. Exit the InfoSet: Assign to User Groups screen by clicking the green Back arrow.You are now ready to begin creating reports with the SAP R/3 Query reporting tools. Chapter 1, "Creating Basic Reports with the SAP Query Tool," describes how to do so using SAP Query.

Chapter 1. Getting Started with the SAP R/3 Query Reporting Tools



The SAP R/3 Query Reporting Tools


In addition to these four main avenues, SAP comes preinstalled with the following end-user reporting tools:

  • SAP Query
  • InfoSet (Ad Hoc) Query
  • QuickViewer

Note

The SAP R/3 Query tools are SAP Query, QuickViewer, and InfoSet (Ad Hoc) Query. When I refer to the SAP Query tool, I am referring to the individual SAP Query tool, and when I refer to all three of the tools, I use the term SAP R/3 Query tools. This may appear a bit confusing at first, but you will get the hang of it as you move along.
The SAP Query Tool

The SAP Query tool, known as the ABAP Query tool in earlier versions of SAP, is delivered with the SAP R/3 system. End users can use this tool to quickly and easily create reports from data stored in the SAP R/3 database. This tool can be used in any application module in SAP. Its easy-to-use format simplifies the report creation process. The SAP Query tool includes basic and advanced features for every level of end user. The SAP Query tool offers a broad range of ways to define output and create different types of reports, such as basic lists, statistics, and ranked lists. This tool can be used in a basic or graphical mode.
The InfoSet (Ad Hoc) Query Tool

Unlike the SAP Query tool, which is a complete reporting solution, the InfoSet Query tool is designed for basic users to retrieve simple, single-use lists of SAP R/3 data. In SAP 4.6, the Human Capital Management module reporting tool called the Ad Hoc Query tool was combined with the technology of the SAP Query tool and made available for all modules; its new name is the InfoSet Query tool (although it is still referred to as the Ad Hoc Query tool when executed for human resources reporting). This book refers to it as the InfoSet (Ad Hoc) Query tool.

Unlike with the SAP Query tool, all query information, including the selection criteria, for InfoSet Query tool reporting is available on a single screen. You can use the InfoSet (Ad Hoc) Query tool to quickly answer simple questions or to create a comprehensive report for printing or downloading to your PC. A user can use the InfoSet (Ad Hoc) Query tool to pose questions to the SAP system and receive real-time answers.
The QuickViewer Tool

The QuickViewer tool that is delivered with a SAP 4.6 system is a WYSIWYG ("what you see is what you get") utility for quickly collecting data from an R/3 system. The QuickViewer tool is actually a variant of the robust SAP Query tool that is designed for new or occasional users or for single-use data inquiry reports. You can use this tool to create reports referred to as QuickViews. To define a report with the QuickViewer tool, you simply enter texts (titles) and select the fields and options that define the QuickView. QuickViews cannot be exchanged among users, but they can be converted to reports to be used with the SAP Query tool.


How the SAP R/3 Query Tools Work

Query tools are based on the foundation of the SAP R/3 database. Historically, the primary method of creating reports in SAP was by using the ABAP Workbench and writing code in the language of ABAP. Specially trained programmers could write a long series of lines of code in an ABAP editor to retrieve information from the database, compute relationships, configure security, design selection screens, and present data in a particular arrangement. The skill set for ABAP programming is challenging to learn and usually requires experience in each application area of SAP for which programming will occur. For example, an ABAP programmer with experience in the Financials module would require special training to change functions and create reports in the Sales and Distribution area. Because these programming skills are substantial, SAP created the Query family of tools so that end users could pick and choose the fields they want to include in their reports and, behind the scenes, SAP would handle all the technical details. Figure 1.1 is a diagram that shows the foundation of the SAP Query tools.


Figure 1.1. An overview of the technical aspects of the SAP R/3 Query tools.
As described in the following sections, the SAP R/3 Query toolsSAP Query, InfoSet (Ad Hoc) Query, and QuickViewerare built on the foundation of four main components:
  • Query areas
  • Query groups
  • InfoSets
  • Administrative decisions (which are company-specific)
Query Areas
Query areas (known as application areas in versions of SAP earlier than 4.6) contain SAP Query elements, queries, InfoSets, and query groups. SAP has two distinct query areas:
  • Standard Standard query areas are client-specific. That is, by default, they are available only within the client in which they were created. For example, if they were created in the live production client, they would exist only in the production client. Transport of query objects created in the standard area can be accomplished between multiple clients on the same application server.
  • Global Queries designed in the global query area are used throughout the entire system and are client-independent. In version 4.6, SAP delivers many of its standard reports in the SAP Query global query area. These queries are also intended for transport into other systems and are connected to the ABAP Workbench.
Query Groups
Query groups were known as user groups in versions of SAP prior to version 4.6. A query group is a collection of SAP users who are grouped. A user's assignment to a query group determines which queries he or she is allowed to execute or maintain. In addition, it designates which InfoSets (that is, data sources) the user has access to work with. Basically, query groups give a user access to create, modify, and execute reports in a certain area within R/3. For example, you could create a query group for the Finance department that would house your financial users, or you could create a query group for the Human Resources department that only members of the Human Resources department would belong to. Using query groups is an easy way to group and segregate reports and users.
Query groups, which are often maintained by a system administrator, are created on the User Groups: Initial screen, which you can find by using the transaction code /nSQ03.
Users can belong to multiple query groups and might, under certain circumstances, copy and execute queries from other query groups (if the permissions are the same). Any user within a query group has authority to execute queries that are assigned to it, but only users with the appropriate authorization can modify queries or define new ones. Users are not permitted to modify queries from other query groups.
InfoSets
InfoSets, known as functional areas in earlier versions of SAP, are areas that provide special views of logical databases and determine which fields of a logical database or data source can be evaluated in queries. That is, an InfoSet is basically the data source, from which you get data to use in reports.
InfoSets can be built on a variety of different sources, but the most common is the use of an SAP logical database. Remember that writing reports without Query tools requires a programmer to write code that goes into the main R/3 database and retrieves the records it needs, and that is no easy skill. SAP delivers logical databases, which are rational prearranged groupings of data from multiple related indexed tables. SAP places all the fields you want to report from in a nice container from which you simply select the fields you want to include in your report.