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

ABAP Query

Former Member
0 Likes
641

Hi,

I created abap query with two tables but i want to mention some conditions ysing where.

SELECT * FROM Table INTO TABLE IT_ZSM

where TARIFTYP in ('PEBGMD',

'PPMD',

'PEBPMDRC',

'PETC',.

this where condition , how should i define in SQ02

Thanks

5 REPLIES 5
Read only

Former Member
0 Likes
611

Sorry, but your question is not clear.

What do you need to do inside SQ02?

Regards.

-Rafael Rojas-

Read only

0 Likes
611

Here my requirement is

developing abap query with two tables but one table has condition to restrict limited records based on where condition,

in select statment where condition will be there, but in SQo2 is there any option to mention where condition values.

Thanks

Read only

0 Likes
611

Well, I think you should use an ABAP program to select information instead of build an Infoset through SQ02 transaction.

See the following link [SAP Query (BC-SRV-QUE) Retrieving Data with Programs|http://help.sap.com/saphelp_46c/helpdata/en/d2/cb45b2455611d189710000e8322d00/content.htm]

By the way, your 0 Forum Points does not help so that others are interested in answering your questions.

Regards.

Rafael Rojas.

Read only

0 Likes
611

Hi Sonarali

Maybe you could try this

Let's say you have two tables VBAK and VBEP defined in your Infoset.

Now what the ABAP Query does basically is to generate a report which has a SELECT ENDSELECT LOOP.

like this


SELECT VBAK~ERDAT VBAK~VBELN ....... VBAP~POSNR VBAP~VBELN VBAP~MATNR ....
INTO ( VBAK~ERDAT VBAK~VBELN ....... VBAP~POSNR VBAP~VBELN VBAP~MATNR .... )
FROM VBAK INNER JOIN VBAP
ON VBAK~VBELN = VBAP~VBELN
WHERE ...... (this has the conditions fom the selection screen)

************************************
"Filter Code
"Now what you can do is to put a code between this SELECT and ENDSELECT to filter out values you don't want.
"Say
IF VBAK~VBELN = '13432435345'.
CONTINUE.
ENDIF.
************************************

ENDSELECT.

To put the code go to SQ02, go to the Code tab and select the record processing section from the drop down list.

Write your filter code here.

However it'd be better if you could make a report program to do all this.

Pushpraj

Read only

Former Member
0 Likes
611

SQ02 will help you to create infotype. Using SQ01 you can give these values. Refer help to know more

You can also provide select option on the screen , with these four values.

Edited by: harsh bhalla on Sep 17, 2009 9:17 AM