Skip to Content

For a general understanding of value mapping read
here

To define a value mapping in the integration directory, goto Tools –> Value Mapping

image

In the pop-up that’s displayed, enter the values, SourceAgency & SourceSchema (for the source Agency & Schema) and TargetAgency & TargetSchema (for the Target Agency & Schema).
Enter the value mapping, the source and the target values.
In this case, a simple mapping is created as shown.

image

This simply means that, for the given source agency and schema contains the value “1”, the target needs to contain the value “Mr.”

In the integration directory,
Create data types, messages types, outbound and inbound interfaces. These are pretty straightforward tasks, so the details about them are not provided here.

Data type:

ValueMappingSource, ValueMappingTarget

Message type:

ValueMappingSource, ValueMappingTarget

Outbound message interface:

ValueMappingSource

Inbound Message interface:

ValueMappingTarget

We will create a message mapping called valuemappingTest.
Create a new function as:

image

Import the package com.sap.aii.mapping.value.api.*;

The java code for this function is as follows:

String context = “http://sap.com/xi/XI“;

String senderAgency = “SourceAgency”;

String senderScheme = “SourceScheme”;

String receiverAgency = “TargetAgency”;

String receiverScheme = “TargetScheme”;

IFIdentifier src = XIVMFactory.newIdentifier(context, senderAgency, senderScheme);

IFIdentifier dst = XIVMFactory.newIdentifier(context, receiverAgency , receiverScheme);

try {

String res = XIVMService.executeMapping(src, dst, Source);

return res;

} catch (ValueMappingException e) {

// message the following if not found:

return  (“no ValueMapping found for [“Source“]”);

}

For a complete list of java classes and methods available to access value mapping, read here  .

image

When source data contains a value thats not found the mapping, the code in the catch block is executed the result is shown below.

image

</br>

To report this post you need to login first.

4 Comments

You must be Logged on to comment or reply to a post.

  1. Dheeraj Mahajan
    Hi Sukumar

    If we want to raise a warning, that value could not be found, as in general my target field should not have string “Value not found [10]” I would rather prefer to send a blank value and raise an warning and continue the processing or exception if it is a key field and stop the processing.
    How could we add that in the Java Function.

    Regards
    Dheeraj

    (0) 
  2. Bala Prasad Howde Kari
    Hi Natrajan,

    I have query, suppose I need get multiple values for the mapped value.

    For this case, i have used IFRequest, IFResponse.

    after getting the mapped values, i need to return this values to ResultList.

    Here, how can i add IFResponse type data to ResultList

    (0) 

Leave a Reply