S4AP Query Llolk
S4AP Query Llolk
Community
SAP Community Products and Technology Enterprise Resource Planning ERP Blogs by Members
SAP Query
SAP Query
VKR_23
Participant
09-07-2023 5:57 AM
2 Kudos
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 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.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 1/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
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 based for the Query and it contains one or more database table
details.
User Group – To restrict set of Users for a specific Query plus for Authorizations.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 2/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
SQVI is a simple ad-hoc report that can be written directly in the production system, I.e.,
there is no need for transporting information between systems. Any functional consultant
(or even business user) with a good understanding of SAP tables can write a query with
SQVI.
Enter the Title for your Report and Enter the Description
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.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 3/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
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.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 4/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
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 with the
transaction.
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.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 5/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
Note:
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 6/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
The Difference between the SQVI and SQ01/SQ02 are the Queries which we are written
in SQ02/SQ01 are Transportable. Where in SQVI we directly written the Queries in
production system.
SAP Query Area is a set of objects having queries, InfoSets and User Groups which are
consistent.
Standard Area – They are Client Specific Queries and do not create a Work Bench
Request.
SAP databases have several numbers of tables in which the transactions, master data
gets stored and it’s practically not feasible to have all such fields for selection when
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 7/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
creating a query. Hence before the start of creating a query, InfoSet creation is required.
Create a logical set of User Group to which the InfoSet Queries would be assigned.
Enter the Description in the User Group and click on Create button.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 8/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
The InfoSet creation can be made with the Combination of Tables (Table Join), Direct
read from a Single Table or with the help of Logical Database.
Enter the Description in the InfoSet tab and click on the create button.
Enter the Description in the Report Tab and Enter the Table Name and click on the Enter
or else click on the Tick mark as shown below.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 9/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
Enter the table Names one by one by clicking on the Insert Table Tab.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 10/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
If you want to join the tables, you can join by clicking on the Join Conditions Tab.
Here I Join
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 Tick mark which
is shown below.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 11/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
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
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 12/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
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.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 13/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 14/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
Next go to the Transaction Code SQ01, Enter the title in the Query Tab. Here I have
entered My user Group as Title Description.
We should have to enter Either Infoset Title or User Group Title as Description in the
while creating the Query in the SQ01 then only the system Accepting or else the system
throws error User Group does not Exit.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 15/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
By Entering the Title click on the create button. Select the Infoset that we created and
click on the Green Tick mark as shown in the below picture.
Enter the Title Description and click on the Basic list Tab.
Click on the Enter Button or the Tick mark as shown in the picture.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 16/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
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.
Before clicking on the saving button. We can check whether the scenario is 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.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 17/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 18/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 19/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
1. SQ01 is a saved query that can be accessed by other people, SQVI can only be
accessed by the user who wrote the query.
2. SQ01 allows for additional fields to be defined and populated, SQVI only allows for
the use of fields already defined in the tables.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 20/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
For the report we just created, you shouldn’t give end users access to T-codes SQ02 and
SQ01. It is not a good user experience to have your business folks play around with
these technical transactions.
So, for a complete end-user experience, you should create a report in SQ02/SQ01 and
then associate a Z transaction code (custom code) with it. SAP allows you to create these
Z transaction codes, which can be used like any other standard transaction code.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 21/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
Enter a unique transaction code starting with Z, Enter a name in the short text field,
select the radio button for “program and selection screen (report transaction).”
Click on the Enter button or the Green Tick Mark after Entering the short text and by
selecting the start object.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 22/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
Enter the programming Name in the Program tab and click on the check button to check
whether it contains any Inconsistent or not.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 23/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
We can get the initial screen directly after Executing the Transaction code.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 24/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
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 infoset.
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 25/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
1 Comment
word_expert
Explorer
09-07-2023 11:55 AM
0 Kudos
Comment
Advance Return Management 1 AI and RPA in SAP Upgrades 1 API and Integration 1
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 26/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
How to add new Fields in the Selection Screen Parameter in FBL1H Tcode 1 IDOC 2
Related Content
Understanding the Relationship Between Inventory Levels and Sales Using SQL-
Correlation Coefficient
in Enterprise Resource Planning Blogs by Members 4 hours ago
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 27/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
former_member213836
Active Participant
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 28/29
13/6/24, 3:50 p.m. SAP Query - SAP Community
https://community.sap.com/t5/enterprise-resource-planning-blogs-by-members/sap-query/ba-p/13577006 29/29