10-10-2014 7:43 AM
We use MB52 to display the stock of one whole plant,which means we don't use the material number as the input Arguments.The Performance is so poor that most of the cases lead to runtime error 'TIME_OUT'.Some experts suggested copy the RM07MLBS to a Z_XXX in which replace the table MARD with MARA in line 1127,which the ABAP code is as below:
* END INSERT n_759412
ENHANCEMENT-SECTION EHP604_RM07MLBS_09 SPOTS ES_RM07MLBS .
SELECT mara~matnr werks xchar mtart matkl meins trame umlmc
bwesb glgmg "AC0K020254 "912093
mara~lvorm AS lvorm_mara
marc~lvorm AS lvorm_marc
INTO CORRESPONDING FIELDS OF TABLE t_mat
FROM mara INNER JOIN marc
ON mara~matnr = marc~matnr
WHERE mara~matnr IN matnr
AND werks IN werks
AND mtart IN matart
AND matkl IN matkla
AND ekgrp IN ekgrup.
END-ENHANCEMENT-SECTION.
There would be some difficulty with this solution:
1,The 'ENHANCEMENT-SECTION' can't be copied.
2,there are some fields not included in MARD which is included in MARA,like MTART KATKL.
3,We had discussed it with our PM,who suggested not use the tables MARD,MSPR &etc since we don't know the detailed logic in MB52 and may be there would be some dirty records in those tables.
So I wonder if there are any other solutions?My MB52 selection screen see my attachment.Thanks in advance.
10-10-2014 7:52 AM
Hi Yunze,
Well MB52 is a standard report to fetch the stock plantwise however you can try,
1. MD04.
2. MMBE (material wise stock)
3. MC.1,MC.9
Regards,
Sagnik.
10-10-2014 9:56 AM
Hi Sagnik,
What I wanna is that I just only enter the 'plant' to select the whole stock of the plant,what you gave to me can't fit my demand with which there is no data found or the material is the required input.
10-10-2014 9:19 AM
Talk with your basis admins, they can create a performance trace and they should be able to create a new index that better suits your requirement.
If you get time-outs then you should run the report in background anyway.
10-10-2014 10:00 AM
Hi Jürgen,
There is a index in MARC within field 'WERKS' since it's the third filed of the Primary key.So this Isn't the correct solution,thanks Anyway.
10-10-2014 10:13 AM
In my opinion you would need an index that is like
WERKS, MATNR to have a fast selection when you only enter the plant.
if the index is MATNR, WERKS, then SAP has to read all materials and to select only those which fits to the correct plants. So it is reading many more data than it is needed.
10-11-2014 2:39 AM
Anyway there is a SAP standard index 'WRK'(MANDT+WERKS),I may suppose this is suitable for my situation.However,it's slow anyway.
10-11-2014 7:36 AM
To summarize your query: you are looking for a way to get a stock report without even accessing the stock tables.
"Z_XXX in which replace the table MARD with MARA"
" our PM,who suggested not use the tables MARD,MSPR"
10-11-2014 9:45 AM
10-11-2014 9:48 AM
10-11-2014 4:07 PM
The first thing to do if you have timeouts, is to run the report in background instead in foreground.
(Unfortunately you did not even tell how much materials you have in your system)
Further you should analyse if your selection suits really the requirement.
E.g. you are including special stock (e.g. consignment, sales order stock, project stock, subcontractor stock). All these stock types are held in different tables. So you know your situation best, if you do not have such special stocks then you should not include it into the selection. If you have for example only subcontractor stock then you should restrict the special stock selection to this stock type.
Then you should check SAP marketplace if there are performance notes for this report,
you may even open a message yourself and let SAP analyze if it is dramatically poor.
In-transit stocks are stored in MARC, excluding MARC from the program would exclude this stock type too. I am not sure if you can even imagine how many stock tables SAP has and has to check if you run the report almost unrestricted. See Stock Tables and Stock Types - ERP SCM - SCN Wiki