Abap Statistical Query
Abap Statistical Query
Abap Statistical Query
opasdfghjklzxcvbnmqwertyuiopasdfgh
jklzxcvbnmqwertyuiopasdfghjklzxcvb
nmqwertyuiopasdfghjklzxcvbnmqwer
Statistical Query
tyuiopasdfghjklzxcvbnmqwertyuiopas
dfghjklzxcvbnmqwertyuiopasdfghjklzx
http://abap-tutorials.com
cvbnmqwertyuiopasdfghjklzxcvbnmq
wertyuiopasdfghjklzxcvbnmqwertyuio
pasdfghjklzxcvbnmqwertyuiopasdfghj
klzxcvbnmqwertyuiopasdfghjklzxcvbn
mqwertyuiopasdfghjklzxcvbnmqwerty
uiopasdfghjklzxcvbnmqwertyuiopasdf
ghjklzxcvbnmqwertyuiopasdfghjklzxc
vbnmqwertyuiopasdfghjklzxcvbnmrty
uiopasdfghjklzxcvbnmqwertyuiopasdf
ghjklzxcvbnmqwertyuiopasdfghjklzxc
http://abap-tutorials.com 2010
The last and the final activity is creation of QUERY using transaction SQ01
Go to transaction SQ03
Type the name of the user group you want to create ( for example – SALES ) and click on the create icon .The following
screen pops up
This is second and one of the most important activity in statistical query creation . In this activity you follow the
following steps .
Go to transaction SQ02 .
http://abap-tutorials.com 2010
Fig : A
You type a name for the INFOSET you are going to create and click on the create icon. The following menu pops up
http://abap-tutorials.com 2010
If you are just going to print selected field from a table select “Direct read of table “
If you going to get consolidated information from more than one table, you select option “Table join by basis table “
In either of the above 2 case, give the name of basic table in the space provided and click on the continue icon.
Automatically the following screen pops with the field of the basis table you have mentioned as shown below
http://abap-tutorials.com 2010
You select/ insert the other tables you want using the icon “ Insert Tables “ . The screen looks like as shown below
http://abap-tutorials.com 2010
Please note that if the tables are standard SAP tables , the joining rule definition is proposed automatically . Else the
user has to create Join definition by clicking on the corresponding fields in related table and then dragging one from one
table to the other field in the other table . These Join definitions thus defined can be checked by using root JOIN > CHECK
LINK COND .
On establishing the join definition , you click on the back icon to save . The following menu pops up
Now you generally select option “Create Empty Fields Groups “ and click continue button . The following menu pops up.
http://abap-tutorials.com 2010
You either delete or create more Field Groups by using root Edit> Field Group > Create fields group .
http://abap-tutorials.com 2010
You then add required fields from the various tables by following steps
[ Please Note that if the fields are preceded by icon it means that only field value will get into the field group and if they
are preceded by icon it means that both field value and text will get into the field group ]
Then you check for any inconsistencies using root Infoset > Check
Then you generate the Infoset using root Infoset > Generate
The this generated Infoset is assigned to User group ( existing ). ( Refer Fig A in page 3)
http://abap-tutorials.com 2010
Type the name of query (15 characters) and click on create icon .The following screen pops up.
http://abap-tutorials.com 2010
Select the appropriate INFOSET and click on the choose button .The following screen pops up.
http://abap-tutorials.com 2010
Then you go to the root GOTO>FIELD SELECTION> SELECT FIELD GROUP and select the appropriate field group.
http://abap-tutorials.com 2010
Then you go to the root GOTO>FIELD SELECTION> SELECT FIELD to select the field that you need in the report. You select
the required fields and click on “ Basic List “, where you list the line number , sequence number and sorting order for the
output . This is one of the most important activities in creating Statistical QUERY.
Then you go to the root GOTO>FIELD SELECTION> SELECTION to select the field that you need in the selection screen.
You select the required fields for selection and allocate number to the same. Also you specify whether multiple entries are
allowed or not by using “Sngl” field. If you tick the “Sngl” field then only single entry is allowed
http://abap-tutorials.com 2010
Save the query and execute the report. Thus a query has been created.