01-29-2008 5:03 AM
Hi All,
Can anyone please provide me with the tutorial on how to create an ABAP Query Report.
Thanks in Advance,
01-29-2008 5:09 AM
Hi,
An ABAP/4 query can be designed in four steps
1. Creation of a user group
2. Creation of functional area
3. Assignment of user group to functional area
4. Creation of the query based on functional area
The various objects that form an ABAP query can be created in the following 2 ways:
Tools => ABAP/4 Workbench => Utilities => ABAP/4 Query
OR
By executing the transaction codes mentioned below
SQ01 ABAP/4 Query
SQ02 Functional Area
SQ03 User group
Reward if helpful.
Regards Madhu.
01-29-2008 5:13 AM
Case:
To keep it simple, I chose a very simple case where I join the tables MARA and MAKT with basic Material details and descriptions as the output.
T.Code SQ03
Create user group, enter description & save
Enter User Group name & Click on CREATE
Enter description in the next screen (below)
Save
After saving click on the button Assign users and Infosets
Multiple users can be assigned to the group
After assigning, save & go back
To know the Users settings click on the Description button in the main screen you can get the details as below
Now go to T.Code SQ02
Create Infoset, join & relate tables
Enter Infoset name & Click on CREATE
Enter description in the next screen (below)
Enter main table name in the fiels circled in red below
The Infoset's initial screen will appear with the table specified earlier (as shown below)
Now click on the (encircled in red) to insert the next Table for joining (MAKT in this case)
As soon as you mention the table name and hit Enter, the Infoset screen will display the seciond table showing the primary key link to the base table as shown below (MATNR in this case)
Now check the Infoset for inconsistencies and on finding none, you can bo back by clicking the BACK button
After clicking the BACK button the below screen appears in that choose the option Create Empty Field Groups
Once the above selection is been selected the below screen appears with collapsible menus for each table to seledct fields for selection and display
Drill down the tables and simply drag and drop the fields to the right hand side to their respective tables
The selected fields are displayed in the screen below
Now Check the Infoset for inconsistencies; on finding none, SAVE and GENERATE
Then click the button "ROLE/USER GROUP ASSIGNMENT" in the main screen to assign the Role. The Below screen appears in that Activate the Assigned table against the User Group name ZKAR_UG
Now save & go back
Now go to T.Code SQ01
Click on the button "INFOSET QUERY" to see the screeb below
Select the ifnoset ("ZKAR_INFOSET" in thos case)
After selecting the InfoSet below screen appears
Here you can select the fields for output and selection separately
Ensure the Output & the Selection Fields are in VALUE & Not in TEXT. If it is a TEXT then in the screen in the menu bar you have EDIT option in that select SETTINGS the below screen comes in that ensure the Selection & the output is in VALUES
In the Output tab ensure the Type of Output list as BASIC LIST & the Type of Output as SAP LIST VIEWER
In the Default: Val/Text Tab ensure for the Output & Selection the VALUE radio button is selected
Now click enter
In that select which are the fields to be the selection fields & which are the fields to be the listed fields, that is the output fields.
After doing the above process save the settings by clicking the save button & go back
When you click the save button the below screen appears in that Query Name will be generated automatically by the System Title can be defined by us
Thats it!!! your SAP Query is ready. Click on Execute to run the Query
Assigning a t-code to your query is simple. There are 2 ways to it...
Execute the query; go to "Status" on menu bar; take the program name; go to SE93; create & assign your own "Z" transaction to the query
Go to query - more functions - reportname; take the program name; go to SE93; create & assign your own "Z" transaction to the query
data from internet
reward if useful
Edited by: Sumesh Nair on Jan 29, 2008 10:43 AM