cancel
Showing results for 
Search instead for 
Did you mean: 

Material Description Validation

former_member1270519
Participant
0 Kudos

Hello,

We have written a validation on Material Description and the error is being thrown as expected.

But the Requestor is still able to Submit the request despite the error.

We tried to configure this validation in the BADI USMD_RULE_SERVICE but we're not getting data of field MAKTX in the BADI Class.

Can anyone please guide us as to how we can prevent the requestor from being able to submit when the description error is thrown?

Thanks,

Sagar Dixit

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Sagar,

  • You can set it how messages should be delivered globally in Process Modelling for your Change Request and Entity type. Please see below for the Entity type MATERIAL.

        Set it to Standard.

  • In the BADI USMD_RULE_SERVICE, you could validate the description.

       Maintain filter values as MODEL = MMENTITYTYPE = MATERIAL.

       Use CHECK_ENTITY method and check for field TXTMI in the importing parameter IT_DATA.This holds the description value. Check the value and        based on that fill your message in the         exporting parameter ET_MESSAGE.

0 Kudos

Hi Experts,

I'm new to mdg , As mentioned above I have tried to fetch the value of material description but not succeed..My Actual requirement is to validate the material description entered in the description tab of  create material . Please help me how to fetch desciption value into check_entity method of usmd_rule_service  with the sample code. I have no idea to which method we need  use to get the IT_data or staging area data...

Please help me with the sample code.

Thanks and Regards

Raj

former_member1270519
Participant
0 Kudos

Hi Experts,

I'm new to mdg , As mentioned above I have tried to fetch the value of material description but not succeed..My Actual requirement is to validate the material description entered in the description tab of  create material . Please help me how to fetch description value into check_entity method of usmd_rule_service  with the sample code. I have no idea to which method we need  use to get the IT_data or staging area data...


Right now  I have written the validation  in the feeder class cl_mdg_bs_mat_bo and able to show the errors on UI but still with errors the request is allowing to  submit  which is not correct.



Please help me with sample code to featch the above material description value in a check_entity method of usmd_rule_service badi (I have created the badi class and implemented but it showing empty implementation in check_entity method).


Thanks ,

Sagar

Former Member
0 Kudos

Hi Sagar,

In your created BADI class, in the CHECK_ENTITY method please put a breakpoint for your user. Now open up the UI screen and try entering description and clicking on Check button. In the debugging, try checking for description values in parameter IT_DATA. Loop IT_DATA and validate the values entered and fill the message parameter ET_MESSAGE accordingly.

METHOD if_ex_usmd_rule_service~check_entity.


     break testuser.


ENDMETHOD.

former_member188878
Active Contributor
0 Kudos

Sagar,

enable the validation check for your CR as shown below.

0 Kudos

Hi ,

With your above valuable input , I'm able to validate material description with other way  but just to know the it_data  fetching only the basic data in check_entity method  by passing MM  model  ...I have called the check_entity method again into feeder class to get the material description  value to validate ,is this right way of doing ? Or can we get all the  ui screen data  in check_entity method directly .

Thanks and Regards

Raj

benjamin_allsopp
Active Participant
0 Kudos

You can't get material description directly in the check_entity method.

SAP has left  the entire entity for material description out of the normal check entity method for reasons known to themselves (probably because it's a free text in normal SAP systems)