cancel
Showing results for 
Search instead for 
Did you mean: 

Get MessageID in udf

deva_gembali2
Participant
0 Kudos

Hi Expert,

   As I am following standard method to get messageId in udf , still getting empty value . Am I following right way to get PI messageID ?

Accepted Solutions (1)

Accepted Solutions (1)

vadimklimov
Active Contributor
0 Kudos

Hello Deva,

The code for retrieving message ID is correct. How do you test the mapping and observe no message ID has been returned by your UDF? Message ID value is assigned at runtime, so you have two options how you can check that your UDF works well:

1. Execute the scenario by sending a message (message ID will be generated and assigned at runtime) and then checking mapping output;

2. In test message mapping in ESR, provide a dummy message ID in header parameters section (by default, it is empty). This can be done on the tab "Test" of the message mapping, by navigating to the tab "Parameters" in the bottom, then filling respective header parameter for message ID:

Regards,

Vadim

deva_gembali2
Participant
0 Kudos

Thanks for your reply all.

  Yes , there is no issue. It seems there is a issue at ABAP Table maintenance. I re-generated ABAP table in Sm54 as new field was added in table.

And, also I have table variable ,I don't know whether it helpful or not. Now it is working.

Answers (2)

Answers (2)

diego_gabriel
Participant
0 Kudos

Hi Deva,

Try to add a trace statement... right after execute your scenario one more time and check what your are getting...

import com.sap.aii.mapping.api.AbstractTrace;

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

trace.addInfo("My MessageID = " + MessageID);

Regards,

Diego

former_member186851
Active Contributor
0 Kudos

Hello Deva,

Code seems to be fine.

Are you sure in run time value is not picked?