cancel
Showing results for 
Search instead for 
Did you mean: 

MRP run only for certain MRP controllers

Former Member
0 Kudos

Hello all,

we have a daily batch job running with the program RMMRP000.

Now we only want it to run for materials with MRP controllers 001, 002 and 003.

So I have created a variant with user exit key 123 and User exit parameters 001 002 003.

The user exits are active and when I debug it, the program goes to the exit.

I have put this code into these user exits: EXIT_SAPLM61C_001 (INCLUDE ZXM61U02) and EXIT_SAPMM61X_001 (INCLUDE ZXM61U01).

&----


*& Include ZXM61U02 *

&----


CLEAR: NO_PLANNING, STOP_PLANNING.

CASE USER_KEY.

----


  • materials with MRP Controller = 001 or =002 or =003 only

----


WHEN '123'.

IF ( MT61D-DISPO <> '001' ) AND ( MT61D-DISPO <> '002' ) AND (

MT61D-DISPO <> '003' ).

NO_PLANNING = 'X'.

ENDIF.

----


  • materials with MRP Controller = 002 only

----


WHEN '002'.

IF MT61D-DISPO <> '002'.

NO_PLANNING = 'X'.

ENDIF.

----


  • materials with MRP Controller = 004 Only

----


WHEN '004'.

IF MT61D-DISPO <> '004'.

NO_PLANNING = 'X'.

ENDIF.

ENDCASE.

Now the problem is, it is still using MRP controller 004 in the daily MRP run.

So what am I doing wrong??

Thanks

Anne

Edited by: Anne on Jul 31, 2009 2:40 PM

Edited by: Anne on Jul 31, 2009 2:41 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

CASE user_key.

WHEN '001' " Plan materials when MRP controller is 001

IF NOT MT61D-DISPO EQ '001'

NO_PLANNING = 'X'.

ENDIF.

WHEN '002' " Plan materials when MRP controller is 002

IF NOT MT61D-DISPO EQ '002'

NO_PLANNING = 'X'.

ENDIF.

WHEN '003' " Plan materials when MRP controller is 003

IF NOT MT61D-DISPO EQ '003'

NO_PLANNING = 'X'.

ENDIF.

ENDCASE.

Check & revert if the above resolves the issue.

Regards,

Vivek

Former Member
0 Kudos

Hi Vivek,

I think I can only enter one user key in RMMRP000, but I need to run it for mrp controllers 001, 002 and 003.

I think with your solution I would only be able to run it for one of the three?

thanks

Anne

Former Member
0 Kudos

Hi,

Apologies i guess i mis-understood your need.

If i have understood the need correctly now, you want to plan materials only when MRP controllers are 001, 002 & 003, if it is any other mrp controller then system should not plan, if so

IF NOT (( MT61D-DISPO EQ '001' ) OR ( MT61D-DISPO EQ '002' ) OR ( MT61D-DISPO EQ '003' ))

NO_PLANNING = 'X'.

ENDIF.

Hope the above helps.

Regards,

Vivek

Former Member
0 Kudos

Hi Vivek,

thanks for your help!

I think the code I used is pretty much the same you have provided:

IF NOT (( MT61D-DISPO EQ '001' ) OR ( MT61D-DISPO EQ '002' ) OR ( MT61D-DISPO EQ '003' ))

NO_PLANNING = 'X'.

ENDIF.

IF ( MT61D-DISPO NEQ '001' AND MT61D-DISPO NEQ '002' AND MT61D-DISPO NEQ '003' )

NO_PLANNING = 'X'.

ENDIF.

Those 2 should be the same. When debugging, it stops right there and I can see if there is a MRP controller other than 001,002 or 003, the NO_PLANNING is set to 'X'.

But our nightly run created lots of purchase requisition for MRP controller 004

So I am wondering now should I use STOP_PLANNING instead of NO_PLANNING??

What is the difference? I know NO_PLANNING means the material is not planned and STOP_PLANNING the material is not planned and the system terminates the planning run. Does it terminate the run only for this material or the ENTIRE run?

Or maybe does the NO_PLANNING not stop from creating purchase requisitions?

Thanks

Anne

Former Member
0 Kudos

Hi,

Have you tried with the code which i put in my previous post ? Did it create proposals for materials with MRP controller 004 ?

If you have not tried, please do the same & check, system should not plan for materials with MRP controller as 004.

Do a test at your end & revert with the results.

Regards,

Vivek

Former Member
0 Kudos

HI Vivek,

yes I have tested it and it created the purchase requisitions for MRP controller 004 as well.

Thanks,

Anne

Former Member
0 Kudos

Hi,

Not quite sure, but just clear all requisitions which exist for this material with MRP controller 004, run in debug mode & check if the program enters the IF condition for the material with controller 004. If it enters then system should not plan for this material.

The purchase reqn's are created only if the material is planned, so i believe the program is not working if the requisition is created. Can you paste the entire code here, start & end your program with the key .so that the formatting is not disturbed.

Regards,

Vivek

Former Member
0 Kudos

Hi Vivek,

I think you were right, the code should trigger the run only for those 3 MRP controllers.

The problem was that there was another MRP job running at night that was triggering a MRP run for all controllers!!!

Thanks for your efforts!

Anne

Answers (1)

Answers (1)

Ritz
Active Contributor
0 Kudos

anne ,

check the last one

here you mentioned 004 .....?

materials with MRP Controller = 004 Only

-


WHEN '004'.

IF MT61D-DISPO '004'.

NO_PLANNING = 'X'.

ENDIF.

ENDCASE.

Check out and revert back.

Regards

Ritesh

Former Member
0 Kudos

Hi RSD,

I am sorry, I just figured, that the code didn't copy right, the comparison signs did not get copied somehow. It doesn't show the uneqal sign..

The user exit is called with user key 123.

This is how it should look like:

&----


*& Include ZXM61U02 *

&----


CLEAR: NO_PLANNING, STOP_PLANNING.

CASE USER_KEY.

-


  • materials with MRP Controller = 001 or =002 or =003 only

-


WHEN '123'.

IF ( MT61D-DISPO not equals '001' ) AND ( MT61D-DISPO not equals '002' ) AND (

MT61D-DISPO not equals '003' ).

NO_PLANNING = 'X'.

ENDIF.

-


  • materials with MRP Controller = 002 only

-


WHEN '002'.

IF MT61D-DISPO not equals '002'.

NO_PLANNING = 'X'.

ENDIF.

-


  • materials with MRP Controller = 004 Only

-


WHEN '004'.

IF MT61D-DISPO not equals '004'.

NO_PLANNING = 'X'.

ENDIF.

ENDCASE.

Whatever, the run last night created bunch of purchase requisitions for MRP controller 004??

Thanks

Anne

Edited by: Anne on Jul 31, 2009 3:06 PM

Edited by: Anne on Jul 31, 2009 3:07 PM

Edited by: Anne on Jul 31, 2009 3:08 PM