I have a performance issue. I have to write a report to display items without goods receipt in the last 30 days. Tha only way I could do it was to select ALL active materials , store the results in an internal table and then loop on that internal table and check in MSEG if there is an goods receipt for each material. If I found a goods receipt for the current material I delete that item from the internal table. If not, skip to the next record.
This works fine, but it takes very long to do it. Is there another way ?
Ok, Lets go teh same way for step one.
1.Collect all teh active materials say itn otabel it_matnr.
2. Now at step to collect all the materials from MSEG where Movment type is 101 int ot ranages say r_matnr
where mobtyp = 101
r_sign = 'I'.
r_option = 'EQ'.
Now step 3.
Delet it_matnr where matnr in r_matnr.
you will be left out with material that dont have movemnet type 101.
Idea is to use ranges and delete at oen shot instead of loop.
Please check this , i hope it should help.