‎2008 Jan 16 12:11 PM
hi
my requirement is i have to exculde the Z2 and Z5 in mstae field. is the follwing select query is correct,
please tell me how to use mstae ne z2 and z5 in one statement insted of using in following manner.
select matnr
mstae
from mara
into table gt_mara
where matnr EQ ms_matnr
and mstae ne 'Z2'
and mstae ne 'z5'.
‎2008 Jan 16 12:15 PM
avoid using negative selects for performance reasons....
so proceed this way....
select matnr
mstae
from mara
into table gt_mara
where matnr EQ ms_matnr.
if sy-subrc = 0.
delete gt_mara where mstae = 'Z2' or mstae = 'Z5'.
endif.
Regards
Vasu
‎2008 Jan 16 12:17 PM
HI Hemal.
Please refer below piece of code
select matnr
mstae
from mara
into table gt_mara
where matnr EQ ms_matnr
and mstae not in ( 'Z2', 'z5').
Piyush
Reward points, if helpfull