(SM-2511) Type Mapping

(SM-2511) Type Mapping

Type Mapping is a feature that enables you to change the mapping of DDIC data types to target data types.

You can access custom data type mapping for storages via transaction /DVD/SM_SETUP by right-clicking the desired storage type and selecting Edit Mapping

Create custom mapping

This feature allows you to define custom mapping between ABAP types(DDIC) and storage types, providing flexibility in how your data is stored and retrieved. The behavior depends on the type of storage you are working with.

Tabular Storages

For tabular storages, you can edit mappings in two directions:

  • From DDIC to Storage.

  • From Storage to DDIC

Use the tabs provided in the interface to switch between these views.

Unsupported tabular storages:

  • Sybase IQ

  • Oracle

  • DB2

  • Transparent binary storage

Binary Storages

For binary storages, mapping is supported from ABAP type to Parquet format only. Other mapping directions are not supported

To edit a mapping, click Display <-> Edit in the toolbar and change the values in the ALV grid. Be careful about what original data types you change because you might need to use additional field routines in the extraction process to transform the format. Otherwise, the extractions can fail. After changing the data types, click Save to save the configuration. 

The settings are global for all storage connections of a particular storage type. Every Glue table created after saving the settings will have the new custom datatypes. Already created GLUE tables won’t be affected by the mapping change.

The fields Length and Decimals can contain flat numerical values, but also support formulas where <SRC> is referring to the original data type length/decimal value. Format: <SRC>[*/-+]([0-9]+)

In case of inconsistencies or difficult extractions, you can revert to the original settings by clicking Reset Mapping in the toolbar. 

Creating Data Elements or Domain Mappings 

You can also create data elements or domain mappings. This feature is only available in DDIC for Storage Mapping. To access this feature, click Data element mapping in the toolbar of Type Mapping.

The pop-up Kyano Storage Management Data Element Mapping appears, allowing you to edit data elements or domain mappings. 

You can edit mappings by clicking Edit. You can reset them to default values by clicking Reset data element mapping

If the DDIC data element that is being mapped exists, the value in the Storage Data Type column is automatically calculated. You can also change the storage data type. 

Data element mapping has a higher priority than type mapping. This means that if data element mapping exists, it will be used instead of type mapping. 

Examples:

Mapping Decimals to Decimal in Parquet

To map decimal ABAP types to Parquet:

  1. Go to transaction /DVD/SM_SETUP.

  2. Right-click any binary storage and select Edit Mapping.

  3. Go to the ABAP type to Parquet.

  4. In the toolbar, click Display <-> Edit.

  5. Change the mapping from P → DOUBLE to P → BINARY.

  6. For Logical Type, select Decimal.

  7. In the Length column, enter <SRC>*2-1.

  8. In the Decimal column, enter <SRC>.

  9. Click Save.

This allows precise control over decimal precision when storing numeric values in Parquet format.

Mapping DATS to Snowflake Date

  1. Go to transaction /DVD/SM_SETUP.

  2. Right-click the Snowflake storage type and select Edit Mapping

  3. Go to the DDIC To Storage tab

  4. In the toolbar, click Display <-> Edit and change the mapping of DATS > STRING to DATS > DATE

  5. Click Save

All newly created Glue tables will map the DDIC data type DATS to the Snowflake data type DATE

 Mapping XFELD to Snowflake BOOLEAN

  1. Start transaction /DVD/SM_SETUP

  2. Right-click the Snowflake storage type and select Edit Mapping

  3. Go to the DDIC To Storage tab 

  4. Click Data element mapping in the toolbar. 

  5. In the toolbar, click Display <-> Edit

  6. Click the Add button to add a new row. 

  7. In the Mapping drop-down menu, select DATA ELEMENT

  8. In the DDIC Data Element field, enter xfeld

  9. In the Storage Data Type field, enter BOOLEAN

  10. Confirm by clicking Continue in the bottom right corner of the screen (this saves the mapping).

In this case, you must use a custom routine.