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: 

Conditional Mandaotry field in Material Master (Suggestion Needed)

Former Member
0 Kudos
298

Hi ,

I am having a requirement where i need to make a particular field to be mandatory for a certain condition in Material Master.

Say for a Product Hierarchy i want to make Volume Rebate Group mandatory ( Sales Org 2 View).

Please suggest the possible solutions for the same.

No userexit is possible , Screen exit is also out of picture as i will not get the value of second variable -

Thanks

Rajiv

2 REPLIES 2

Former Member
0 Kudos
221

Hi Rajiv,

there is a user-exit that can be used .. MGA00001.

We use it to make some plausibility checks before saving a material and also some additional authorization checks.

<pre>FUNCTION EXIT_SAPLMGMU_001.

*"----


""Lokale Schnittstelle:

*" IMPORTING

*" VALUE(WMARA) LIKE MARA STRUCTURE MARA

*" VALUE(WMARC) LIKE MARC STRUCTURE MARC

*" VALUE(WMARD) LIKE MARD STRUCTURE MARD

*" VALUE(WMBEW) LIKE MBEW STRUCTURE MBEW

*" VALUE(WMLGN) LIKE MLGN STRUCTURE MLGN

*" VALUE(WMLGT) LIKE MLGT STRUCTURE MLGT

*" VALUE(WMVKE) LIKE MVKE STRUCTURE MVKE

*" VALUE(WSTAT) LIKE MGSTAT STRUCTURE MGSTAT

*" VALUE(WMFHM) LIKE MFHM STRUCTURE MFHM

*" VALUE(WMPOP) LIKE MPOP STRUCTURE MPOP

*" TABLES

*" STEXT STRUCTURE SHORT_DESC

*" SSTEUERTAB STRUCTURE MG03STEUER

*" SSTEUMMTAB STRUCTURE MG03STEUMM

*" WMEINH STRUCTURE SMEINH

*" SMEAN_ME_TAB STRUCTURE MEAN

*" CHANGING

*" VALUE(CMARA) LIKE MARU STRUCTURE MARU

*" EXCEPTIONS

*" APPLICATION_ERROR

*"----


INCLUDE ZXMG0U02.

ENDFUNCTION.</pre>

Just prompt an error message in case the required field is not filled.

MESSAGE ennn(xx) RAISING application_error.

I am sure it will help to solve your problem.

Best regards

Ferdi

0 Kudos
221

> Hi Rajiv,

>

> there is a user-exit that can be used .. MGA00001.

>

> I am sure it will help to solve your problem.

>

> Best regards

> Ferdi

Hi Ferdi,

this is not going to solve my problem , becasue what my requirement is that i need to stop the user on the same view if there is any error , if the coding is done on this userexit i only have two options , one save it or not save it.which i think my business will not be ready for it ,and in case if i am creating a material and i throw this error , material will not be saved then the user will have to enter all the entries again. which i don't want , as this is a conditional mandatory field

Rgds

Rajiv