How do you implement the processing for Master Data Read Class Parameters?

  • In the example Master Data Read Class that we have been looking at, the processing is generic.  In other words there is no statement in the application coding that specifies the MDM Repository, Table or Field name.  The values are supplied via parameters so that this same class can be used for more than one Master Data Characteristic.
  • You can see the area where you can supply these parameters in the following screen shot. It is the field labeled Master Data Read Class Parameters:
  • Although this is a single field, it can hold more than one value.  This is done by associating a data dictionary structure with the parameter inside the coding o the Master Data Read Class.  For the purposes of MDM Integration, you probably want a structure something like the one used this example implementation:
  • This way when you click on the pencil icon next the parameter field, a dialog pops up with the individual field selections as defined by your structure.  This even supports value input help for the individual fields.
  • So, how can this functionality be built into the Master Data Read Class?  It requires the implementation of another interface in your class - IF_RSMD_RS_GENERIC.  The sample Master Data Read Class, which can be downloaded here, contains an implementation of this interface for the purposes of processing the MDM Repository, Table and Field as parameters.
  • In the Method GET_STRUCTURE_NAME, you must specify the name of the data dictionary sturcture you are going to use:
    method if_rsmd_rs_generic~get_structure_name.
    e_struct_name = 'ZRSMD_RS_S_MDM'.
    endmethod.



  • But the most important processing are the GET and SET Methods. This is where you must supply the logic to map the data from the single parameter string into the individual fiels of your structure and vise versa:
    method if_rsmd_rs_generic~get_parameter.
    field-symbols: <l_s_struc> type zrsmd_rs_s_mdm.
    assign e_r_struc->* to <l_s_struc>.
    <l_s_struc> = o_s_gendomain.
    endmethod.

    method if_rsmd_rs_generic~set_parameter.
    field-symbols: <l_s_struc> type zrsmd_rs_s_mdm.
    assign i_r_struc->* to <l_s_struc>.
    o_s_gendomain = <l_s_struc>.
    endmethod.

    method if_rsmd_rs_generic~get_parameterstring.
    data: l_parameterstring type rsmdrclpa.

    *===Create the paramater string from the generic table structure===
    l_parameterstring+0(32) = o_s_gendomain-object_name.
    l_parameterstring+32(34) = o_s_gendomain-table .
    l_parameterstring+66(34) = o_s_gendomain-query_field.

    *===Export the parameter string====
    e_parameterstring = l_parameterstring.
    endmethod.

    method if_rsmd_rs_generic~set_parameterstring.
    data: l_parameterstring type rsmdrclpa.

    l_parameterstring = i_parameterstring.
    *===Create the structure from the parameterstring===
    o_s_gendomain-object_name = l_parameterstring+0(32).
    o_s_gendomain-table = l_parameterstring+32(34).
    o_s_gendomain-query_field = l_parameterstring+66(34).
    endmethod.


SAP Developer Network Latest Updates