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

regarding or condition in select statement

Former Member
0 Likes
684

Hi,

i have an error with folowing statement tcode = ( 'ME22N' or 'ME23N' AND CHNG_IND = 'U' ).

this is gibing and eror please suggest.

SELECT * FROM cdhdr INTO TABLE t_cdhdr1

WHERE objectclas = 'EINKBELEG' AND

objectid = t_ekko-ebeln AND

tcode = ( 'ME22N' or 'ME23N' AND CHNG_IND = 'U' ).

Hi,

i have an error with folowing statement tcode = ( 'ME22N' or 'ME23N' AND CHNG_IND = 'U' ).

this is gibing and eror please suggest.

SELECT * FROM cdhdr INTO TABLE t_cdhdr1

WHERE objectclas = 'EINKBELEG' AND

objectid = t_ekko-ebeln AND

tcode = ( 'ME22N' or 'ME23N' AND CHNG_IND = 'U' ).

4 REPLIES 4
Read only

amit_khare
Active Contributor
0 Likes
662

Will this work -

*SELECT * FROM cdhdr INTO TABLE t_cdhdr1*

WHERE objectclas = 'EINKBELEG' AND

objectid = t_ekko-ebeln AND

( tcode = 'ME22N' or

tcode = 'ME23N' ) AND

CHNG_IND = 'U' .

also, check its CHNG_IND or CHANGE_IND.

Read only

0 Likes
662

i have tried like this but it doesn't work

SELECT * FROM cdhdr INTO TABLE t_cdhdr1

WHERE objectclas = 'EINKBELEG' AND

objectid = t_ekko-ebeln AND

tcode = ( 'ME22N' ) or

( 'ME23N' AND CHANGE_IND = 'U' ) .

Read only

0 Likes
662

Hi i got it

SELECT * FROM cdhdr INTO TABLE t_cdhdr1

WHERE objectclas = 'EINKBELEG' AND

objectid = t_ekko-ebeln AND

tcode = 'ME22N' or

( tcode = 'ME23N' AND CHANGE_IND = 'U' ) .

Read only

0 Likes
662

Hi,

Try this one.

SELECT * FROM cdhdr INTO TABLE t_cdhdr1

WHERE objectclas = 'EINKBELEG' AND

objectid = t_ekko-ebeln AND

tcode in ( 'ME22N', 'ME23N' )

AND CHANGE_IND = 'U' .

Regards,

Andre