cancel
Showing results for 
Search instead for 
Did you mean: 

Message Mapping (user-defined function)

Former Member
0 Kudos

Hi all,

Is there anyway to determine the XML message ID using an user-defined function in Message Mapping? When I go to SXI_MONITOR I see that all messages have an unique ID, but I'm having some difficulties to understand if there is any way to get that ID in a message mapping and pass it to a target structure? I see that it is possible to use constants like "Sender" and "Receiver", but I haven't found anything for the message ID.

Can you please help me?

Thanks in advance.

Regards,

Ricardo Inácio

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try this code..

Create an UDF and do not pass any arguments to it..

java.util.Map map;

// get runtime constant map

map = container.getTransformationParameters();

// get value of header field by using variable key

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

return msgid;

Now map this udf to your target field. Now test it....

P.s. Since message id is run time property therefore in mapping test tab it will not work. Try it at runtime.

Regards,

Sarvesh

Answers (4)

Answers (4)

Former Member
0 Kudos

Thank you all.

Former Member
0 Kudos

Hi ,

You can use MESSAGE_ID

This will solve ur problem

Jude

Former Member
0 Kudos
Former Member
0 Kudos

MESSAGE_ID is used for obtaining the message id....

You can query most of the message header fields during a mapping... for complete list

http://help.sap.com/erp2005_ehp_04/helpdata/EN/6e/ff0bf75772457b863ef5d99bc92404/content.htm

Regards,

Siva Maranani