You are on page 1of 17

Contents

Introduction .............................................................................................................................................. 2
Example: .................................................................................................................................................... 2
Requirement: ............................................................................................................................................ 2
Selection Criteria: .................................................................................................................................. 2
Required Report output ........................................................................................................................ 2
Procedure ...................................................................................................................................................... 3
Create a User Group ..................................................................................................................................... 3
Assign Users for that User Group .............................................................................................................. 5
Create Info Sets ............................................................................................................................................. 5
Create a Query ............................................................................................................................................ 13
Assign a Transaction Code for the Query.................................................................................................... 15













Introduction
The application SAP Query is used to create lists not already contained in the SAP standard. It has been
designed for users with little or no knowledge of the SAP programming language ABAP. 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.
You can use InfoSet Query for flexible data analysis that you cannot carry out with standard reports. By
simply choosing selection and output fields, you can define the report you need, and display a results
list. You can repeat this process as often as you like. You do not require programming skills to create
reports using InfoSet Query.
You can also save queries, make queries you have saved available for other users to use, and transport
queries, providing you have the relevant authorization.
Itll be easy to understand the methodology using an example.
Example:
Requirement:

To filter all SO/LI from Requested Delivery Date & Sold to Party & to get the FG Material, its Planned
SMV & Costed SMV.
Selection Criteria:

Sold to Party:
Requested Delivery Date: to

Required Report output

Sold to
Party
SO LI Requested
Del: Date
Material Material
Desc:
Planned SMV Costed SMV



Procedure
Create a User Group
User Groups can be set up for end-users. Users working within the same application are thus assigned to
the same user group.
Within a user group, it is irrelevant who has defined a certain query, since anyone who belonging to
that group can execute it. However, only users with the appropriate authorization can change queries or
define new ones. Users are not allowed to modify queries from other user groups, although they may,
under certain circumstances, copy and execute them. Each user can be assigned to several user groups.

TX Code: SQ03


Click on Button.
Give a Description for that User Group.

Press
Select a Package relevant for the development

Create a New Transport Request & note it down.


Assign Users for that User Group
Click on Button
Give SAP User Names .

Save it.
Create Info Sets
You can use this component Maintain InfoSets to set up the appropriate working environment for end
users.
InfoSets provide special views of data sources, i.e. they determine which fields of a data source can be
evaluated in queries. InfoSets are assigned to user groups.
By creating InfoSets and assigning them to user groups, you can determine the range of reports the
individual application departments or end-users can generate using SAP Query.
A certain number of InfoSets are available to an end-user for each user group of which he is a member.
These InfoSets are those applicable to the work area that is characterized by the user group. An InfoSet
can be assigned to several user groups.

Tx Code: SQ02

Give Info Set ID

Click on Button
Give a Name for the Info Set


Depend on the Report that you want to generate first you have to select all Tables that youre going to
use for the info Set Query.
If you want to use more than one Table, then use,

If you can get all Data from one Table, then use,

Give the relevant Table Name in the field given right hand side.
For the report that I need to generate, I have to use VBAP, VBAK & MARA Tables.
Therefore I can give one Table here & proceed to give other tables.

Click on Enter button
Now you can see that table in the graphical format. To add more tables, you can use Button or
Edit/ Insert Table Menu option
Give the Table Name & Enter

Once you select ENTER button new table will appear. If table links are not available, then you have to
manually link those using Drag & Drop method.
Click on the relevant field name & drag it to the field name in the relevant table. Link will automatically
appear.


You can check the table link using button.
If table join is correct youll get message.
Select option
Select the following Field Group option.

Click on
This is where you add fields relevant for the Selection Criteria & the report Output.
In your Left Hand side pane all tables that you select will appear. In your right hand side you can see the
Field Groups.

Add field which are relevant to the report.
Drop the relevant Table name to add correct field Names.
You can use to find field names. To add a field, first you have to select the field name from your
left hand side pane & then select the field Group from right hand side pane.
Using button you can add those fields to the report.

Once I add all fields relevant to the Selection Criteria & Output, it looks like this.

Then click on Generate option.
Select the correct Package

Get the Transport Request No
Use BACK option.
Assign User Group to this Info set by clicking
Find the user Group created and assign it by ticking.


Save it








Create a Query
Tx Cide: SQ01

Give a Query Name

Press option.
Select your Info Set created from the popup window.
Give Query Title

Save
Use BACK option
Click on
Drop down all Field Groups from right hand side Pane
Now assign field relevant to Selection Screen & Output Screen.
Eg:
Now for you to get Material No & Description, Go to the below grid, select the Column & Use Right
Mouse Button option & select Value & Text option.

Save it
Assign a Transaction Code for the Query

Tx Code: SE93
Give the new Transaction code required.

Click on
Give a Description for the Query
Select the second option

Now youll get a new screen to enter the Program name.
To get the Program Name, you have to go back to the SQ01 Transaction.
Select your Query.
Go to Menu option -> Query / More Functions / Display Report Name

Copy the Report Name (As Highlighted)

Go back and Paste it to Program Name field

Click on Save
Give the relevant Package & get the Transport Request No
Now Run the new report transaction Code & enjoy the report Output.

Author: Anupa Wijesinghe
E-Mail: anupaw@gmail.com / anupaw@learnsaptips.com
Website: www.learnsaptips.com
View my profile in LinkedIn
Follow me on Twitter


Disclaimer

This article is done based on my research and readings, unless otherwise stated. The views expressed
are my own and not of anyone else.
Author accepts no liability for the content of the articles in this website or for the consequences of any
actions taken on the basis of the information provided. Using this information is at the users own
discretion and responsibility.

You might also like