Skip to Content

Introduction

                         SAP Master Data Governance software helps organizations govern financial, material, customer, or supplier master data from its creation in a business application through its replication to target applications to ensure data quality and regulatory compliance across the enterprise

Scope

              

                        Master Data Governance for Materials in general supports governing of objects like General Data, Descriptions, Unit Of measure, Basic Text, Internal Comment, Class Assignment and Characteristic Valuation. It always possible to extend the standard Data Model provided by SAP to govern either existing fields in table related to material or custom fields that are added to the standard table using extensions. Master Data Governance has also provided standard UI’s with which user can enter  values. This document shows of how fields can be hidden dynamically based on the User role

Standrad UI

                        This is the standard Materials UI provided by SAP.

1.JPG

Pre Requisites

                         You should having developer access for creating components  and creating new configurations. You should have some knowledge of Web Dynpro ABAP.

BADI

                         MDG comes up with a standard BADI in EHP 5.0 in which you have the flexibility to make a field read only or Hidden based on roles.  You can access the BADI using MDGIMG

1.JPG

Implementation

                           Create an implementation class and provide a filter so that it works only for that particular UI

1.JPG

Now, in the implementation Class you have a method Modify_Definition through which you can hide fields.

1.JPG

In this example, we have maintained a custom table in which we have maintained the Roles Names and the corresponding views to be hidden.

data: lt_roles    type standard table of agr_users,
        lt_role_tab type standard table of xxxx , “custom table
        wa_role_tab type yyyy, “custom structure
        wa_roles    type agr_users.
  data: wa_hideview like line of et_hide_view.
  select * from xxxx into
      corresponding fields of table
      lt_role_tab.
  call function 'CKEXUTIL_USER_TO_ROLE'
    exporting
      i_uname      = sy-uname
    tables
      et_agr_users = lt_roles.
  loop at lt_roles into wa_roles .
    read table lt_role_tab into wa_role_tab with key role = wa_roles-agr_name.
    if sy-subrc = 0.
     
        loop at lt_role_tab into wa_role_tab where role = wa_roles-agr_name.
   wa_hideview-mainview = wa_role_tab-tab. “ pass the View name to be hidden
          append wa_hideview to et_hide_view.
        endloop.
     
    endif.
    clear: wa_role_tab,
           wa_roles.
  endloop.

We use method Modify_view to hide fields in a view.

1.JPG

The same example as above is used here

*** code added for hiding fields for global approver

 

data: lt_roles    type standard table of agr_users,
        wa_roles like line of lt_roles.

  call function ‘CKEXUTIL_USER_TO_ROLE’
    exporting
      i_uname      = syuname
    tables
      et_agr_users = lt_roles.

read table lt_roles into wa_roles with key agr_name = ‘yyyy’.

  if sy-subrc = 0.

     
      data: wa_property like line of et_property.

      loop at et_property into wa_property.

        wa_propertyread_only = ‘X’.
        modify et_property from wa_property index sytabix.

      endloop.

   
  endif.

To report this post you need to login first.

7 Comments

You must be Logged on to comment or reply to a post.

        1. Former Member Post author

          Hi Arora,

                you could do this using configuration and CBA. CBA is on UI level and on the configuration side you can make use of the Node ‘Link logical action with UI’ where you can mention whcih Logical Action should use which UI.

          —regards,

             Alex B Justin

          (0) 
  1. Former Member

    Hi Alex,

    It’s nice blog .i have on more thing to know if In case of one user having multiple roles and parallel workflow  , how to handle it in MDGM 6.1 .

    Thanks & Regards

    Debasish

    (0) 
    1. Former Member Post author

      Hi Debasish,

             you should use CBA for this along with some BADI implementations.

      —regards,

         Alex B Justin

      (0) 

Leave a Reply