‎2007 Feb 27 2:13 PM
hello every one,
can anyone tell me how to write the code for .....I have one custom table called zxyz haveing matnr(model no:1) and having zmatnr(model no:2)...
so I need to write code for total items should not exceed 06....the combination must like matnr = 1 zmatnr =5
matnr = 2 zmatnr =4
matnr = 3 zmatnr =3
matnr = 4 zmatnr =2
matnr = 5 zmatnr =1
matnr = 6 zmatnr =0
I need to build this logic in code......i have fields in my table are........matnr, zmatnr, combination and quantity........and I need to relate with xvbap in mv45afzz and this table.........
Thanks in advance,
Madhu.
‎2007 Feb 27 2:17 PM
Hi Madhu,
From the information you provide, it looks like you cannot filter at the select statement level.
YOu have to process at the internal table level.
select matnr zmatnr into table itab where...
loop at itab.
v_total = itab-matnr + itab-zmatnr.
if v_total <> 6.
delete itab index sy-tabix.
endif.
endloop.
Method 2)
Have a field total in the z table.
This total should hold the total of the matnr and zmatnr at the time of saving the data to this table.
then you can simpley write a select statement based on this field
select * from zabc into table itab where total = 06.
Regards,
Ravi
‎2007 Feb 27 2:17 PM
Hi Madhu,
From the information you provide, it looks like you cannot filter at the select statement level.
YOu have to process at the internal table level.
select matnr zmatnr into table itab where...
loop at itab.
v_total = itab-matnr + itab-zmatnr.
if v_total <> 6.
delete itab index sy-tabix.
endif.
endloop.
Method 2)
Have a field total in the z table.
This total should hold the total of the matnr and zmatnr at the time of saving the data to this table.
then you can simpley write a select statement based on this field
select * from zabc into table itab where total = 06.
Regards,
Ravi
‎2007 Feb 27 2:26 PM
Hi Madhu,
Both options given in previous answer are perfact. Please close the forum and reward point to him
Darshan