cancel
Showing results for 
Search instead for 
Did you mean: 

How to get Message IDs in Java Mappings

Former Member
0 Kudos

Hello,

in PI 7.1 Java mappings the way of getting the trace object has changed from:

trace = (AbstractTrace) param.get(StreamTransformationConstants.MAPPING_TRACE);

to:

getTrace();

Because the Java mapping class definition changed from

implements StreamTransformation

to

extends AbstractTransformation

Is there something similar to get the message ID or do i have to use the old way:

public void setParameter(Map param) {
	this.param = param;
	if (param == null) {
		this.param = new HashMap();
	}
}
...
String MessageID = (String) param.get(StreamTransformationConstants.MESSAGE_ID);

Thanks and best regards,

Benjamin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

In PI 7.1 use:

java.util.Map map;

map = container.getTransformationParameters();

String messageID= (String) map.get(StreamTransformationConstants.MESSAGE_ID);

while container is the SAP pre-defined input parameter of you UDF.

Former Member
0 Kudos

I found an easyer way:

TransformationInput.getInputHeader().getMessageId();

But your reply brought me on the right track!

Thanks.

Answers (0)