cancel
Showing results for 
Search instead for 
Did you mean: 

HCP-IS Dynamic Value Mapping

Krishneel
Participant
0 Kudos

Hi Everyone,

I wanted to check if it is possible to create a value mapping in HCP-IS where the Source Agency and Target Agency are identified at runtime rather than having to manually enter these at design time? I know this is possible in PI/PO but I cant get it to work in HCP-IS.

In my graphical mapping, I have tried using the standard Value Mapping function, from the drop down boxes, I tried setting the Source Agency as SenderParty and Target Agency as ReceiverParty. Also, in my iFlow, I have named my Sender endpoint the same as my Source Agency and Receiver endpoint the same as my Target Agency (as defined in the my value mapping). However this didn't seem to work.

Am I missing something here?

Thanks,

Krishneel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In HCI message mapping, with standard "valuemap" function currently it is not possible to perform dynamic value mapping. However you could create a new custom groovy script function (in message mapping or in iflow script) and use value mapping API (refer documentation guide) to perform the same. Roughly the script function would like the one below.

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;

}

Hope it helps 🙂

Vishnu Prasath

former_member233212
Participant
0 Kudos
  • Hi,
    Can you please help me out in this?
    I'm trying to pass the source agency dynamically. And want to use the source schema, target agency, target schema as it is in value mapping.

    How can I use the above script for my requirement?

    Regards,
    Vidhya

Answers (1)

Answers (1)

Krishneel
Participant
0 Kudos

Thanks Vishnu, the code you gave worked fine 🙂

At runtime (in a groovy script) is it also possible to get the names of the Sender and Receiver endpoints?

former_member233212
Participant
0 Kudos

Hi,

Can you please help me out in this?

I'm trying to pass the source agency dynamically. And want to use the source schema, target agency, target schema as it is in value mapping.

How can I use the above script for my requirement?

Regards,

Vidhya