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

Equivalent select statement for complex selection

Former Member
0 Likes
940

HI,

What is the equivalent select statement for below mentioned condition.

SELECT-OPTIONS : SALEDOCU FOR VBAK-VBELN OBLIGATORY,

DATE FOR VBAK-ERDAT OBLIGATORY,

CHANEEL FOR VBAK-VTWEG,

SALETYPE FOR VBAK-AUART OBLIGATORY DEFAULT 'QT'

NO INTERVALS NO-EXTENSION.

Regards,

John.

8 REPLIES 8
Read only

FredericGirod
Active Contributor
0 Likes
923

mmmh, what do you means with equivalent select ?

select * from vbak
       where vbeln in saledocu 
       and   erdat in date
       and   vtweg in chaneel
       and   auart in saletype.

endselect.

??

Rgd

Frédéric

Read only

Former Member
0 Likes
923

Hi john,

1. we can use like this :

2.

DATA : itab LIKE TABLE OF vbak WITH HEADER LINE.

SELECT * FROM vbak

INTO TABLE itab

WHERE vbeln IN saledocu

AND audat IN date

AND vtweg IN chaneel

AND auart in saletype

regards,

amit m.

Read only

Former Member
0 Likes
923

Hi,

Select * from VBAK into table it_vbak

where vbeln in SALEDOCU

and ERDAT in DATE

and AUART in SALETYPE

and VTWEG in CHANEEL.

Regards,

GSR.

Read only

Former Member
0 Likes
923

Hi john dias

select * from vbak where vbeln in saledocu and erdat in date and vtweg in chanel and auart in saletype.

you can use AND or OR as per requirement.

regards

kishore

Read only

Former Member
0 Likes
923

hi john,

Could you be please clear about ur question.

What i understand is ur looking for a select query using the above selection screen parameters.

You can use Array fetch by doing:

select * from vbak into table it_vbak

where vbeln in saledocu

and erdat in date

and vtweg in chaneel

and auart in saletype.

Cheers

Sunny

Read only

Former Member
0 Likes
923

hi,

you can use following code.

tables vbak.

data : begin of t_vbak occurs 0.

include structure vbak.

data : end of t_vbak.

select * from vbak into table t_vbak where

vbeln in saledocu and

erdat in date and

vtweg in chaneel and

auart in saletype.

Hope this helps.

Regards,

Shashank

Read only

vinod_gunaware2
Active Contributor
0 Likes
923

Hi

use In operation in where condition of select.

regard

vinod

Read only

Former Member
0 Likes
923

tables : vbak.

start-of-selection.

select * into table itab from vbak

where vbeln in saledocu

and erdat in date

and vtweg in channel

______________________

and auart in saletype

_______________________

*or u can use as

select * into table itab from vbak

where vbeln in saledocu

and erdat in date

and vtweg in channel

________________________

and auart = 'QT'.

_________________

regards,

vijay.