05-29-2006 7:09 AM
Hello,
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 ?
05-29-2006 7:22 AM
George,
Is your requiremnt Different than what MB51 Transaction does?
Have a look into it.
Regds,
Mano Sri
05-29-2006 7:13 AM
Hi George,
Use the following :
DELETE itab WHERE good_receipt IS INITIAL.
<b>Reward points if it helps.</b>
Regards,
Amit Mishra
05-29-2006 7:22 AM
George,
Is your requiremnt Different than what MB51 Transaction does?
Have a look into it.
Regds,
Mano Sri
05-29-2006 7:48 AM
Yes, I have to display the materials with no moovement type 101 in the last 30 days.
05-29-2006 7:58 AM
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
soemthing like
select matnr
from mseg
into r_matnr-low
where mobtyp = 101
r_sign = 'I'.
r_option = 'EQ'.
append r_matnr.
endselect.
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.
Rgds,
Mano Sri