Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

MD01 MRP - user exit key

Former Member
0 Kudos

Hi Gurus,

In transaction MD01,

If i have to define my own user exit key, and user exit parameter.

How to do it.

and what is this actually user exit key and parameter.

I have to implement user exit for that or not.If yes can u please provide sample code for this exit.

thanks,

Sanket

6 REPLIES 6

Former Member
0 Kudos

Hi Sanket,

What do u exactly mean by User Exit key i mean what was asked to do.

What is your requirement , can you please elaborate.

Regards,

Ravi

0 Kudos

Hi ,

Check tcode md01.

In that consultant wants to do planning for specific material type.

In existing system it is planning for all material.

In md02 we can plan for specific material but not group of material having MRP type suppose VB.

So for that i searched in SDN there i found above mention user exit.

But i dont know how to code in that.

So for that user exit any sample code is available ???

if yes please provide me that code it will help me lot.

Thanks,

Sanket.

0 Kudos

Dear All,

Please any one can provide solution for this.

Regards,

Sanket.

0 Kudos

M61X0001 -EXIT NAME

SAMPLE CODE

&----


*& Include ZXM61U02

&----


DATA: v_dispo TYPE dispo,

V_MATKL TYPE MATKL.

IF user_key = 001.

IF USER_PAR = SPACE.

MESSAGE E000(ZMESSAGE) WITH 'User Parameter should not be blank'.

endif.

select single * from t024d into t024d

where dispo = user_par.

if sy-subrc <> 0.

message e000(zmessage) with 'Please Check the MRP controller number'.

endif.

SELECT SINGLE * FROM t024d INTO t024d

WHERE werks = mt61d-werks AND

dispo = user_par.

IF sy-subrc = 0.

SELECT SINGLE dispo FROM marc INTO v_dispo

WHERE matnr = mt61d-matnr AND

werks = mt61d-werks.

IF sy-subrc = 0.

CHECK v_dispo <> user_par.

no_planning = 'X'.

ENDIF.

ENDIF.

CLEAR v_dispo.

ELSEIF user_key = 002.

SELECT SINGLE * FROM T023T INTO T023T

WHERE MATKL = USER_PAR.

IF SY-SUBRC <> 0.

MESSAGE e000(zmessage) WITH 'Invalid material group no.' user_par.

ENDIF.

SELECT SINGLE MATKL FROM mara INTO V_MATKL

WHERE matnr = mt61d-matnr.

IF V_MATKL <> USER_PAR.

no_planning = 'X'.

ENDIF.

ENDIF.

WAY 2

&----


*& Include ZXM61U01

&----


    • Technical Developer Murali Papana

    • Fuctional Consultant Sivaraman Balakrishnan

TABLES: t024d,

mara,

marc .

TABLES : t023t.

DATA: v_dispo TYPE dispo,

v_matkl TYPE matkl.

IF user_key = 001.

IF user_par = space.

MESSAGE e000(zmessage) WITH 'User Parameter should not be blank'.

ENDIF.

SELECT SINGLE * FROM t024d INTO t024d

WHERE dispo = user_par.

IF sy-subrc <> 0.

MESSAGE e000(zmessage) WITH 'Please Check the MRP controller number'.

ENDIF.

SELECT SINGLE * FROM t024d INTO t024d

WHERE werks = mt61d-werks AND

dispo = user_par.

IF sy-subrc = 0.

SELECT SINGLE dispo FROM marc INTO v_dispo

WHERE matnr = mt61d-matnr AND

werks = mt61d-werks.

IF sy-subrc = 0.

CHECK v_dispo <> user_par.

no_planning = 'X'.

ENDIF.

ENDIF.

CLEAR v_dispo.

ELSEIF user_key = 002.

SELECT SINGLE * FROM t023t INTO t023t

WHERE matkl = user_par.

IF sy-subrc <> 0.

MESSAGE e000(zmessage) WITH 'Invalid material group no.' user_par.

ENDIF.

SELECT SINGLE matkl FROM mara INTO v_matkl

WHERE matnr = mt61d-matnr.

IF v_matkl <> user_par.

no_planning = 'X'.

ENDIF.

ENDIF.

0 Kudos

Hi Murali,

Very very thanks for your solution.

I am trying that code.

If again any problem comes i will come in same thread or can i directly mail you.

Regards,

Sanket.

Former Member
0 Kudos

closed