Query Creation Using SAP Standard InfoSets
Query Creation Using SAP Standard InfoSets
Query Creation
Prepared By
Natesh G
Confidential Page 1
Query Creation
TABLE OF CONTENTS
QUERY CREATION............................................................................................................................................3
1. INTRODUCTION .............................................................................................................................................3
Confidential Page 2
Query Creation
Query Creation
1. Introduction
Queries are useful in creating reports without coding in ABAP. It is a very simple
tool to generate complex reports for fetching data from various tables in SAP. One can
either create a report or use the existing standard report to create a report that suits the
needs. This document explains how to copy standard query to generate reports.
Confidential Page 3
Query Creation
Via Menus Tools -> ABAP Workbench -> Utilities -> SAP Query ->
InfoSets
Via Transaction Code SQ02
Select the standard query that you want to copy and select the Copy from the Menu
shown above or use Keyboard shortcut ‘Ctrl + F1’
Confidential Page 4
Query Creation
After created, the Infoset needs to be generated, so that it can be used in creating the
query.
* Creation of New Infoset: (List of contracts in SD as outputs…by joining tables VBAK &
KNA1)
Confidential Page 5
Query Creation
For joining tables click on “Define condition after selecting both tables , the following will
be visible on right hand side of the screen
Confidential Page 6
Query Creation
For establishing a relationship between both tables, we need to identify a common field
in both the tables. Click on the above circled icon.
For establishing relationship between these two tables of VBAK & KNA1 with customer
number..then we need to remove relationship came as default…click on “=” button and
click on above.
Then find KUNNR field on left side as well and give relationship as “00” “=” “00” as
below.
Come back once and generate Infoset. The following screen appears..press Enter
Confidential Page 7
Query Creation
In the above screen…left side of the screen shows the tables selected and system
displays all the fileds in those tables…if we need to select only few of them for our
reporting purpose either for input or output…then we need to get those fields to right
hand side by dragging and dropping…
Steps:
1) First create some field groups as required on right hand side
2) Drag and drop required fields from left hand side to right hand side.
Confidential Page 8
Query Creation
Via Menus Tools -> ABAP Workbench -> Utilities -> SAP Query ->
User Groups
Via Transaction Code SQ03
Once the user group is created, the users and Infosets that should be assigned to this
User group should be assigned. Select
Confidential Page 9
Query Creation
Assign the users who can change the Infosets and Queries assigned to the user group.
Click
Select the InfoSet that needs to be used for creating the Query
Confidential Page 10
Query Creation
Via Menus Tools -> ABAP Workbench -> Utilities -> SAP Query ->
Queries
Via Transaction Code SQ01
From the user group select the Menu below to go to the Queries
Click
Confidential Page 11
Query Creation
Select the InfoSet to enter the screen for creating the Query
Confidential Page 12
Query Creation
Use the arrows on the left screen to open the various tables and select the items in
Selection Criteria and Output
Confidential Page 13
Query Creation
Note:
1. The values in the right screen are the Selection Options that appear on the
screen (Input Screen)
2. The columns below are the Columns that appear in the Output.
3. For certain columns, there is an option to display either text or value or both.
This can be selected by Right-clicking on the column and selecting accordingly as
shown.
4. The output columns also can be shuffled by dragging and dropping at the desired
locations.
Confidential Page 14
Query Creation
Choose the user group and give the name and description of the query that appears
when the Query is executed
Once saved, the Query must be generated so that the Report name is generated which
can be used for creating the transaction
Confidential Page 15
Query Creation
Confidential Page 16
Query Creation
Confidential Page 17
Query Creation
Give the name of the Program that was copied from the Query
Confidential Page 18
Query Creation
Once Transaction is created, it can be checked by giving the name in the Address bar as
shown above
The selection criteria appear as above. More selection options are got by using the
button. The output format also can be chosen by clicking the button.
Confidential Page 19
Query Creation
The output of the report is as shown below for SAP List Viewer
Confidential Page 20
Query Creation
Confidential Page 21
Query Creation
And to upload into the destination system…goto the target system..use SQ03 and
transport and click on Upload…
Confidential Page 22
Query Creation
Confidential Page 23