Ansicht
Dokumentation

FMDM_USMD_DATA_TRANS - BAdI: Prepare Data for Download File

FMDM_USMD_DATA_TRANS - BAdI: Prepare Data for Download File

General Data in Customer Master   CL_GUI_FRONTEND_SERVICES - Frontend Services  
This documentation is copyright by SAP AG.
SAP E-Book

This Business Add-In (BAdI) is used in the Master Data Governance(CA-MDG) application component.

You can use this BAdI to prepare the file for downloading data from the Master Data Governance hub.

The PROCESS_DOWNLOAD instance method is called for master data (attributes and language-dependent texts) after the data has been read from the database tables and, if necessary, converted to the external format. The parameters of the method have the following meanings:

  • IO_MODEL_EXT Returns metainformation. (The field properties are located, for example, in the parameter under DT_FPROP).
  • I_MODEL Indicates the name of the data model.
  • I_TRVARI Indicates the data transfer variant.
  • I_ENTITY Indicates the entity type for which the download is to take place.
  • IS_DOWNLOAD_SETTINGS Indicates the technical settings of the download.
  • ITS_FIELD Indicates the sequence of the fields in the file.
  • IT_SEL Returns the selection for the download.
  • ET_MESSAGE Returns error and information messages. The BAdI can populate this table. The messages are written to the application log.
  • IT_DATA_INT Returns data in the internal format. This data cannot be changed.
  • CT_DATA_EXT Returns data in the external format. The data items are separated by the predefined separation character. This data can be changed.
  • I_EDITION Returns the current edition. Only relevant for entity types with the storage and use types 1 and 4.

For hierarchies, instance method PROCESS_DOWNLOAD_HRY is called. The parameters of the method have the following meanings:

  • IO_MODEL_EXT Returns metainformation. The field properties are located, for example, in the parameter under DT_FPROP.
  • I_MODEL Indicates the name of the data model.
  • I_TRVARI Indicates the data transfer variant.
  • I_ENTITY Indicates the entity type for which the download is to take place.
  • ITS_HRYNAME_KEY Specifies the name of the selected hierarchy.
  • I_HRYVERS Specifies the hierarchy version if the hierarchy is version-dependent. Otherwise, this parameter#s value is initial.
  • IS_DOWNLOAD_SETTINGS Indicates the technical settings of the download.
  • ITS_FIELD Indicates the sequence of the fields in the file.
  • IT_SEL Returns the selection for the download. This selection contains restrictions as regards the hierarchy version and hierarchy name (and its higher-level fields).
  • I_EDITION Returns the current edition.
  • ET_MESSAGE Returns error and information messages. The BAdI can populate this table. The messages are written to the application log.
  • IT_DATA_INT Returns data in the internal format. This data cannot be changed.
  • CT_DATA_EXT Returns data in the external format. The data items are separated by the predefined separation character. This data can be changed.

In the standard system, the BAdI implementation USMD_DATA_TRANSFER_EX is activated. The standard code is executed automatically.

The BAdI is not filter-dependent.

The BAdI is not designed for multiple use.

USMD_DATA_TRANSFER_EX

For information about the implementation of BAdIs in the context of the Enhancement Concept, see SAP Library for SAP NetWeaver under BAdIs - Embedding in the Enhancement Framework.

The global class CL_USMD_DATA_TRANSFER_BADI implements the standard behavior.

Access to the data in IT_DATA_INT can be dynamic (for example).

Access to the table for master data and language-dependent texts:

data:

    lr type ref to data,

        ls_field like line of its_field.

field-symbols:

    <ls_data> type data,

    <l_value> type data.

create data lr like line of it_data_int.

assign lr->* to <ls_data>.

loop at it_data_int  into <ls_data>.

    * assign all components of <ls_data>.

    loop at its_field into ls_field.

        assign component ls_field-fieldname of structure <ls_data> to <l_value>.

        "read <l_value>

    endloop.

endloop.

When accessing individual data records in table IT_DATA_INT for hierarchies (is_download_settings-usmd_trkind = 'H'), note that the fields for the header are grouped in the substructure _HEADER, for the higher-level node in the substructure _PARENT, for the lower-level node in the substructure _CHILD, and for the edge attributes in the substructure _HRYATTS:

_HEADER

_HEADER-DIMEN

_PARENT

_PARENT-HRYNAME

_PARENT-CSTCTRGRP

_CHILD

_CHILD-CSTCTRGRP

The table is accessed as follows (note that the type pool USMD6 must be declared in the BAdI implementation):

data:

    lr type ref to data,

    ls_field like line of its_field.

field-symbols:

    <ls_data> type data,

    <ls_struct> type data,

    <l_value> type data.

create data lr like line of it_data_int.

assign lr->* to <ls_data>.

loop at it_data_int  into <ls_data>.

    * assign all components of <ls_data>.

    loop at its_field into ls_field.

        case ls_field-usmd_trlocation.

            when usmd6_cs_trlocation-header.

                assign component '_HEADER' of structure <ls_data> to <ls_struct>.

            when usmd6_cs_trlocation-parent.

                assign component '_PARENT' of structure <ls_data> to <ls_struct>.

            when usmd6_cs_trlocation-child.

                assign component '_CHILD' of structure <ls_data> to <ls_struct>.

            when usmd6_cs_trlocation-hryatts.

                assign component '_HRYATTS' of structure <ls_data> to <ls_struct>.

        endcase.

        assign component ls_field-fieldname of structure <ls_struct> to <l_value>.

        "read <l_value>

    endloop.

endloop.

This BAdI uses the interface IF_EX_USMD_DATA_TRANSFER. For more information, display the interface in the Class Builder.






rdisp/max_wprun_time - Maximum work process run time   BAL_S_LOG - Application Log: Log header data  
This documentation is copyright by SAP AG.

Length: 12428 Date: 20240523 Time: 193052     sap01-206 ( 162 ms )