Skip to Content

Introduction       

             

MDM Web Dynpro components are standard components provided by SAP which ensures independence from the underlying MDM schema. These components are reusable and can be used to develop custom webdynpro applications.  These components are configured in the Web Dynpro Configuration Manager (Configuration Manager) which exposes MDM repository metadata.

Architecture of MDM WD component environment.

/wp-content/uploads/2013/04/1_207650.png

User exits                 

Standard MDM Web Dynpro components are consumed as used components in custom Web Dynpro applications. These standard components once consumed as used components are customized according to the business needs to suit the customers requirements.

To customize and modify the generic behavior of MDM Web Dynpro components at runtime using User Exits (sometimes called hook methods). User Exits allow you to add your own functionality to SAP’s standard applications. There are several different types of User Exits, each of which can be used to achieve the desired functionality.

They also serve as hooks to add customized functionality to SAP’s standard business applications without having to modify the original applications.

There are different types of user exits, each of which act as hooks to attach your own coding. When MDM WD components are consumed, they expose the following user exits:

·         Interface Methods: API interface methods can be accessed from a wrapper component.

·          Context Input: A Web Dynpro context node or attribute stores relevant information that can be accessed by a wrapper application.

·          Events: Communication between components and custom wrapper applications can take place through eventing. An event is   

                    triggered from a Web Dynpro component and all applications using this component can subscribe to the event.

User Exits for Item Details Web Dynpro Components  

Interface Methods 

     The following API interface methods are exposed from an Item Details Web Dynpro component and can be accessed from a 

wrapper component:

Ø setRepositoryBean(RepositoryBean repositoryBean)

  Example: creating an instance of the repository bean and passing that value to create a connection with the MDM

  _repositoryBean = new RepositoryBean();

   wdThis.wdGetItemDetailsInitialInterface().setRepositoryBean(_repositoryBean);

Ø setConfiguration(projectConfigName, componentConfigName)

   Populates the Item Details component with the configuration that you configured in the MDM Web Dynpro Configuration Manager. After

   execution of this method, connection to the MDM repository is established.

  

    Example:

    wdThis.wdGetItemDetailsInitialInterface()

                   .setConfiguration(ConfiguratorScreen.PROJECTNAME, ConfiguratorScreen.PRODUCT_CHANGE);

Ø setRecordId(String recordId)

   Passes the internal ID of the MDM record to be displayed in the Item Details component

   wdThis.wdGetItemDetailsInitialInterface().setRecordId(recordId);

Ø getRecord()

   Retrieves an MDM record and all information of the record created in MDM Data Manager.

   wdThis.wdGetItemDetailsInitialInterface().getRecord();

Ø validateRecord()

 

   Triggers MDM configured validations and custom developed external validations.

    WdCompsValidationResults validateResults = wdThis .wdGetItemDetailsInitialInterface().validateRecord();

    If(validateResult>0){

     Record is not valid

         }else{

      Record is valid

         }

Ø getFieldValue(String fieldCode)

     Enables the wrapper component to retrieve a specific field value. The return value of this method is an MDM API class called  

     MdmValue. Can be called only after a record has been selected in an Item Details component.

     MDMValue fieldValue = wdThis.wdGetItemDetailsInitialInterface().getFieldValue(String FieldCode);

Ø setFieldValue(String fieldCode, MdmValue value)

     setFieldValue method is used to default any value from code in any Item Detail.

     wdThis.wdGetItemDetailsInitialInterface().setFieldValue(String fieldCode, MdmValue value);

Ø refreshComponent()

     This is used to refresh record detail of Item Detail. When this method is called it fetches record value from MDM and updates in Item 

      Detail.

     

     wdThis.wdGetItemDetailsInitialInterface().refreshComponent();

Ø setFieldProperty(String fieldCode, FieldLayoutProperty property, Boolean value)

    

     This method is used to change property of any field on any particular condition.

    

      wdThis.wdGetItemDetailsInitialInterface().setFieldProperty(String fieldCode, FieldLayoutProperty property, Boolean value)

     Examples :

·              To hide a field on any particular condition from the item detail.

          wdThis.wdGetItemDetailsInitialInterface().setFieldProperty(“Field_Code”,FieldLayoutProperty.Visible, false);

·              To make a field conditional mandatory hide on item detail.

          wdThis.wdGetItemDetailsInitialInterface().setFieldProperty(“Field_Code”,FieldLayoutProperty.Required, true);

·              To disable a field conditionally on item detail.

          wdThis.wdGetItemDetailsInitialInterface().setFieldProperty(“Field_Code”,FieldLayoutProperty.READ_ONLY, true);

Ø setTabProperty(String tabCode, FieldLayoutProperty property, Boolean value)

    wdThis.wdGetItemDetailsInitialInterface().setTabProperty(String tabCode, FieldLayoutProperty property, Boolean value)

     Examples:

·              To disable all fields of one tab (Header).

           wdThis.wdGetItemDetailsDisp_DSInterface().setTabProperty(

                                                “Header”,FieldLayoutProperty.READ_ONLY, true);

·             

          To make all fields mandatory of one tab (Header).

           wdThis.wdGetItemDetailsDisp_DSInterface().setTabProperty(

                                                “Header”,FieldLayoutProperty.REQUIRED, true);

·       

                To hide one particular  tab from an item detail.

           wdThis.wdGetItemDetailsDisp_DSInterface().setTabProperty(

                                                “Header”,FieldLayoutProperty.VISIBLE, false);

Reference(s)

  1. 1. help.sap.com

To report this post you need to login first.

Be the first to leave a comment

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

Leave a Reply