Thursday, May 5, 2016

SAP Query Tutorial

SAP Query is SAP’s tool to define and execute once own reports without knowing ABAP programming language.

The whole process comprises of 3 steps:
- First create an user group SQ03.
- Second, create an infoset SQ02.
- Third, create a query SQ01.

Now let's go into details of each step:
  • Create a user group SQ03
    • The technical definition of “User Groups” is a collection of SAP users who are grouped together.
    • A user’s assignment to a user group determines which queries he or she can execute or maintain. Additionally, it designates which InfoSets the user can access.
    • Basically, Query Groups permit users to create, modify, and execute reports in a certain area within R/3.


  • Create an Infoset SQ02
    • An InfoSet describes which fields of a data source can be reported on in queries. InfoSets are assigned to user groups.
    • Steps:
      • Navigate to the Infoset Initial screen using transaction code SQ02. Type the InfoSet name that you will be creating, ZMYINFOTEST, and select the Create button.
      • Type the name of the infoset, e.g. TEST FOR INFOSET. Choose the data source and press ok button.
      • You will be provided with a screen as shown below. Select insert table icon in application tool bar. A popup will appear, give the table name to be inserted and select OK button.
      • For maintaining the infoset, click on Infoset button. A popup opens asking what fields should be there in field groups. Select radio button Create empty field groups and press Ok.
      • Two empty field groups got created. In the left pane, we find the list of fields in the tables we insert as previous steps.
                       
  • Drag and drop the fields from the left pane onto the field groups.
  • You can also add codes into the program when neccessary. Choose Extras → Code, select appropriate section/event to put the code in.
  • Next, you need to generate the InfoSet by selecting the Generate button (the red beach ball) from the application toolbar. A message appears in the status bar saying that the InfoSet ZMYINFOSET generated.
  • Go back to the main screen of SQ02 by clicking Back Button on standard toolbar. Click on Role/User Group Assignment button to assign the infoset to a specific user group.
  • Create a query SQ01
    • The InfoSet Query is designed for basic users to retrieve simple single-use lists of data from your database.
    • Unlike the SAP Query all query information - including the selection criteria for InfoSet Query reporting - is available on a single screen.
    • Steps:
      • Navigate to the Queries Initial screen using transaction code SQ01. (to display the queries of an user group, you first enter that user group in tcode sq03, then you can see its query in tcode sq01.)
      • Give ZINFO_QUERY as Query Name and Click on InfoSet Query button. You are prompted to select your InfoSet (data source) from a dialog box.
      • If you want to look up for InfoSet of a Query (which was already assigned to InfoSet), you can find it at the column InfoSet from the display list.

  • The main screen of the InfoSet Query appears. The main screen contains three areas: The actual InfoSet from which you select and choose your fields, the sample report display, and the Selection screen values.
  • For creating your report, check the Output box next to each field.
  • Choose fields for the Selection screen by marking Selection check box, and click the output button to execute the report.

No comments:

Post a Comment

SAP giới thiệu mã hỗ trợ AI trong ngôn ngữ ABAP riêng của mình

SAP đã ra mắt một loạt tính năng mã hỗ trợ AI trong môi trường phát triển ứng dụng dựa trên đám mây của mình, đồng thời tham gia vào danh sá...