【Planning】MRP planning exit to exclude codes

Purpose
for total planning, particularly for MRP, we know we can use "sequence of plant" to define the sequenced plant list for planning run, for example in MD01/MD40(MPS);
and we can also use "Product group" to group the materials which will have planning run at one time together, like in MD02/MD41 (MPS) multiple level
However, there is drawback here: let's say if we have some material, some special materials, which belong to the Sequence of plant, we need to exclude it or include, how to achieve.

content:
here is one approach to accomplish the purpose abovmentioned - we use "user-exit" in total MRP MD01.


you can see that under 5395, all codes with WP9 MRP controller as below:



And you can see, 2 codes with the same PD MRP type, and WP9 MRP controller.


Now, let’s simulate run the MRP job :




Machine generated alternative text:
MRP Run
MRP list Curr.Iist IijExcept.grp
Planned Mater
?3
Selection Group
Count.
Time
Lev
Pint
Material
1 2 3 4 5 6 7
8
1
08.36.30
999
5395
97258804
3
2
08.36.36
999
5395
97259131
Now you can see that. only the desired code
this ME? running!!
Statistics
Materials planned 2
Materials with New Exceptions 1
Materials with Termination MRP List
Parameters
Scope of Planning
Plnt 5395
Processing Key NETCE
Create Purchase Requisition 2
SA Schedule Line 3
Create MRP List 1
Planning Mode 1
Scheduling 1
MRP Date 03.06.2015
Database Statistics
Schedule lines created 1
Runtime Statistics
Start of Planning Run 08:29:57
End of Planning Run 08:36:37
Runtime 00:06:40
CPU Time: Update 00:00:40
ere selected for



Or for MPS total planning, it is the same:





Customizing place:

