2005 Mar 31 7:49 AM
Developing a report where have to read material documents for a given Valuatiuon class & business area .
For this first reading table MBEW. After getting material numbers for the given valuation class reading table MSEG for selected material nos & given Business area.
But its taking lot of time.
Is there any other way out to derive this info.
pls help.
thanks a lot.
2005 Mar 31 8:08 AM
Hi,
It is going to take a lot of time. Users should be restricting it with some other filters (eg Material doc date) which shall give you an alternate DB selection path (MKPF onwards).
Minor improvement can be had by using performance improvement techniques (read all MBEW in an indexed itab, do a 'for all entries in' for MSEG, etc).
cheers.
Ajay
2005 Mar 31 8:21 AM
I suspect the time is being spend reading MSEG, there is a native index supplied by SAP and it is M - Material documents by Material it has the following fields in it
MANDT
MATNR
WERKS
LGORT
BWART
SOBKZ
your could try supplying some of these in you code for you read on MSEG.
Alternatively create a new index for your specific fields but there are drawbacks with this approach.
Regards
Dave
2005 Mar 31 9:48 AM
Hi,
Please see that table EKBE can help you out in your problem. From MATNR you can get MBLNR from EKBE, from that MBLNR you can access more info from MSEG that will be faster than the present one.
BR
Sandeep
2005 Mar 31 9:58 AM
Don't use EKBE, as EKBE is a table used for the history of Purchasing Documents only. This does not display all Material documents (MBLNR) as there are MBLNR for reasons other than purchase documents. eg: Stock movements, issues to orders, issues to projects etc...
Dave