03-12-2010 2:57 AM
Hi,
In my scenario, I need to get material's last posting date of issuing to production order (e.g. mov. typ. 261).
I tried to select the material documents whose movement type is 261, and restrict the posting date from month to month each time, until the first material document is selected.
But this method seems quite inefficient.
What kind of algorithm is more effient to do this?
Thanks
Wesley
03-12-2010 11:32 AM
Hi,
select max( budat )
from mkpf
into gv_budat
where mblnr in ( select mblnr
from aufm
where aufnr = gv_aufnr "(Prod. Order)
and matnr = gv_matnr "(Issued Material)
and bwart = '261' ).
Edited by: Azeem Ahmed Matte on Mar 12, 2010 12:33 PM
03-16-2010 1:30 AM
Thanks, Azeem.
Our users only enter material no. instead of production order no.
But the 'MAX' function is quite useful.
Now I can set the code.