Machine generated alternative text:
Display ?G
Cj]? Existing BC Sets 揃C Sti 慉ctrat: L Co? Performance Assistant
Structure
? D Logistics Execution
慙t Quality Management User Exit: Material Selection for Planning Run
?  Plant Maintenance and Customer Service
? LE Customer Service In this workstep. you define the key and the de.ion texts for the user exit function for
Li Production selecting materials for the planning run.
? Basic Data
? Sales & Operations Planning (SOP) Using the user exist, you can limit the planning run (MRP, MPS. long-term planning) to
? Distribution Resource Planning (DRP) materials with certain criteria (which you define).
? Production Planning
? Capacity Requirements Planning Example
Material Requirements Planning
Plant Parameters For example. for each plant. you can define that in the selected plant the system will only
MRP Groups plan:
L? Number Ranges
Master Data ? materials to be planned using MRP procedures.
Planning
Define Scope of Planning for Total Planning ? materials of a certain MRP controller
? Define Creation Indicator
? i MRP Calculation ? externally procured materials or materials produced in-house
? [i Lot-Size Calculation
?  Scheduling and Capacity Parameters Requirements
? I? Procurement Proposals
User exist must be activated in the SAP externsion concept. The name of the extension is
? BOM Explosion
M6IX000I
Activate Runtime Statistics
? L? Direct Procurement In the documentation for this extension, you will find information on the use of user exits.
? I Direct Production
c? Define the Maximum MRP Period For more information on the extension concept. please refer to the appropriate
. ? Indicator: Only Firm Transmitted Schedule Lines documentation.
. C Define Start Time of Sporadic Background Jobs
. ( C Define Storage Location MRP per Plant Note
. (? Activate Requirements Grouping for mdiv ual Project Planning
icrkIfi User Exit: Material Selection for Planning Run Z This workstep must only be carried out if you want to use the user exit.
? It Procurement Proposals
? L? .uation Activities
?  Forecast
b F). A. ,*knri抧*inn IA.n?.anmnn* Maintain the key and the de.ion of the user exit.


Machine generated alternative text:
Display View 揢ser exit material selection - MRP? Overview
User exit Control key de.ion
P1 慞lan only APO-planned materials, CIF flags as in ZCXXPTO15O
APO Exclude APO-planned materials, CIF flags as in ZC)O(PTO15O
LTD User exit to restrict processing within a plant by MRP cont.
LTE Limited MRP/MPS, exclude given MRP-Controller
MPS User exit to exclude materials by MRP Controller
MRP User exit to exclude materials by MRP Controller
MTY Exit to define material types
II? I

 

Regarding to the exact user-exit

Machine generated alternative text:
Attributes of SA P Enhancement M61X0001
?2 ? Components
r-j-- 9
Enhancement i61XOOO1
憆-
Short text User exits PP-MRP materials planning
Administrative Data
Package MDO3
Original language DE
Created by SAP
Last Changed SAP


For example:


Machine generated alternative text:
Components in SAP Enhancement M61X0001
Function module exits
Function module Short Text
r 9
EXIT SAPLME1C 001 User Exits PP-MRP Materials Planning
L ____
EXIT_SAP)0161X_001 User Exits PP-MRP Materials Planning
Function codes
Program Code Short text
Screen areas
Callinn crreen No. Ama Called crreen No. Short Text


For example 


Machine generated alternative text:
L J
Function Builder Display EXIT_SAPLM61 C_001
??a[DU  Pattern JInseit JReplace J
Function module EXIT_SAPLI461C_OO1 Active
Attributes ImportVExport Changing t?Tables Exceptions Source code
21 ?
31 *fl*FFLokale Schnittstelle:
ql 慽? IMPORTING
5! *? VALUE (USER KEY) LIKE RM6蝀桿XKEY
6! * VALUE (USER PAR ) LIKE RM6IX桿XPAR
VALUE(T438A) LIKE T438A STRUCTURE T438A
el k,, VALUE(MT6ID) LIKE LWafl.J STRUCTURE MT6ID
VALUE (CM6蜝) TYPE M6蝀CM6蜝 OPTIONAL
101 * EXPORTING
ill  VALUE (NO PLANNING) LIKE AM6IX-FLGO?
121 搑? VALUE (STOP PLANNING) LIKE AM6IX桭LGO2
13! * ? 
l4l
15J
161 INCLUDE Z)?61U02. 


Machine generated alternative text:
A BA P Editor Display Include ZXM61 1101
?  PrettyPrinter
Include ZXM61UO1 Active
311. ) End of BX8244?0111114
321,
3 3
341. * Begin of main routine
351. CASE user_key.
36 WHEN .
37 ffi
IF w execute once IS PTITIAL.
35 REFRESH tmtart.
w execute once = .
IF NOT ( user_key IS INITIAL ).
IF user_par IS INITIAL.
MESSAGE ID Z? TYPE F? NUMBER 憀i-
WITH PZ -zZEr EEr
46j ENDIF.
471 ENDIF.
481, * Split the user parameters string in to individual material types
491 * into the material types internal table
so1, MOVE user_par TO w_user_par.
51! TRANSLATE w_user_par TO UPPER CASE.
52! - DO.
53 No more parameter left
541 wfdpos = STRLEN? w user par ).
55!  IF w fdpos EQ .
561 EXIT.
57: ENDIF.
. .n: L z
IF NOT wuserparEi CA .: .
MESSAGE ID TYPE F NUMBER
611 WITH Invalid user exit parameters delimiter? (003).
62j ENDIF.
6311 IF w_user_par CA ?.; ?
641. No more delimiters left in the oarameter strina 


