Skip to Content
Author's profile photo Sharat Sugur

Basic steps of report generation by query with example and scenario

Basic steps of report generation by query with example and scenario:

 

QM Report to get the Vendor name, and DC number for inspection lots by Query:

 

Introduction:

Current QM reports in SAP will provide information with vendor code for inspection lots in QA32 / QA33 transaction. But the fields available in these transactions will not suffice as the missing fields of vendor name and DC number. And many times we need to develop these reports in QM based on different requirements, and most of them can be achieved by this method.

Agenda of sharing this is to, help functional consultant to create Query and transaction on his own and avoid dependency on ABAP. This is an attempt to help people who are not aware of this or needs clarity in the steps. If you feel this is helpful you can rate the document. Thank you.

Scenario is as said below.

Scenario:

For the bought out parts and parts coming from vendor are inwarded with purchase documents along with DC number. And at the same time the information card is printed for these parts and the sheet is attached to the respective storage bin.

QC check can takes place based on the priority and can take minimum 3 to 4 days to visit the particular lot. And at this point of time, QC wants to identify and correlate the parts with inspection lot. And for this QC needs a report which includes Quality inspection lot number, lot quantity, material document, vendor code, vendor name, and DC number.

Such kind of report not available in standard SAP and this can be easily achieved with SAP ABAP Query and a transaction code can be created to serve the purpose by the functional consultant.

Requirements:

Need report of displaying inspection lot details along with vendor details and DC number.

Input selections:

Inspection lot number range

Plant

Inspection lot origin

Output requirement:

Stepwise method to achieve this through query

 

Step1: Create user group in SQ03

Add QM package and save the user group with transport number.

Step 2: Create Info set in SQ02

Add all the required tables with key fields as shown below

Generate the info set as shown below

Save with transport number and below message is received.

Step3: Assign the info set to the user group in SQ02

Step 4: Create Query in SQ01 transaction

Since there is one info set assigned, you can select the same in the pop up message.

Select the field groups

Select the fields

Select the input selection fields with numbering, lower number will be arranged from the top in display

Click on Basic list to select the output fields

Select the output fields as shown below

Click on test to check

Selection screen

Output screen

Save the query

Step 4: Generate the program for the query

Identify the program name in the query

Step 5: Create the transaction in SE93 for the query

Save the transaction.

This completes the requirement.

Disadvantage:

It is not recommended to create T code on the generated program name E.g.: AQZZQM_VEN_RPT==ZQMVEND========). This is because if the Info set Query undergoes any changes, then at least once the Info set query should be executed through SQ01 transaction in production (Generate Query), otherwise the transaction code will still point to the old generated program.

Solution: To avoid above problem for changing info set, we can adopt below method.

Transaction code will be automatically created by system through Area Menu (SE43). This system generated transaction code points to Info set query (standard area / global area) and not the generated program.

Hope this document helps.

Assigned Tags

      11 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Hanumathprasad SAP QM PP
      Hanumathprasad SAP QM PP

      HI Sharat,

            Very useful document you have shared and could please mention the table names and sequence of the tables.

      Author's profile photo Ravi Prakash
      Ravi Prakash

      Very Nice document please keep on posted to share the knowledge. I would to love it if some of PM reports can be also explored.

      Author's profile photo Former Member
      Former Member

      Nice document to create the reports on Functional side.

      Author's profile photo ChennakeshavaRao Chinnam
      ChennakeshavaRao Chinnam

      Nice document.... informative...

      Author's profile photo Former Member
      Former Member

      Well explained and useful for functional people...

      Author's profile photo gopal p
      gopal p

      Nice document very useful for me

      Author's profile photo Krishna Madduri
      Krishna Madduri

      A very useful  document. Thank you for sharing.

      Author's profile photo Former Member
      Former Member

      could you please tell me what are the other tables & fields , you have added in the above info set, in the screen shorts, it is not clear.

      Author's profile photo Darshak Kathiriya
      Darshak Kathiriya

      Hi Sharat,

       

      Thanks for document. I need to add more fields to existing query ( from same tables) but I am getting this error. Can you please advise ?

       

      The query painter cannot be used with this query

      Message no. AQQV081

      Diagnosis

      The query contains elements that are no longer supported in the Query Painter.

      • Multi-line headers
      • Structures in the functional area (enhancement in Basis 4.6C).

      Logical databases with type C nodes (pool type) cannot be processed.

       

      Procedure

      Use the usual maintenance interface to edit the query, and remove any elements that are no longer supported.

       

      Thanks,

      Darshak

      Author's profile photo Former Member
      Former Member

      Hi Sarath,

       

      Very good document.

       

      Keep posting such docs.

       

      Regards

      Syed

      Author's profile photo Venkat Iyer
      Venkat Iyer

      Hi Sir,

       

      Very Nice Blog ..

      Kindly share the document on Email. Id_ shashisapmm1995@gmail.com

       

       

      Regards

      Shashi Maurya