Skip to end of metadata
Go to start of metadata

Using BADI_MATERIAL_CHECK we can restrict the material shot text change to particular user and particular material type , please check below code .

BADI Name : BADI_MATERIAL_CHECK
Method Name : CHECK_DATA                     
Error rendering macro 'code': Invalid value specified for parameter 'com.atlassian.confluence.ext.code.render.InvalidValueException'
METHOD if_ex_badi_material_check~check_data.
  DATA : ls_makt TYPE makt,
         ls_text TYPE short_desc.
  CHECK sy-tcode EQ 'MM02'.
  IF sy-uname <>  'SMRUTI' AND ( wmara-mtart EQ 'ZSPR' OR wmara-mtart EQ 'ZCON' ).
    SELECT SINGLE *
               FROM makt
               INTO ls_makt
               WHERE matnr EQ wmara-matnr AND
                     spras EQ 'EN'.
    READ TABLE stext INTO ls_text INDEX 1.
    IF sy-subrc EQ 0.
      IF ls_text-maktx <> ls_makt-maktx.
        MESSAGE 'Changes to Material Description is not permitted for the User' TYPE 'W' DISPLAY LIKE 'E'.
        LEAVE TO SCREEN sy-dynnr.
      ENDIF.
    ENDIF.
  ENDIF.
ENDMETHOD.
METHOD if_ex_badi_material_check~check_data.

 

Regard's
Smruti

  • No labels