cancel
Showing results for 
Search instead for 
Did you mean: 

MRP User Exit based on MRP controller not working properly?

rashid_ali2
Explorer
0 Kudos

Hi All,

I am running MRP both Forecast based and CBP, we are using the user exits to control the MRP for diff material types by assigning MRP Controllers for each material type, the user exit is controlled by conditions based on MRP controllers. Now the prob m facing is, as i run MRP by user exit, it plans not only the intended Materials but also planning few of the other materials, i have thoroughly checked all the material master settings in MRP views, and the user exit too. but cud not find anything that cud have lead me to the solution.

Please help me out, thank in advance.

Regards

Rashid

Accepted Solutions (1)

Accepted Solutions (1)

rashid_ali2
Explorer
0 Kudos

Thanks Vivek & Jeevan for your prompt response,

here is the include programm that i hv been using in my user,

IF user_key = 'B01' AND user_par = 'B01'.

IF mt61d-dispo = 'C00' OR mt61d-dispo = 'C01' OR mt61d-dispo = 'C03' OR mt61d-dispo = 'C04' OR mt61d-dispo = 'C05' OR mt61d-dispo = 'C06' OR

mt61d-dispo = 'C11' OR mt61d-dispo = 'C12' OR mt61d-dispo = 'C13' OR mt61d-dispo = 'C14' OR mt61d-dispo = 'C15' OR mt61d-dispo = 'C21' OR

mt61d-dispo = 'C22' OR mt61d-dispo = 'C23' OR mt61d-dispo = 'C24' OR mt61d-dispo = 'C25' OR mt61d-dispo = 'C31' OR mt61d-dispo = 'C32' OR

mt61d-dispo = 'C33' OR mt61d-dispo = 'C34' OR mt61d-dispo = 'C35' OR mt61d-dispo = 'C41' OR mt61d-dispo = 'C42' OR mt61d-dispo = 'C43' OR

mt61d-dispo = 'C44' OR mt61d-dispo = 'C45' OR mt61d-dispo = 'M01' OR mt61d-dispo = 'M02' OR mt61d-dispo = 'M03' OR mt61d-dispo = 'M04' OR

mt61d-dispo = 'M05' OR mt61d-dispo = 'B02' OR mt61d-dispo = 'B03' OR mt61d-dispo = 'B04' OR mt61d-dispo = 'B05' OR mt61d-dispo = 'B06'.

  • break abapdev.

no_planning = 'X'.

ENDIF.

ENDIF.

the same has been programmed for all of the MRP controllers,

and following are the user exit keys ...

B01

B02

C01

C02

C03

C04

C05

C06

M01

M02

i have already checked the user exit and the user exit keys in SPRO, as well as the material master for these MRP controllers, but i m surprised to see some other MRP controller materials are being planned in MD01 while running the MRP for a certain MRP controller and the relevant User Exit key.

for example when i run MD01 for key C06 it plans not the C06 materials but also some of the materials for C01(finished goods MRP Cont) and C02(Semi Finished MRP Cont) which is really surprising for me.

Hope the above information can give u a better picture of the problem.

Looking forward....

Rashid

Former Member
0 Kudos

2 things:

1. Check if there is any other MRP job being executed which is planning these materials.

2. For the code which you have pasted i.e. user_key = 'B01' AND user_par = 'B01', is the expectation only to plan MRP controller - B01 ? If yes, then check the code, you are not excluding C02. Likewise check the code for others.

(Also put a breakpoint at the IF statement to see which condition is failing to allow the planning for material which you do not expect).

Check & revert.

sjeevan
Active Contributor
0 Kudos

If you look at the code you mentioned, executing for user key B01 will also execute C02 (it's missing). Check if you missed out those MRP Cont. codes?

I would suggest you to use this logic as it is less confusing.


CLEAR: no_planning, stop_planning.

  IF user_key = 'B01'.
    IF mt61d-dispo = 'B01'  . "Include only MRP Controller Code B01 in planning
    
  ELSE.
      no_planning = 'X'.         " Exclude all other MRP Controller Code materials.
    ENDIF.
  ENDIF.

Answers (5)

Answers (5)

rashid_ali2
Explorer
0 Kudos

Vivek,

it is including all the mrp controllers but was not considering the MRP type PD pr VB, i have added this condition in my code, now it is working fine,

Thanks for your kind support.

hope to see again in future

Rashid

rashid_ali2
Explorer
0 Kudos

I am intending to plan B01 only but when i do this, it plans, C02 as well, thats the problem, okay let me try the logic u mention in ur last reply.

Former Member
0 Kudos

The reason it is planning C02 is because the code which you've pasted earlier is not excluding it.

Include C02 in your code & it wont plan.

Hope it clarifies.

rashid_ali2
Explorer
0 Kudos

1. Ans is NO.

2 i hve checked as u said, everything is line, but even then it is planning the unintended MRP controller Materials.

Thanks

Former Member
0 Kudos

For point - 2, you do not clarify whether you intend to plan B01 & C02 at the same time. Alternatively can you let us know do you intend to plan only 1 MRP controller at a given time?

sjeevan
Active Contributor
0 Kudos

Go to SE37 and enter the following exits names and get an idea of the ABAP code

EXIT_SAPMM61X_001

EXIT_SAPLM61C_001

In the ZX includes abap code will look something like this (you can just double click on the include name).


 CLEAR: no_planning, stop_planning.
  IF user_key = 'KEY1'.
    IF mt61d-dispo = 'XYZ'  . "Include only MRP Controller Code XYZ from planning
    
  ELSE.
      no_planning = 'X'.
    ENDIF.
  ENDIF.




  IF user_key  = 'KEY2'.         
    IF mt61d-dismm = 'PD'.  "Exclude MRP Type PD only during planning run
   
      no_planning = 'X'.
    ENDIF.
  ENDIF.

The user_key is maintained in IMG

In the above example let us say you set background jobs using KEY1 (lets say JOB1) and other using KEY2 (JOB2), if a material has both MRP Controller code XYZ and MRP Type PD it got executed in JOB1 itself already, though it got excluded in the JOB2.

Edited by: Jeevan Sagar on Nov 3, 2011 11:35 AM

Former Member
0 Kudos

With the info you've provided the forum would not be in a position to provide a meaningful response.

Do provide details of what you have written in the enhancement (preferably paste the code), how you're executing MRP run, if possible upload a screenshot to some portal & paste the link here.