Skip to Content

SAP PI - conditionally cancel message

Hello,

I have searched for an answer to this but cannot find it. I want to conditionally NOT send a message if certain criteria is met. I don't want it to result in an error, I simply want the message to not be sent. Is this possible?

My scenario is: System A generates status update messages for all statuses (I cannot alter this behavior) for System B to read in. If System A generates a message with status code = "Complete", then I do NOT want this message sent to System B. I thought maybe a Receiver Rule could do this, but I am not sure. Can I use "createif" on the top level in the message mapping or something like that?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Nov 09, 2016 at 09:41 PM

    Hi Adam,

    In your receiver determination there is an option to "Ignore" if no receiver is found. So you could have an XPath condition to check that status and simply not map that status to any receiver. Not sure how that shows in message monitoring as I have never had the requirement before but it should be easy enough to try out.

    Regards,

    Ryan Crosby

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 10, 2016 at 12:42 AM

    Hi Adam

    I am quite sure that a simple condition on no matter interface or receiver level in ICO won't fulfil your requirement. Both of ways will result in an error message in the message monitor even though the option for ignoring error if no receiver has been found was chosen.

    The correct way is to use extended receiver determination. by this means, the target message will be created on your certain condition. however if the condition has not been met, neither source nor target message will be generated in the message monitor. it means under such situation, no information can be tracked.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 09, 2016 at 11:20 PM

    Hi Adam!

    Another option, in addition to Ryan's answer, could be conditional target message creating in message mapping. So if the condition doesn't fit - no target message is created.

    Regards, Evgeniy.

    Add comment
    10|10000 characters needed characters exceeded

  • Nov 10, 2016 at 02:15 PM

    thanks all. Ryan, your solution works for me.

    Add comment
    10|10000 characters needed characters exceeded