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: 

related to conditional operator

former_member206396
Active Participant
0 Kudos

hai SDNs,

in select stmt or delete stmt in where clause i have condition like this:

need the somes values based on condition "A" is in the range 10 - 1000.

how to write it in where clause...

what is the operator or any alternative???

thanking you,

5 REPLIES 5

Former Member
0 Kudos

You should use BETWEEN operator OR you can use RANGES / SELECT-OPTIONS if you are writing this in ABAP.

SELECT * FROM MARA WHERE MATNR BETWEEN '1' AND '10000'.

T_RANGES-SIGN = 'BT'.

T_RANGES-OPTION = 'EQ'.

T_RNAGES-LOW = '1'.

T_RANGES-HIGH = '1000'.

APPEND T_RANGES.

SELECT * FROM MARA WHERE MATNR IN T_RANGES.

Regards,

Ravi

Note : Please mark all the helpful answers

dani_mn
Active Contributor
0 Kudos

Hi,

Use 'BETWEEN'

OR 'IN'

Regards,

Wasim Ahmed

Former Member
0 Kudos
ranges : r_value for ser03-ANZSN.

r_value-sign = 'I'.
r_value-option = 'BT'.
r_value-low = '10'.
r_value-high = '1000'.
append r_value.

select fld1 fld2
       into itab
       from dbtab
       where a in r_value.

aris_hidalgo
Contributor
0 Kudos

Hi,

You could define a range then in your select statement put it in your where clause. And like others have said, you can make use of the between statement. Below is an example of a range in select statement:

SELECT bukrs butxt FROM t001

INTO TABLE it_search_help

WHERE bukrs IN ('GLOB', 'GXCH', 'INOV').

Regards!

P.S. Please award points for useful answers.

former_member188685
Active Contributor
0 Kudos

Hi,

You can do that with the help of Ranges.

RANGES: R_VBELN FOR VBAK-VBELN.
R_VBELN-LOW = '0000000010'.
R_VBELN-HIGH = '0000001000'.
R_VBELN-SIGN = 'BT'.
R_VBELN-OPTION = 'EQ'.
APPEND R_VBELN.

select * from vbak into t_vbak where vbeln in r_vbeln.

Regards

vijay