‎2007 Oct 18 9:40 AM
please tell me how we can do this in the select query.
select matnr mtart from mara into itab_mara
where matnr = p_matnr
and mtart must be having some value. ie if it is not having any data in that field it should not fetch that record.
so please tell me how to code my above select statement.
I think we should not use like this.....
select matnr mtart from mara into itab_mara
where matnr = p_matnr
and mtart ne space. " it is not recommended i think
‎2007 Oct 18 11:41 AM
select matnr mtart from mara into itb_mara where matnr = p_matnr.
if itb-mtart is not initial.
delete itb_mara.
endif.
endselect.
u can use the above or the one u mentioned. It will suffice I think...
‎2007 Oct 18 2:31 PM
So long as the NE doesn't interfere with the index (and yours doesn't) you should be OK.
Rob
‎2007 Oct 18 2:40 PM
Hi Shiva,
try this.
select matnr mtart from mara into itb_mara where matnr = p_matnr and
mtart ne ' '.
Reward if useful.
Regards,
Chitra
‎2007 Oct 19 8:20 AM
select matnr mtart from mara into itab_mara
where matnr = p_matnr .
if itab_mara[] is not initial.
Loop at itab_mara.
if itab_mara-mtart is initial.
delete itab_mara.
endif.
endloop.
endif.
‎2007 Oct 21 4:35 AM
Hi Shiva,
Your Select statement should only bring back one record.
WHERE MATNR = P_MATNR.
I will assume that your p_matnr is a range table and that it should read
where matnr in p_matnr.
Generally, you want to avoid negatives in your WHERE clause, so in your case you can write it: AND MTART > SPACE.
Hope this helps.
Filler