You are on page 1of 26

Day 6

ABAP/4 QUERY

ABAP Query - Introduction


y ABAP Query application is used to create reports not already contained in the default. It has been designed for users with little or no knowledge of the SAP programming language ABAP. y SAP Query offers users a broad range of ways to define reports and create different types of reports such as basic lists, statistics, and ranked lists. y An administrator must first make the required settings to allow the user to work with ABAP Query. y Queries are normally client-dependent. Only the ABAP queries provided by SAP are automatically available in all clients. In order for the queries that you have defined to be available in all clients, you have to transport these queries into all clients in your system.

ABAP Query - Introduction


The SAP Query comprises five components: Queries, InfoSet Query, InfoSets, User Groups and Translation/Query Classic reporting- the creation of lists, statistics and ranked lists- are covered by the InfoSet Query and Queries components. Other components range of functions cover the maintenance of InfoSets, the administration of user groups and also the translation of texts created in the SAP Query All data required by a user for a report can be read from various tables To define a report, you first have to enter individual texts, such as titles, and select the fields and options which determine the report layout. In the WYSIWYG mode, you can edit the lists using Drag & Drop and various toolbars

SAP Query Components


The following overview explains how you can call up individual components and what each of these components is used for. Choose Tools -> ABAP Workbench -> Utilities to call up the components individually.

Menu path

Used for
Maintaining Queries Maintaining Info Sets Maintaining User Groups Language Comparison

SAP Query Queries

SAP Query InfoSets

SAP Query User Groups Translation Query

Data Access
The following three components will be explained in detail: 1. User Groups (SQ03). 2. InfoSets (SQ02). 3. Queries (SQ01).

1. User Groups(SQ03)
Access rights in ABAP/4 Query are maintained via User Groups A User Groups contain users with identical access authorization and a set of associated Functional Areas All users must be members of at least one user group and can be a member of more than one group All members of one user group can access the same data as well as the same programs (queries) to create lists Within a User Groups, it is possible to access only that data that the associated Functional Area provide

Data Access
2. Infosets (SQ02)
The InfoSets component is used to maintain InfoSets. The system administrator uses the component to set up the work environment for end-users. The initial set of data required for generating a query is provided by InfoSet. This initial set of data can be from re-usable Logical Databases or from any Database Table. Each Query is associated with one Functional Area. An ABAP/4 query user need not know table or field names as Infosets Area is not identified by technical details but by declarative text.

Advantages Data can be protected from unauthorized access. Technical details like table name and field name details are hidden from user. Possible to narrow or widen the range of information as provided by Logical Database.

Data Access
Infosets
By creating InfoSets and assigning them to roles or user groups, the system administrator determines the range of reports that the individual application departments or end-users are able to generate using the SAP Query. End-users are able to work only with those InfoSets that are relevant to their particular area, as designated by the role or user group that they are assigned to. An InfoSet can be assigned to several roles or user groups.

Elements of ABAP Query


You can define three types of evaluations for ABAP Query:
Basic lists Statistics Ranked lists

These three groups can be combined as desired.

Elements of ABAP Query


Basic lists
Presents data in the order defined by Functional Areas. Possible to sort data based on different criteria Possible to calculate sums and intermediate sums.

Statistic
Shows statistical figures calculated from basic data

Ranked list
Specialization of Statistic. A Query can have a basic list upto 9 statistic and 9 ranked list. Partial lists is optional.

Advantages: Data is read only once.

Creating a User Group (SQ03)

Creating a User Group

Creating a User Group

Type the User Group Id and Save. Only the User Group Id specified here will have the authorization.

Displaying a INFOSET (SQ02)

Type a name for FA and click DISPLAY

Type the text and click save

Displaying a INFOSET
Click on join

Displaying a INFOSET

Creating a Query ( SQ01)

Select a query name and click on display

Creating a Query
Click on Basic List

Creating a Query

Click on the required field and click on Test Execution.

Creating a Query

Choose the output format and click execute

Creating a Basic List

Creating a Basic List

Creating a Statistic

Type a name and fill other necessary Type a name options & click for FA and click continue create Type the text and click save Type the text and click save In the same way create a query and open in change mode and click on Statistic. Set the necessary option as shown in next page, save and execute.

Exercises
Exercise 1: Exercise 2: Exercise 3: Exercise 4: Create a User Group. Create a Functional Area. Assign a Functional Area to a User Group. Create & Execute an ABAP/4 Query.

Exercise 1: Create a User Group


Tasks: 1. In your test R/3 client, go to the ABAP/4 Development Workbench and create a User Group 2. Provide the following description: TEST USER GROUP 3. Add to the User list your SAP Username 4. SAVE and Exit to ABAP/4 Development Workbench You have now created a User Group.

Exercise 2: Create a Functional Area


Tasks: 1. In your ABAP/4 Development Workbench, create a Infoset Area called TEST. 2. In the Description field, type: TEST InfoSet AREA. 3. Use a Logical Database named LMM. 4. Create Infoset Group identifiers and descriptions. 5. Select with identifiers all of the fields in tables MKPF and MSEG.

Exercise 3: Assign a Functional Area to a User Group


Tasks: 1. 2. 3. At the Infoset Area initial screen, click ASSIGN TO USER GROUPS Select TEST USER GROUP created earlier. SAVE and Exit to Workbench.

You might also like