2006 Jun 15 4:10 PM
Hi,
I am suppose to exclude materials starting with INS* and X* , materials ending with *TX or *NP , Procurement key E ,special procurement key 50 and cross-plant status Z8. Before this i am getting these values in an internal table . Later using the values from this table i have to modify another Ztable. How do i do this???I have to get all values in the first internal table and then filter based on the above conditions.Please reply urgent.
Thanks,
Sindhu.
2006 Jun 15 4:19 PM
Sindhu,
If you have this in the internal table.
Prepare a ranges for the materials ..
R_MATERIAL-SIGN = 'E'.
R_MATERIAL-OPTION = 'EQ'.
R_MATERIAL-LOW = 'INS*'.
APPEND R_MATERIAL.
Do this for all the patterns.
Now, you can delete the internal table
DELETE ITAB WHERE MATERIAL IN R_MATERIAL
AND PROCUREMENT_KEY = 'E'..........
Similarly add other clauses as well.
At the end of the DELETE statement your internal will have only the filtered data.
Regards,
Ravi
2006 Jun 15 4:19 PM
Sindhu,
If you have this in the internal table.
Prepare a ranges for the materials ..
R_MATERIAL-SIGN = 'E'.
R_MATERIAL-OPTION = 'EQ'.
R_MATERIAL-LOW = 'INS*'.
APPEND R_MATERIAL.
Do this for all the patterns.
Now, you can delete the internal table
DELETE ITAB WHERE MATERIAL IN R_MATERIAL
AND PROCUREMENT_KEY = 'E'..........
Similarly add other clauses as well.
At the end of the DELETE statement your internal will have only the filtered data.
Regards,
Ravi
2006 Jun 15 4:22 PM
I think this is backwards......
<b>*R_MATERIAL-SIGN = 'E'.
R_MATERIAL-SIGN = 'I'.</b>
R_MATERIAL-OPTION = 'EQ'.
R_MATERIAL-LOW = 'INS*'.
APPEND R_MATERIAL.
Do this for all the patterns.
Now, you can delete the internal table
DELETE ITAB WHERE MATERIAL IN R_MATERIAL
AND PROCUREMENT_KEY = 'E'..........
Since we are deleting what is in the range, the OPTION needs to be I.
Regards,
Rich Heilman
2006 Jun 15 4:20 PM
select *
from dbtab
into table itab
where procurementkey <> 'E'
and special procurement key <> '50'
and cross plantr status <> 'Z8'.
loop at itab.
if itab-matnr cp 'INS' or itab-matnr cp 'X'
or itab-matnr cp 'TX' or itab-matnr cp 'NP'.
delete itab.
endif.
endloop.
modify ztable from table itab.
Regards,
Ravi