Skip to Content

Retrieve messageID in Custom Function

Hello,

what would be the recommended option to retrieve a messageID in a custom function (groovy)?

Is there any documentation on standard methods that can be used in groovy script to achieve this?

Thank you for your help!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 25, 2017 at 08:45 AM

    Hello Florian,

    Below code will work for you.

    import com.sap.it.api.mapping.*;
    
    //Add MappingContext as an additional argument to read or set Headers and properties.
    
    def String customFunc(String input_date,MappingContext context){
        
        //Read property Value and store it in String
        String propVal = context.getProperty(SAP_MessageProcessingLogID);
        propVal_Str = propVal.toString();
        
        
      return propVal_Str;
        
    }
    

    Regards,

    Sriprasad Shivaram Bhat

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 24, 2017 at 03:33 PM

    Hi,

    have you tried

    String messageId = message.getPropoerty("SAP_MessageProcessingLogID")

    Add comment
    10|10000 characters needed characters exceeded

    • could you pls try this.

      import com.sap.gateway.ip.core.customdev.util.Message;

      def Message processData(Message message) {

      //Body def body = message.getBody();

      def mplId = message.getProperty("SAP_MessageProcessingLogID");

      return message;

      }