on 2024 May 25 1:10 PM
Dear Experts,
I have maintained a VM table as below and trying to fetch the values accordingly through the below script. Surprisingly while simulating getting the desired output as SNDPRN (as property) but when triggering from sender then the Groovy is throwing exception as it can't find the value in VM.
Please suggest what could be issue here .
Request clarification before answering.
Hello,
Please check if your header is properly being set and able to see the value in Header ( using trace and not via simulation ).
Apart from that your script looks good.
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
import com.sap.it.api.ITApiFactory;
import com.sap.it.api.ITApi;
import com.sap.it.api.mapping.ValueMappingApi;
def Message processData(Message message) {
//Body
def valueMapApi = ITApiFactory.getApi(ValueMappingApi.class, null);
def map = message.getProperties();
def sourceAgency = map.get("sourceAgency");
def sourceIdentifier = map.get("sourceIdentifier");
def sourceValue = map.get("sourceValue");
def targetAgency = map.get("targetAgency");
def targetIdentifier = map.get("targetIdentifier");
def value = valueMapApi.getMappedValue(sourceAgency, sourceIdentifier, sourceValue, targetAgency, targetIdentifier);
def messageLog = messageLogFactory.getMessageLog(message);
if (messageLog != null ) {
if ( value != null ){
messageLog.addAttachmentAsString("Output : Target Value Mapping is ", value, "text/plain");
}
else{
messageLog.addAttachmentAsString("Output : Target Value Mapping is ", "Not Found", "text/plain");
}
}
return message;
}
Regards,
Sriprasad Shivaram Bhat
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
31 | |
10 | |
8 | |
7 | |
6 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.