Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Use of SQ01, SQ02, SQ03

Former Member
0 Kudos

Hai All,

May i know that what is the use of SQ01 , SQ02, SQ03.How to use this ? How to create it ? Can we write our requirement in this ( addition to generated one )?

Plz rely .

Thanks & Regards

Prashanth

Message was edited by: Prashanth Konda

5 REPLIES 5

Former Member

andreas_mann3
Active Contributor
0 Kudos

hi,

look here:

A.

dani_mn
Active Contributor
0 Kudos

SQ03 : is used to create user groups for queries because every user have to be in atleast one user group for creating infoset and queries. you have to create a user group and assign your user to that usergroup.

SQ02 : is used to create infoset you need to tell the data source for your infoset like table join, direct read or data reterival using program, you can also put extras fields, structures and tables using extras button. and can code your own select query for that field or structure.

After generating the infoset you have to assign this to your usergroup you already created.

SQ01 : is used to create Query form infoset you have created here you can select fields for selection screen and for list generation using check boxes.

you can generated different types of report using basic list, ranked list, statistics to output in graphical form.

Regards,

Wasim Ahmed

Message was edited by: Wasim Ahmed

Former Member
0 Kudos

Hello Prashanth,

This was originally developed for the functional people or the end user to write quries to get reports without having to go to a develper and ask for an development. This is a very good tool for developing simple and medium complex reports.

Sq01 - for developing queries which are the output reports.

sq02 - for developing infoset which is nothing but extraction logic.

Sq03 - this is used to define user groups which group togather users to work on infoset assigned to the group.

Bema
Active Participant
0 Kudos

Check this link

www.sappoint.com/abap/ab4query.pdf

Example

To write ur requirement choose the option

Data retrieval by program in SQ01.

First Step is to create a dictionary structure . Include all the fields in this structure that you want to output.

Then create a report program having the following structure .

Report XXX .

TABLES tab . Declare the already created dictionary structure also here.

Parameters x . Define parameters here

Select-Options:…….

DATA :…..

DATA : BEGIN OF itab OCCURS xxx

END OF itab. Structure tab to hold the records to be evaluated.

*<Query_head> This comment must always appear after your data declarations

  • Code to define the table itab

Loop to retrieve each record and place it in itab.

SELECT,DO, LOOP ,….

If necessary , code to format data

*<Query_body> This comment must always be the last statement in the loop.

End of loop

ENDSELECT , ENDDO, ENDLOOP ,…

Following is an example report program. Here youtput_struct is the dictionary structure.

REPORT yqueryprg .

TABLES: bkpf,youtput_struct.

DATA : BEGIN OF itab OCCURS 0,

belnr LIKE bkpf-belnr,

gjahr LIKE bkpf-gjahr,

monat LIKE bkpf-monat,

bukrs LIKE bkpf-bukrs,

END OF itab.

SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-t01.

PARAMETERS: p_code LIKE bkpf-bukrs.

SELECTION-SCREEN END OF BLOCK input.

*Query head

  • <Query_head>

Start-of-selection.

SELECT belnr gjahr monat bukrs FROM bkpf INTO TABLE itab

WHERE bukrs = p_code.

LOOP AT itab.

CLEAR youtput_struct.

MOVE itab TO youtput_struct.

  • Query body

  • <Query_body>

ENDLOOP.

Save and Activate this report.

Then go to SQ02 transaction to create an infoset.

Select the option Data retrival by program

Enter datastructure name

Choose External program name as your report name.

Infoset ->Generate.

Go to SQ03 to create a user group.

Enter user group name and click on Create button.

Enter description and save it in your development class.

In the next screen , click on ‘Assign Infosets’ button.

Here you select the infoset that you have created

Save it.

Go to SQ01. Select the user group that you have created.

Then enter the query name and create. It will show the list of infoset that you have created. Choose the infoset you want.

Choose BasicList Button.

In the right side of the screen you adjust the output field width, background color etc.

Go back and select the menu option Query -> Generate Program.

Then Execute this Query.