How to use SAP Query step by step (make ALV report quickly)

447
sap query step by step

Using SAP Query step by step.

Purpose

Using SAP query step by step to make simple report quickly.

Procedure

1. Create Infoset

Go to transaction code: SQ02 >> Choose Tab Environment >> Choose Query Areas >> Choose Standard Client ( Client Specific ) – If you want test on current client and then transport to others client.

SAP Query step by step SAP Query step by step

If you don’t choose Query Areas is Standard client ( Client – Specific ). System defaults all infoset will existing on Global Client ( Cross Client )

Fill infoset field name: ZPP_R001 >> Click Create

SAP Query step by step

Fill Title of Infoset, authorization group (if it’s necessary)

  • Choose Direct read of table (if data of report need only from single table)
  • or choose Table join using basis table (if data of report need join from multiple tables)

>> Enter

SAP Query step by step

Choose Include all table fields (Recommend)

SAP Query step by step

2. Editor Infoset

Select necessary field for report by double – click on field. >> Editor information of field. Example: Long text, Header text, … etc … Remove unnecessary field by hold on Ctrl and Left-Click then Right-Click to choose Delete Field (s) from Field Group

Or Additional ABAP code into infoset by Click on Extras >> Choose Tab Code 

SAP Query step by step

In this screen is position of ABAP code in program generate. (Ignore if you don’t want insert ABAP code)

Click on Check Code and Save Code (Ensure system message ‘No syntax errors found’) >> Click on button Save and click Generate infoset.

3. Role/User Group Assignment

Assign this infoset with user group exists or maintain new user group.

How to create user group ?

SAP Query step by step

In screen, click on Role/User Group Assigment. Example, assign for ZPP – PP user group ( Can assign for multiple user group ) >> Click Save

Go to transaction code: SQ02 >> Choose Tab Environment >> Choose Query Areas >> Choose Standard Client ( Client Specific ) >> Choose again Tab Environment >> Choose User Groups

SAP Query step by step

Click Create >> Fill description of User Group and Click Save.

4. Create SAP Query for recently Infoset.

Go to transaction code: SQ01 >> Click Others User Group

SAP Query step by step

Choose user Group ZPP

Fill name of query >> Click Create

SAP Query step by step

Fill Title Notes of Query, List format, Standard Variant, Output format …etc…

> Click on Basic list >> Design Layout for Report

5. Design Layout for Report

Default system will give you Field Group ‘ Additional Fields ‘ contain Text Fields. Example: Main Field Group contain Material Code – Additional Fields will get Material Description

Check to Choose Parameter Field ( Field will appearing on the selection-screen )

Check to Choose Fields displayed in list ( Fields will appearing on the result report )

List Field Color by Click on field in Layout then Choose color of list field.  >> ApplySAP Query step by step>> Save >> Back to Screen Create Query >> Click Test to test Report.

SAP Query step by step

6. SAP Query Transaction Code Assignment

There are two methods to assign SAP query with Transaction Code.

Method 1 (Recommend)

Go to transaction code: SE93

SAP Query step by step

Fill name of Transaction Code. Example: ZPP_R001 >> Click Create >> Choose Program and selection screen (report transaction) >> Enter

SAP Query step by step

Fill Transaction Text, Program: START_REPORT, Selection Screen: 1000, Check GUI support for HTML, Java, Windows.

Save on request and package and insert default values 

D_SREPOVARI-REPORTTYPE AQ
D_SREPOVARI-REPORT ZPP
D_SREPOVARI-EXTDREPORT ZPP_R001

Method 2

In screen Query, Choose tab Query >> More functions >> Display Report Name

Go to transaction code: SE93 

Fill transaction text, Paste program generated from query. Selection screen: 1000, …

Save on request and package to finish

Note: If this transaction code transport to difference client. Program will regenerated automatically and it’s not like old program >> Error when exucute transaction code.

How to display all transaction code use SAP query in sytem ?

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here