on 07-31-2009 1:39 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
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
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
85 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.