Professional Documents
Culture Documents
SAP Query
SAP Query
SAP Query:
SAP Query is a tool that allows you to create reports even without programming. SAP
queries are based on InfoSets – these are the areas that provide special views of a
logical database and define which fields of the database can be used in queries. SAP
queries can be shared with any users via assigning InfoSets to user groups.
SAP Query – Overview:
• SAP Query is used to create reports for users who have little knowledge about
SAP Table data storage structure. SAP Query allows evaluating data in the SAP
system.
• SAP Query offers users a broad range of ways to define reporting programs and
create different types of reports such as basic lists, statistics, and ranked lists.
Following are the major components which are associated with SAP Query:
• Info Sets – Are base for the Query and it contains one or more database table
details
• Queries – For the User to create and generate the Query
• User Group – To restrict set of Users for a specific Query plus for
Authorizations
• Quick Viewer – A simple tool for quick report generation
SAP Query – Creation:
Creation of Query SQ01
Creation of Infosets SQO2
Creation of User Groups SQ03
Creation of Quick Viewer (User Specific) SQVI
Select on the first tab (List Fields) which fields you want to see in your report. For
Example, we select from the right column the fields “Country Key”, “Name 1”,
“Vendor Account Group” and “Postal Code” and press the “Arrow to the left”, so
these fields are available for the report, by being displayed on the left column.
If you want to see the Field Names in Technical click on the above button as highlight
in the picture or else press SHIFT+F5.
Select on the second tab the sort order. Mark the fields you want and choose the
desired criteria. In our case we will order the vendor by their names.
On the third tab you must define the selection fields. Choose from the right column
the fields you need. You may also change the order in which they may appear later
on the transaction.
After Maintaining all the data click on the save button.
After clicking on the save button click on the Execute button.
You will see a screen, like one from a standard program, but with your own
description and specifically for the fields you have defined. For our example we
select a specific country and press the “Execute” button.
Enter the table Names one by one by clicking on the Insert Table Tab.
If you want to join the tables, you can join by clicking on the Join Conditions Tab.
Here I Join
EKKO with EKPO by clicking on the Join Conditions Button.
After joining the tables click on the back button as shown in the below picture.
Select the Include key fields tab and click on the Enter button or else on Tickmark
which is shown below.
Next, we’ll create field groups and add data fields per the requirement.
For our use case, we are not doing an alias table or extras. So, we can just hit the
generate option,
In the Next step we can assign the Infoset to the Role/User Group Assignment in
SQ02 Transaction code
Select the User Group which we are created in the SQ03 Transaction Code. By
selecting the User group click on the save Button.
We can assign Z_POREPORT to Z_PODATA.
Click on the Generate Button
In SQ03 We can Assign Users to InfoSets
By Entering the Title click on the create button. Select the Infoset that we created
and click on the Green Tickmark as shown in the below picture.
Enter the Title Description and click on the Basic list Tab.
Click on the Enter Button or the Tickmark as shown in the picture.
In the data fields section, choose fields for selection and list (output).
List Fields are the output fields which have to be displayed in the Reporting.
Selection fields are the input fields.
Before clicking on the saving button. We can check whether the scenario working
properly or not by clicking on the Test button.
Here I am running the Testing scenario, Here I am clicking on the Execute button by
entering the Company code.
Enter the programing Name in the Program tab and click on the check button to
check whether it contains any Inconsistent or not.
By checking the data click on the Save Button.
Click on the Local Object.
The customized Transaction code was created successfully.
Enter the Customized Transaction code in Command Bar.
We can get the initial screen directly after Executing the Transaction code.
By Entering the Company Code Click on the Execute Button.
To control the User Authorization, we have to follow the below steps:
• First you have to create the use group in transaction SQ03 and assign the
infoset to this user group with transaction SQ02.
• Use the standard authorization object S_Query with transaction SU21 and
assign the authorization groups. Now you need to assign to the user profiles or
Roles directly so that we can the restrict the users to access the queries and
infosets.