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: 

Badi for MM01

Former Member
0 Kudos
67

Hi,

All,

I have one requirement

like

In MM01 while creating material we will select the views MRP 1 , MRP2,MRP3, MRP4.

I implimented badi 'BADI_MATERIAL_REFu2019 .

But it trigers for all views. But i want that 'BADI_MATERIAL_REFu2019 this has to trigger only for views MRP 1 , MRP2,MRP3, MRP4.

Any one can help where we can write the code for above requirement.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
28

Hi Kumar,

One way of solving the problem would be to restrict the your piece of code for particular screen numbers only. Every tab has a predefined screen number. Say if you want the code to run for screen numbers '2001', '2212', '2435' and 2673'. You can do as follows as the first line of code inside the method CREATE_MATERIAL of BADI BADI_MATERIAL_REF :


CHECK sy-dynnr eq '2001'
OR        sy-dynnr eq '2212'
OR        sy-dynnr eq '2435'
OR        sy-dynnr eq '2673'.

.

And if needed put the calling program and calling transation also in the check condition.

Hope this helps.

Regards,

Abhisek.

1 REPLY 1

Former Member
0 Kudos
29

Hi Kumar,

One way of solving the problem would be to restrict the your piece of code for particular screen numbers only. Every tab has a predefined screen number. Say if you want the code to run for screen numbers '2001', '2212', '2435' and 2673'. You can do as follows as the first line of code inside the method CREATE_MATERIAL of BADI BADI_MATERIAL_REF :


CHECK sy-dynnr eq '2001'
OR        sy-dynnr eq '2212'
OR        sy-dynnr eq '2435'
OR        sy-dynnr eq '2673'.

.

And if needed put the calling program and calling transation also in the check condition.

Hope this helps.

Regards,

Abhisek.