Applying Value Conversion

Objective

After completing this lesson, you will be able to apply value conversion techniques, understand the concept of value mapping, effectively manage missing values, and identify report errors in data mapping.

Value Conversion

Flow diagram showing steps for Field Mapping.

The data format in the source and destination system may differ. It's possible that a different data format is used in the source and destination system.

Illustration of the mapping of the source and destination data format.

Data conversion is done on a field level. In the field mapping of the corresponding field, you have to define the following data:

Data Element for Conversion: Defines the data element for conversion. In addition to the Data Element for Conversion, the Direction of Conversion Exit also needs to be maintained. If the direction is not maintained, the conversion is ignored.

Conversion Routine: Converts data from display format to internal format and vice versa. If a standard conversion is not suitable, it can be overridden by a conversion routine in the underlying domain.

A conversion routine is identified by its five-place name and is stored as a group of two function modules. The function modules have a fixed naming convention. The following function modules are assigned to conversion routine xxxxx:

  • CONVERSION_EXIT_xxxxx_INPUT
  • CONVERSION_EXIT_xxxxx_OUTPUT\u000B

The input module performs the conversion from display format to internal format. The output module performs the conversion from internal format to display format.

Direction of Conversion Exit: Defines the conversion direction for the input data defined in the Conversion Exit field. Direction can be External to Internal or Internal to External. The Conversion Exit and the Direction of Conversion fields are required to be used in combination.

How to Convert with Data Elements

Watch this demo to explore the process of converting data values to match the required data type within different structures. Learn how to map fields, define conversions, and test the value transformation for effective data integration.

Introduction to Value Mapping

Flow diagram showing steps for Value Mapping.

A value mapping maps a specific source value to a specific destination value and has a well-defined input and a well-defined output.

A to B Value Mapping illustration.

Value mappings can:

  • Derive a value in the destination structure from up to five values in the source structure
  • Directly access the data of the back end system to derive the destination value
Namespaces value mapping illustration as describe in the text below.

A value mapping is created in the Application Interface Framework Customizing in the Define Value Mappings activity and can be used in different interfaces. A value mapping has a well-defined input (up to five field values) and a well-defined output (one field value) and remains independent of the context in which they are called. Therefore, value mappings can be reused by several interfaces in several namespaces.

Value Mapping Creation

A value mapping is created in the Application Interface Framework Customizing in the Define Value Mappings activity. Within a value mapping, you have different options for creating a value mapping:

  • Mapping Table (with /AIF/VMAP): You can decide if the value mapping contains master data or customizing data. Depending on this setting, the entries will either be transported to the productive system (Customizing), or they have to be maintained in the productive system (master). If you select master, the business users are able to maintain missing values. You can decide how many external values are passed into the value mapping. The maintenance transaction /AIF/VMAP displays a generic table. If you maintain the data elements of your external and internal fields, users will have an F4 help (if value range exists) in /AIF/VMAP.
  • Database select: You can derive values directly from an existing database table. You have to specify the database table, the field you want to select, and a where condition.
  • If your requirements cannot be met with the with the Customizing options, you can also create a function module for the value mapping.

Value mapping creation options as described in the text.

How to Create a Value Mapping with Dictionary Lookup

Discover in this demo the creation of value mappings for fields within a data structure. Learn how to extract and map data from different sources to facilitate seamless integration. Follow the steps to set up value mappings efficiently and perform optional testing for accurate results.

How to Create a Value Mapping with Application Interface Framework Conversion Table

Watch this demo as we delve into determining and translating customer types from the source interface to the target structure. Explore the process of defining and testing value mappings for converting multicharacter customer types to required one-character fields. Learn how to set up value mappings, maintain mapping entries, and test the mappings using the SAP Application Interface Framework test tool for data accuracy.

Missing Values and Error Reporting

A value mapping is defined for a field. The incoming message contains a value that is maintained in the value mapping. The message is successfully processed in SAP Application Interface Framework.

If an incoming message contains a value that's not maintained in the mapping value, the message is not successfully processed. If you have defined changeable fields, you can maintain the missing fields and then restart the message.

Diagram of tables showing mapping of an error.

Missing values can be maintained in the value mapping transaction (/AIF/VMAP). It is also possible to maintain missing values in Monitoring and Error Handling via the Value Mapping button. After the missing value is maintained, the message can be directly reprocessed and the error is solved.

If users choose the Value Mapping button inMonitoring and Handling, they're forwarded to theMaintain Value Mapping transaction. The missing value is displayed, and users can include the missing value via the Insert Values button.

Screenshots of Value Mapping with areas for insert values highlighted.

Error Message and Data Content Linkage

In monitoring and error handling, you can jump from an error message to the corresponding field in the data content view.

This only works if the erroneous field in identifiable.

Example 1 showing where the erroneous field is identifiable.

If the erroneous field is not identifiable, the forward navigation is not working. The ID is determined from the fields name, first name, and line.

Example 2 showing where the erroneous field is not identifiable.

If the value of a field is determined from more than one field, it's not possible to determine the incorrect field and highlight it. With a data link, it's possible to highlight the most likely erroneous field.

Example 3 showing how to make the data link.

A data link is used to link an error message to a specific field in the Data Structure view in the Monitoring and Error Handling transaction. SAP Application Interface Framework uses the current structure and the customized source field. If more that one source field is used, the link cannot be determined automatically at field level. In this case, you need to specify a specific link field in case of an error.

We create a link to the first name, as an entry in this field is most likely to be missing. If a user selects the error message, the first name field of the erroneous entry is highlighted.

How to Link Error Messages to Fields

Watch this demo to learn about creating and testing data links for connecting fields like AIRLINEID and CONNECTID. Discover the process of setting up data links and testing them for seamless data integration.

Log in to track your progress & complete quizzes