Machine generated alternative text:
Dictiona,y: Display Table
t *   Technical Settings Indexes... Append Structure...
Transparent Table 慣438A Active
Short De.ion MRP Type
Attributes  Delivery and Maintenance / Fields  Entry help/check r Currency/Quantity Fields
1[i1J1E]1 Srch Help j Predefmned Type ]
Field ______ ]Key Initial... Data element Data T... Length Decimal Pl... Short De.ion Grou
MANDI () () MANDT CLNT 3 0 Client
? [J [) DISMM CHAR 2 0 MRP Type
fl [J DISVF CHAR 1 0 MRP procedure
fl () PROKZ CHAR 1 0 Forecast indicator
[] () PROVB CHAR 1 0 Consumption indicator of forecast
fl  PROOS CHAR 1 0 MRP indicator of forecast
fl () KZSIB CHAR 1 0 Indicator: calculate safety stock
fl  CZME3 CHAR 1 0 Indicator: calculate reorder level
fl PRRED CHAR 1 0 Reduce forecast requirements
[] () FXART CHAR 1 0 Firming Type of the Planning Result
[) (J RESPL CHAR 1 0 Indicator: delete firm planned orders
fl 11 KZREG CHAR 1 0 Indicator: plan material regularly
ICEED CHAR 1 0 Reorder point planning with external r..
RYBED CHAR 1 0 Time-phased planning with requireme...
DYFOL CHAR 3 0 Screen sequence for the header deta..
LJ L] CBP_PLANTYPE CHAR 1 0 Method by which a material LS planned
fl fl BBBED CHAR 1 0 Mterl ctninn rnmts (ciihrnntr. r


Machine generated alternative text:
Dictionaiy: Display Structure
4 ?c ?i r * ?
Hierarchy Display Append Structure...
Structure MT61D
Short De.ion Material Master: MRP
Component
)4ATNR
WERKS
LVORM
)4AKX
!4TART
MATKL
r
MEINSI
L
)Q4STA
DIS)4
BESKZ
SQBSL
MI SKZ
蠭SST
SB蠯Z
KZ BE D
DI SPO
EKGRP
KZDIE
nit? 憂r
Active
Type I
Typing Method Component Type
1 Types WMATNR
1 Types WERKS_D
1 Types 憊扡V0R14
1 Types 揗M孹
1 Types ?MTART
1 Types MATKL
? Types WHEINS
1 Types 慦MMSTA
1 Types ?DIS)-91
1 Types 揃ESKZ
1 Types ? SOBSL
1 Types ?MISKZ
1 Types wD155T
1 Types SBDKZ
1 Types ? KZBED
1 Types DISPO
1 Types e扙KGRP
1 Types 慥扠ZDIE
慖 T.,.-..-.... w fl7t扵扵?
Data Type
CHAR
CHAR
CHAR
CHAR
CHAR
CHAR
UNIT
CHAR
CHAR
CHAR
CHAR
CHAR
CHAR
CHAR
CHAR
CHAR
CHAR
CHAR
nrr?
1 / 141
Length Deci... Short De.ion
18 0 Material Number
4 OPlant
1 0 Deletion Indicator
40 0 Material De.ion (Short Text)
4 OMaterial Type
9 0 Material Group
3 0 Base Unit of Measure
2 0 Plant-Specific Material Status
2 OMRP Type
1 0 Procurement Type
2 0 Special procurement type
1 0 Mixed MRP indicator
3 OLow-Level Code
1 0 Dependent requirements md. for individual and cc
1 0 Indicator for Requirements Grouping
3 0 MRP Controller (Materials Planner)
3 0 Purchasing Group
1 0 Indicator: MRP controller is buyer (deactivated)
fl T.-. k...-.. .-...A. ..梚-;....-. i-.-.-...


 So, let's summarize its usage and trait :


  • This user exit is mainly accessed after one material is reading by planning run, particularly after planning file entry. So, it will check if this material is suitable or match with the exit-logic.
  • Noted: this user-exit will not change planning file entry, it is just to mark this material excluded from planning or stop planing
  • Ideally we need to place the identical coding in abovementioned 2 exit-FMs.
  • T438A and MT61D: contains the related MRP type and material master data, for your check
  • User-parameter: is the inputted data in the MD01/MD40. you can parse using coding in these 2 FMs
  • NO_PLANNING: indicates this material should be excluded from this planning run
  • STOP_PLANNING: indicates this planning run should be terminated


请使用浏览器的分享功能分享到微信等