cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Value Mapping in HCI

former_member302452
Participant
0 Kudos

Hi Experts,

I wanted to check if it is possible to create a value mapping in CPI where the Source Agency and Target Agency are identified at runtime dynamically on payload values.

Is it possible to achieve this by writing an script? Did anybody already succeed in doing so?

Regards,

Thouheed.

Accepted Solutions (1)

Accepted Solutions (1)

Sriprasadsbhat
Active Contributor

Hello Mohammed,

Below blog will help you to achieve the same.

https://blogs.sap.com/2018/07/18/dynamic-value-mapping-in-sap-cpi/

Regards,

Sriprasad Shivaram Bhat

former_member302452
Participant
0 Kudos

Hi Sriprasad,

I’m glad that you helped out, like most of the times.

Now i'm able to dynamic value mapping.

Thanks a lot.

Regards,

Thouheed

Answers (1)

Answers (1)

Sriprasadsbhat
Active Contributor
0 Kudos

Hello Mohammed,

Below will help you.

https://answers.sap.com/questions/136421/hcp-is-dynamic-value-mapping.html

Regards,

Sriprasad Shivaram Bhat

former_member302452
Participant
0 Kudos

Hi Sriprasad,

I have tried the same code in that i want source agency "COMMON" and "ERP" to be pass dynamically from my input payload.

How can I use the below script for my requirement.

import com.sap.it.api.ITApiFactory;
import com.sap.it.api.ITApi;
import com.sap.it.api.mapping.ValueMappingApi;
def String dynamicValueMap(String sAgency, String sSchema, String tAgency, String tSchema, String key){
def service = ITApiFactory.getApi(ValueMappingApi.class, null);
if( service != null) {
return service.getMappedValue(sAgency, sSchema, key, tAgency, tSchema);
}
return null;
}

Regards,

Thouheed.