cancel
Showing results for 
Search instead for 
Did you mean: 

add multiple document types in select query

0 Kudos

hi,

I want to put a condition for alv report . need to maintain data from 4 document types (BLART) from bsis and bsak. I'm trying to add the condition in select query. Where BLART = 'KE' & 'RN' & 'Z5' & 'KZ'.

but it takes only first document in type 'KE' only.

how to maintain these documents types. how to declare this..tried multiple ways..please help on this.

vijay_hariharan
Contributor
0 Kudos

Hi Vinay,

Not sure if you are writing queries for the first time but there are a lot resources available on the internet that could help you learn how to query/code within ABAP. You may also familiarize yourself with the new ABAP Syntax on the below blogs:
https://blogs.sap.com/2015/10/25/abap-740-quick-reference/

https://blogs.sap.com/2016/03/02/old-and-new-abap-syntax-overview-sheet/

These of-course do not cover everything but are a very good resources to get started

All the Best!

Regards,
Vijay

Accepted Solutions (0)

Answers (1)

Answers (1)

BhargavaReddy
Active Participant

1> Try OR operator like

Where BLART = 'KE' OR 
BLART = 'RN' OR
BLART = 'Z5' OR
BLART = 'KZ'.

2> Try Range table

DATA  ltr_blart_range TYPE RANGE OF blart. "<DataElement>
ltr_blart_range = VALUES #(
( sign = 'I' option = 'EQ' low = 'KE' )
( sign = 'I' option = 'EQ' low = 'RN' )
( sign = 'I' option = 'EQ' low = 'Z5' )
( sign = 'I' option = 'EQ' low = 'KZ' )
).
Select * from <db>
Where BLART IN ltr_blart_range.