Hi, I provide training in SAP UI5. Also feel free to checkout my new web page https://saptechblog.com

Query in SAP ABAP

SAP Query:

SAP query is a tool designed by the SAP to create reports by the user with no or little coding knowledge. Basically functional consultants in the organization would use this tool to generate reports.

Components of Query:

The three main components of the query are as below.

  • User Group
  • Info set
  • Query
For more information: SAP Help portal

Part 1- Infoset

Infosets are basis for every query. They contain the list of database tables and the join condition to link those tables.

The transaction code for creating a user group is SQ02.

Go to the transaction SQ02 to create the infoset.

Enter the title and database table for join and click on enter.


Click on insert table to add new tables.

Enter the table EKPO and click on enter.

 System will by default create the join conditions based on keys.

Click on infoset in the right hand side of the tool bar

Choose create empty field groups and press enter.

System will provide you with the list of fields on the table with a group for each table. Choose the fields you want and drag and drop it to the folders on the right.

I have chosen the following fields.

Click on save and then generate the infoset.

Now our infoset is ready. We need to create user group and assign our infoset to the user so that only users who are authorized can access the infoset.

Part 2- User Group:

The user group determines who are the user belongs to the group and the infosets they are authorized to access.

The transaction code for creating a user group is SQ03.

Go to the transaction SQ03 and create a user group. Enter the name for user group and click on create.

Enter the description and click on save.

You will get a message user group is create. 

Now click on assign infoset and user button.

Assign the users and click on assign infoset.

Choose the infoset and click on save.

 Part 3: Query

With query we make use of the infoset created and quickly build the reports. There are three type of reports that can be generated.
  • Basic list
  •  Ranked list
  • Statistics
Go to transaction SQ01 and create the query. Enter the name for the query and click on infoset query. In case you are in another user group then go to edit->choose another user group and choose the user group you have created.

Choose the infoset query which we have assigned to the group and click on enter.

Enter the description and click on basic list. Choose the fields to be displayed in the output table and choose the fields to be displayed in the selection screen.

Click on save and save the query.

Execute the query

About Arun


Post a Comment

Powered by Blogger.