SAP ABAP IMG Activity USMD_DATA_TRANSFER_U (BAdI: Prepare Upload Data)
Hierarchy
MDG_FND (Software Component) MDG Foundation
   CA-MDG-AF (Application Component) Application Framework
     USMD6 (Package) Replication (Upload/Download, Monitor, ...)
IMG Activity
ID USMD_DATA_TRANSFER_U BAdI: Prepare Upload Data  
Transaction Code S_BTD_53000064   (empty) 
Created on 20090422    
Customizing Attributes USMD_DATA_TRANSFER_U   BAdI: Prepare Upload Data 
Customizing Activity USMD_DATA_TRANSFER_U   BAdI: Prepare Upload Data 
Document
Document Class SIMG   Hypertext: Object Class - Class to which a document belongs.
Document Name USMD_DATA_TRANSFER_UPL    

Use

This Business Add-In (BAdI) is used in the application component Master Data Governance (CA-MDG) for uploading master data, language-dependent texts, and hierarchies to the Master Data Governance hub.

An active implementation is called when the Web Dynpro application File Upload (USMD_FILE_UPLOAD) is executed. The BAdI contains the following instance methods:

  • CONVERT
  • FINALIZE

CONVERT Method

The CONVERT method makes it possible to convert field values from an external format to the internal SAP format. This is only useful if the SAP conversion exit should not be used. The data should only be converted if it is in a format that the SAP system cannot interpret.

The method is called once for each row in the file. The entire row is provided in the imported external format. The parameters of the method have the following meanings:

  • IO_MODEL_EXT is a reference to the metadata of the data model. The field properties can be determined here, for example.
  • I_ENTITY Indicates the entity type for which the upload is to take place.
  • IS_SETTINGS contains the upload settings. Here you can determine if master data or hierarchies are being transferred.
  • IS_DATA contains the data in the external format that is to be converted. This data can only be exported.
  • ITS_FIELD contains the fields in the order in which they appear in the structures IS_DATA, ES_DATA and ES_DONE.
  • ET_MESSAGE is filled with error messages if the conversion is not possible.
  • ES_DATA contains the converted field value if the conversion from the external format to the SAP format is done in the BAdI.
  • ES_DONE is a list of indicators for each field to be converted. If the conversion is done in the BAdI, an 'X' must be written to this field.

For hierarchies, the structures IS_DATA, ES_DATA and ES_DONE receive the substructures _HEADER, _PARENT, _CHILD and _HRYATTS. If it has been defined for the hierarchy upload that there is a field in the header, then this field is arranged in the substructure _HEADER. If the field belongs to the higher-level node, it can then be found in the substructure _PARENT. Similarly, the lower-level node is assigned to substructure _CHILD and the edge attributes are assigned to the substructure _HRYATTS. The example implementation of method CONVERT by class CL_USMD_DATA_TRANSFER_UPL_BADI (method IF_EX_USMD_DATA_TRANSFER_UPL~CONVERT) illustrates how these structures can be accessed. In the example method, a conversion is carried out if an ALPHA conversion has been defined. The indicator in the ES_DONE structure is also automatically filled.

The IS_DATA structure also contains the line number in the USMD_LINENO field. This line number corresponds to the position of the data record in the upload file. The line number can be used in error messages.

FINALIZE Method

The FINALIZE method makes it possible to change data that is already in the internal SAP format. All the data rows are processed at once. You have the following options:

  • Add new rows
  • Change individual values
  • Delete individual data rows

The parameters of the method have the following meanings:

  • IO_MODEL_EXT is a reference to the metadata of the data model. The field properties or the name of the data model can be determined here.
  • I_ENTITY Indicates the entity type for which the upload is to take place.
  • IS_SETTINGS contains the upload settings. Here you can determine if master data or hierarchies are being transferred.
  • ITS_FIELD contains the fields in the order in which they appear in the structures IS_DATA, ES_DATA and ES_DONE.
  • ET_MESSAGE is filled with error or information messages.
  • CT_DATA contains the data in the internal format. CT_DATA is a standard table. The structure of the data records corresponds to the IS_DATA parameter of the CONVERT method. Data records can be deleted from, added to, or changed in table CT_DATA.

If data records are added to CT_DATA, you should set the USMD_LINENO field either to the initial value or select a value that indicates that this data record has been added and was not already in the file.

Standard settings

In the standard system, there is no activated BAdI implementation.

The BAdI is not filter-dependent.

The BAdI is not designed for multiple use.

Activities

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

Example

The CL_USMD_DATA_TRANSFER_UPL_BADI class is an example implementation. The access to the structures ES_DATA, ES_DONE, and IS_DATA is shown in the instance method CONVERT. Due to affects on performance, you should not implement this example implementation since identical results can be achieved directly without a BAdI.

Business Attributes
ASAP Roadmap ID 257   Create User Exits 
Mandatory / Optional 3   Nonrequired activity 
Critical / Non-Critical 2   Non-critical 
Country-Dependency A   Valid for all countries 
Maintenance Objects
Maintenance object type E   Business Add-In - Definition 
History
Last changed by/on SAP  20091109 
SAP Release Created in 702