0% found this document useful (0 votes)
6 views

S4AP Query Llolk

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

S4AP Query Llolk

Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

13/6/24, 3:50 p.m.

SAP Query - SAP Community

Community

SAP Community  Products and Technology  Enterprise Resource Planning  ERP Blogs by Members

 SAP Query

Enterprise Resource Planning Blogs by Members


Gain new perspectives and knowledge about enterprise resource planning in blog posts from community
members. Share your own comments and ERP insights today!

All community  What are you looking for today?

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 – 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.

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.

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

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

Creation of User Groups SQ03


Creation of Quick Viewer (User Specific) SQVI

Creation of Quick Viewer: (Transaction code – SQVI)

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.

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.

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

Now we can see the result.

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:

SAP Query Area is a set of objects having queries, InfoSets and User Groups which are
consistent.

Following Query Areas:

Standard Area – They are Client Specific Queries and do not create a Work Bench
Request.

Global Area – Queries in the Global Area are Client Independent.

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.

First create the User Groups in SQ03:

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.

Enter the Description and click on the save.

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

Now Create the Infosets in SQ02 Transaction Code:

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.

Here I am using the tables EKKO and EKPO.

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

Click on the insert table button to add more tables.

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

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 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.

We can assign Z_POREPORT to Z_PODATA.

Click on the Generate 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

In SQ03 We can Assign Users to InfoSets

Click on the Assign Infoset tab as shown in the picture.

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

Select the Infoset checkbox and click on the save button.

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.

Selection fields are the input fields.

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

The scenario is working properly.

Click on the save button.

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

Click on the Execute button.

By Entering the company Code click on the Execute Button.

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

Comparison between and SQ01 and SQVI:

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.

3. SQ01 will automatically bring in text descriptions (such as item description or


customer name) when using fields that would have a text field associated, SQVI did
not.

Process to Customize the Transaction Code:

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.

To do this, first go to T-code SQ01 and follow this path:

Query > More Functions > Generate Program

Query > More Functions > Display Report Name

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

Copy the program name.

Next, go to T-code SE93.

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.

By checking the data, click on the Save Button.

Click on the Local Object.

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

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.

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

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 infoset.

SAP Managed Tags:

MM (Materials Management), MM Inventory Management, MM Purchasing

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

I have only one word for you and that is Amazing.

 You must be a registered user to add a comment. If you've already registered,


sign in. Otherwise, register and sign in.

Comment

Labels In This Area


"mm02" 1 A_PurchaseOrderItem additional fields 1 ABAP 2 abap cds 1

ABAP CDS Views 2 ABAP CDS Views - BW Extraction 1

ABAP CDS Views - CDC (Change Data Capture) 1 ABAP Development 1

ABAP Extensibility 1 ABAP Programming 1 abapGit 1 ACCOSTRATE 1

ACDOCP 1 Adding your country in SPRO - Project Administration 1

Advance Return Management 1 AI and RPA in SAP Upgrades 1 API and Integration 1

Approval Workflows 1 Ariba 1 ARM 1 ASN 1 Asset Management 1

Associations in CDS Views 1 auditlog 1 Authorization 1 Availability date 1

Azure Center for SAP Solutions 1 AzureSentinel 2 Bank 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

BAPI_SALESORDER_CREATEFROMDAT2 1 Billing 1 BRF+ 1 BRFPLUS 1

Bundled Cloud Services 1 business participation 1 Business Processes 1 CAPM 1

Carbon 1 CDS Annotations 1 Cental Finance 1 CFIN 1

CFIN Document Splitting 1 Cloud ALM 1 Cloud Integration 1 COGS SPLIT 1

condition contract management 1

Connection - The default connection string cannot be used. 1

Consignment Process using MRP Area 1 Custom Table Creation 1

Customer Screen in Production Order 1 Customizing 1 Data Quality Management 1

Date required 1 Decisions 1 desafios4hana 1

Developing with SAP Integration Suite 3 Direct Outbound Delivery 1 DMOVE2S4 1

DTW 1 EAM 1 EDI 3 EDI 850 1 EDI 856 1 edocument 1

EHS Product Structure 1 Emergency Access Management 1

Employee Central Integration (Inc. EC APIs) 1 Energy 1 EPC 1

Financial Operations 1 Find 1 FINSSKF 1 Fiori 1 FIORI MY-INBOX 1

Flexible Workflow 1 Gas 1 Gen AI enabled SAP Upgrades 1 General 1

generate_xlsx_file 1 Getting Started 1 HomogeneousDMO 1

How to add new Fields in the Selection Screen Parameter in FBL1H Tcode 1 IDOC 2

Integration 1 Learning Content 2 Ledger Combinations in SAP 1 LogicApps 2

low touchproject 1 Maintenance 1 management 1 Material creation 1

Material Management 1 MD04 1 MD61 1 methodology 1 Microsoft 2

MicrosoftSentinel 2 Migration 1 Migration Cockpit 1 mm purchasing 1

Related Content
Understanding the Relationship Between Inventory Levels and Sales Using SQL-
Correlation Coefficient 
in Enterprise Resource Planning Blogs by Members 4 hours ago

MDK Mobile application - QueryOptions - filter - diacritics 


in Enterprise Resource Planning Q&A 8 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

SAP S/4HANA Cloud Public Edition - Finance-Cost Accounting - Frequently Asked


Questions 
in Enterprise Resource Planning Blogs by SAP yesterday

Batch Query Duplicate records 


in Enterprise Resource Planning Q&A Tuesday

Eliminar Documentos Pendientes de Autorizacion 


in Enterprise Resource Planning Q&A Monday

Popular Blog Posts

IDoc Basics For Functional Consultants

former_member213836
Active Participant

 995004  318  660

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

You might also like