Skip to Content
0

SAP PI - conditionally cancel message

Nov 09, 2016 at 05:50 PM

83

avatar image

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Ryan Crosby Nov 09, 2016 at 09:41 PM
2

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

Share
10 |10000 characters needed characters left characters exceeded
stephen xue Nov 10, 2016 at 12:42 AM
1

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.

Share
10 |10000 characters needed characters left characters exceeded
Evgeniy Kolmakov Nov 09, 2016 at 11:20 PM
0

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

If you put the condition in message mapping if there is no message to create then the message will be failed in PI but he dont want to fail in PI, Better way is Ryan's suggestion with ignore if no receiver found.

0

Yes, Praveen, you're right!

I've just mentioned it as another possible solution.

Regards, Evgeniy.

0
Adam Vogg Nov 10, 2016 at 02:15 PM
0

thanks all. Ryan, your solution works for me.

Share
10 |10000 characters needed characters left characters exceeded