on 06-24-2010 12:34 PM
Dear all
I have SAP PI 7.1
I am facing problem in Receiver Determination while using Condition to select receiver based on the values in the payload.
I need to acheive:
IF
/payload/field1 = "A" then Receiver A
IF
/payload/field2 = 2 then Receiver B
I have Standard receiver determination.
I do not know how to set Condition (under Local Rule) to compare String and Integer values with elements in the payload.
Can someone please advise?
thanks
Alkesh
Hi,
create this routing rule
/payload/field1 = 'A' -->System A
Add a new routing Rule --> Icon [ ]
/payload/field1 = 2 ---> System B
Take in count that the string values must be defined with single quotes ' '
Thanks
Rodrigo P.
Edited by: Rodrigo Alejandro Pertierra on Jun 24, 2010 12:42 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
It does not work with single or double quotes.
The Trace shows following:
<Trace level="2" type="T">......extracting (new) for Extractor: XP /p1:SomeInterface/BGR00/MANDT </Trace> <Trace level="2" type="T">......extracting values found: 0 </Trace> <Trace level="2" type="T">......extracting values found: 0 </Trace> <Trace level="2" type="T">...invalid Receiver
There is something not right with the string comparisions for sure because when compare the payload field with not NULL, the comparision result is positive, receiver it determined.
Please suggest.
thanks
Alkesh
Hi Alkesh,
It seems the message interface you are using and the xpath message are not same. In your source payload I see:
<?xml version="1.0" encoding="utf-8" ?>
<ns:MsgInterfaceName_Out xmlns:ns="urn:somens.com">
<MsgInterfaceName>
<BGR00>
<STYPE>0</STYPE>
<GROUP>123 ABC</GROUP>
<MANDT>001</MANDT>
<USNAM>FI_BATCHUSER</USNAM>
<START />
<XKEEP>/</XKEEP>
<NODATA>/</NODATA>
</BGR00>
</MsgInterfaceName>
</ns:MsgInterfaceName_Out>
But your trace says the xpath as /p1:SomeInterface/BGR00/MANDT. So something is wrong here. Indeed your xpath should be like this: MsgInterfaceName/BGR00/MANDT
So select the source field it should be like above and = "001". Put double quotes. It should work
Check this out. Something fussy here. Take a look at both of them.
Regards,
---Satish
Hi,
In receiver determination,under TYPES OF RECEIVER DETERMINATION,there is a table called as Configured Receivers.
Add a condition to that table by selecting from the populated window that you will see after clicking on CONDITION column.
There you can give the value of Left operand as
/payload/field1
and on the right operand give the value as
"A".
Close the pop up,now you have to give the value of SERVICE i.e. the receiver
Receiver A
Similarly do it for /payload/field2 = 2 then Receiver B.
SAVE & ACTIVATE the receiver determination.
try n let me know if you faced any issue.
Thanks
Nidhi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
I had tried all that, did not work.
In the payload I can see the value in the element as 001.
I tried the following but non worked:
"=" as Operation, xpath in Left Operand, 001 in Right Operand
"=" as Operation, xpath in Left Operand, '001' in Right Operand
"=" as Operation, xpath in Left Operand, "001" in Right Operand
"=" as Operation, xpath in Left Operand, \"001\" in Right Operand
"EX" as Operation, xpath as /p1....field == "001"
Any many other java methods like equals(), startsWith(), endsWith() etc in combination with EX as Operation, none worked.
In each case the result is that Receiver not found which shows that the condition is not working.
I could check the field <> NULL and the condition worked.
As I understand, the field holds 001 but I can not compare it with string "001" in the condition.
Any known issues with string comparisions in the Condition?
thanks for responses this far.
rgds
Alkesh
Hi
Here is the incoming payload.
<?xml version="1.0" encoding="utf-8" ?>
<ns:MsgInterfaceName_Out xmlns:ns="urn:somens.com">
<MsgInterfaceName>
<BGR00>
<STYPE>0</STYPE>
<GROUP>123 ABC</GROUP>
<MANDT>001</MANDT>
<USNAM>FI_BATCHUSER</USNAM>
<START />
<XKEEP>/</XKEEP>
<NODATA>/</NODATA>
</BGR00>
</MsgInterfaceName>
</ns:MsgInterfaceName_Out>
I need to set following condition:
If MANDT = 001 then receiver 1
Please note:
If I take out the condition then the interface completes successfully
thanks
Alkesh
what exactly is the issue?
Ref:
/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
/people/shabarish.vijayakumar/blog/2005/08/03/xpath-to-show-the-path-multiple-receivers
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.