cancel
Showing results for 
Search instead for 
Did you mean: 

Setting Headers and Properties in Message Mapping

06-03-2021 6:41 PM
aayushaggarwal Active Participant
8600 views 3 comments Go to solution
SAP Managed Tags
Subscribe

Hi Experts,

As we have the option to get/read the values of header and properties in the Message Mapping using Groovy Scripting, as mentioned in this BLOG

Is there any option, using which we can create/set the headers and properties in Message Mapping in Cloud Integration?

Regards,

Aayush Aggarwal

Accepted Solutions (1)

Accepted Solutions (1)

manoj_khavatkopp
Active Contributor

Hi Aayush :

1. Open your mapping and click on create:

2. Add the below sample code :

import com.sap.it.api.mapping.*;
def String customFunc1(String P1,String P2,MappingContext context) {
         String value1 = context.setHeader("Myheader",P1);
         String value2 = context.setProperty("MyProperty",P2);
         return "";
}

3. Add the newly created script in the mapping editor and assign the source/target field.

4. Result

Thanks,

Manoj

aayushaggarwal
Active Participant

It worked. Thanks.

Answers (0)