Hi. in my scenario.
I have to rum mrp for mrp controler.
i ve assigned different mrp controlers based on the catergory of the material.
now i have to run mrp for each mrp controler saperately and automatically every night.
How do i do this.
First of all create a new "User-exit Key" to be used in MD01 screen.
SPRO --> Production --> MRP --> Planning --> User Exit: Material Selection for Planning Run.
Let's say u define key as "Z01" with desc "User exit MRP on controller".
Now ask the developer to implement the user-exit: M61X0001 with user-exit: EXIT_SAPLM61C_001 and EXIT_SAPMM61X_001.
Below is the logic that we have used for user-exit based on MRP Controller. You can reuse some of this.
DATA: FOUND_FLG(1) TYPE C, " X if material controller in parameter
OFFSET TYPE I, " offset into parameter for a controller
TUXPAR LIKE RM61X-UXPAR. " temporary uxpar
CLEAR: NO_PLANNING, STOP_PLANNING.
Check whether the material's controller is specified in the user
parameter. There can be up to nineteen, three-character controllers
in the user parameter field. If the controller is not in the user
parameter, set the no_planning flag to 'X'.
IF USER_KEY = 'Z01'.
UXPAR = USER_PAR.
DO 19 TIMES.
OFFSET = ( SY-INDEX - 1 ) * 3.
TUXPAR = UXPAR+OFFSET(3).
WRITE TUXPAR(3) TO DISPO.
IF DISPO IS INITIAL.
ELSEIF MT61D-DISPO = DISPO.
FOUND_FLG = 'x'.
IF FOUND_FLG = SPACE.
NO_PLANNING = 'X'.