on 09-23-2010 9:44 AM
Hi all,
I have a simple requirement in a receiver determination. In the structure of the XML message, there is a node "STATUS" with an element STATUS_CODE. This STATUS node can appear 0 or 9999 times.
I want to check if there is ANY STATUS with STATUS_CODE = "0", and if so, the message should be sent to a certain receiver. How to to that?
Will that be the solution: (//STATUS/STATUS_CODE = 0)?
Thanks,
CHRIS
> Will that be the solution: (//STATUS/STATUS_CODE = 0)?
Yes. Receiver determination is always an existence check.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
thanks. So what would be the difference between
(//STATUS/STATUS_CODE = 0)
and
(/STATUS/STATUS_CODE = 0)
The second example is what I get if I directly select the node and element within the tree in the condition editor. In example 1 I addes a "/" in the beginning manually, as I thought that is necessary to read all STATUS nodes in the source file.
Cheers,
CHRIS
> thanks. So what would be the difference between
http://w3schools.com/xpath/xpath_syntax.asp
> as I thought that is necessary to read all STATUS nodes in the source file.
No, this is not the reason for using // instead of /
Hi,
I have created some test messages. It is not working as described.
- If there is just one STATUS_CODE element with 0, the correct receiver is determined
- If there is just one STATUS_CODE with anything but 0, the correct receiver is determined
- If there are two STATUS_CODE elements (one with 0, one with 1), the result is the same as if there are are just STATUS_CODE elements without 0
What might be the problem here?
Thanks,
CHRIS
Hi again,
I think I found the problem.
Basically, I am not checking if the STATUS_CODE = 0 (0 means error), but if the STATUS_CODE != 1 (1 means success).
When I change the rec. determination to check if the STATUS_CODE = 0, it works fine e.g. if there is ANY STATUS_CODE with 0.
So it seems to me that the operator != can't be used to check a 1...n element? What might be the reason for this?
CHRIS
> So it seems to me that the operator != can't be used to check a 1...n element? What might be the reason for this?
I am not sure how != works, it is not documented well.
I suppose NE means: does not exist.
So if any node STATUS_CODE with value 1 exists, then the result is false.
If you want an existence check if this, you should apply this:
//STATUS [STATUS_CODE != "1"] EX
See also:
http://help.sap.com/saphelp_nwpi71/helpdata/EN/ab/13bf7191e73a4fb3560e767a2525fd/frameset.htm
(scroll to the bottom)
/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
Hi Christoph,
Refer the below link:
/people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.