Skip to Content
avatar image
Former Member

Get MessageID in udf

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 ?

Capture1.GIF (43.6 kB)
Capture.GIF (124.6 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Oct 28, 2015 at 11:53 AM

    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


    mapping test.png (22.5 kB)
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • Oct 28, 2015 at 11:35 AM

    Hello Deva,

    Code seems to be fine.

    Are you sure in run time value is not picked?

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 28, 2015 at 11:52 AM

    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

    Add comment
    10|10000 characters needed characters exceeded