Application Development and Automation 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: 
Read only

SQ01- query

Former Member
0 Likes
2,643

Hi

Can anyone tell me how to use this tcode and the steps involved in that

Cheers

Christina

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,088

Hi Lavanya,

Go through the below links , they are very helpfull:

http://allaboutsap.blogspot.com/2007/09/sap-query-step-by-step.html

http://supplychain.ittoolbox.com/groups/groups.asp?v=sap-r3-log-mm&i=783523

SQ01 - Generate query

SQ02 - Creation of infoset and generattion of same

SQ03 - Creation user group and assigning infoset to same.

Have A Nice Day

Chaitanya.

12 REPLIES 12
Read only

bpawanchand
Active Contributor
0 Likes
2,088

Hi

[Step-By-Step Approach|http://www.auditware.co.uk/downloads/SAPQuery_step_thru.pdf]

Regards

Pavan

Read only

Former Member
0 Likes
2,088

hiii

refer to following link for creating ABAP Query

regards

twinkal

Read only

Former Member
0 Likes
2,088

Hi,

Here we will include all of our tables or infotypes that will provide us data for our queries. If you are trying to create queries in HR Module then it is strongly recommended to use a Logical Database to create your queries, because if you are using HR Tables then joining them will be a problem because of date fields (BEGDA/ENDDA).

Logical database will always use inner join and will skip the rows that will not match in corresponding infotypes. For example: You are trying to create a query with Pernr and name from infotype 2 and Work Address from infotype 6. Then the report will not include the persons that do not have a work address. Only employees shown on the report will be those that have a work address subtype of infotype 6 populated. This constraint is usually overlooked and it results in wrong reports.

Steps to create a new infoset using logical database PNPCE:

Go to Transaction SQ02.

1)Give Infoset a description, give source of data for infoset i.e. Logical Database or Tables etc.

2)If you have used logical database e.g. PNPCE then a screen will pop-up to select the infotypes.

3)Select the infotypes and continue.

4)f you later want to add more infotypes then click on menu item u2018Editu2019 -> u2018Change Info-Type Selectionu2019 and add or remove the infotypes.

5)If you have used tables then only give one table name and you will be brought to the screen where you can add more tables and specify joins between tables.

6)To add more tables, click on u2018Join Tablesu2019 and click on u2018Insert Tablesu2019.

7)You can drag and drop the matching field from one table to another to specify joins, you can also change the join type from inner join to outer join.

8)There is an area u2018Field Groupu2019 in infoset screen, only the fields that appear here will be available while creating queries. All fields from infotypes may not be available in field groups, so you will have to manually drag and drop them in appropriate field groups.

9)On the left hand side, under each node of infotype/table you will see some fields in blank or blue text color. Blue fields are those that are included in the infoset and hence available for reporting in SQ01.

10)Save and generate your infoset. This is mandatory, as when you generate the infoset, a program is generated with the code reflecting your changes in infoset.

Read only

Former Member
0 Likes
2,088

Hi,

Here we will include all of our tables or infotypes that will provide us data for our queries. If you are trying to create queries in HR Module then it is strongly recommended to use a Logical Database to create your queries, because if you are using HR Tables then joining them will be a problem because of date fields (BEGDA/ENDDA).

Logical database will always use inner join and will skip the rows that will not match in corresponding infotypes. For example: You are trying to create a query with Pernr and name from infotype 2 and Work Address from infotype 6. Then the report will not include the persons that do not have a work address. Only employees shown on the report will be those that have a work address subtype of infotype 6 populated. This constraint is usually overlooked and it results in wrong reports.

Steps to create a new infoset using logical database PNPCE:

Go to Transaction SQ02.

Give Infoset a description, give source of data for infoset i.e. Logical Database or Tables etc.

If you have used logical database e.g. PNPCE then a screen will pop-up to select the infotypes.

Select the infotypes and continue.

If you later want to add more infotypes then click on menu item u2018Editu2019 -> u2018Change Info-Type Selectionu2019 and add or remove the infotypes.

If you have used tables then only give one table name and you will be brought to the screen where you can add more tables and specify joins between tables.

To add more tables, click on u2018Join Tablesu2019 and click on u2018Insert Tablesu2019.

You can drag and drop the matching field from one table to another to specify joins, you can also change the join type from inner join to outer join.

There is an area u2018Field Groupu2019 in infoset screen, only the fields that appear here will be available while creating queries. All fields from infotypes may not be available in field groups, so you will have to manually drag and drop them in appropriate field groups.

On the left hand side, under each node of infotype/table you will see some fields in blank or blue text color. Blue fields are those that are included in the infoset and hence available for reporting in SQ01.

Save and generate your infoset. This is mandatory, as when you generate the infoset, a program is generated with the code reflecting your changes in infoset.

Read only

0 Likes
2,088

Hi all

Thanx for the reply. it helped me a lot.

I wanted to do a calculation on an existing field and put that result in a new field..

I have created a new field , but when i enter the existing field in the formula part , it is saying some error, fiedl not defined.

But that field is there in the table..

can anyone hwlp me in this.

Cheers

Christina

Read only

0 Likes
2,088

Hi Christina,

Only one question is allowed in one post according to RULES OF ENGAGEMENT.

Please close this thread and post the second question in a different thread.

Luck,

Bhumika

Read only

Former Member
0 Likes
2,089

Hi Lavanya,

Go through the below links , they are very helpfull:

http://allaboutsap.blogspot.com/2007/09/sap-query-step-by-step.html

http://supplychain.ittoolbox.com/groups/groups.asp?v=sap-r3-log-mm&i=783523

SQ01 - Generate query

SQ02 - Creation of infoset and generattion of same

SQ03 - Creation user group and assigning infoset to same.

Have A Nice Day

Chaitanya.

Read only

Former Member
0 Likes
2,088

This message was moderated.

Read only

Former Member
0 Likes
2,088

Hi,

Try the following links,

[www.auditware.co.uk/downloads/SAPQuery_step_thru.pdf]

[www.olemiss.edu/projects/sap/SQ01_10_03.pdf]

Read only

Former Member
0 Likes
2,088

Hi Christina,

Check these links:

http://www.olemiss.edu/projects/sap/SQ01_10_03.pdf

Hope this helps you.

Regards,

Chandra Sekhar

Read only

Former Member
0 Likes
2,088

Hi Christina,

Check this link;-

http://www.auditware.co.uk/downloads/SAPQuery_step_thru.pdf

Best of luck,

bhumika

Read only

Former Member
0 Likes
2,088

Hi Christina.

I would like to suggest a few references,

[SDN Library - Standard Reference for ABAP QUERY at a Glance - Creation Step by Step - Snapshots|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40bec8da-4cd8-2910-27a9-81f5ce10676c]

[SDN Library - Standard Reference for A primer for Queries|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/4662456e-0701-0010-3fb3-f0630b6c17df]

[SDN Weblog - Standard Reference for SAP Adhoc Query SQ01 SQ02 SQ03 Creating|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/10020] [original link is broken] [original link is broken] [original link is broken];

Hope that's usefull.

Good Luck & Regards.

Harsh Dave