Skip to Content
avatar image
Former Member

HCP-IS Dynamic Value Mapping

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Feb 24, 2017 at 04:39 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

      • 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
  • avatar image
    Former Member
    Feb 24, 2017 at 10:10 AM

    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?

    Add comment
    10|10000 characters needed characters exceeded

    • 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