on 03-21-2013 2:41 PM
Hi,
I have a fixed length flat file coming in into which I have to look at the first line's 4th to 7th positions. Based on that if it is "1234" then I need to route it to the receiver else I will ignore in the receiver determination.
Example input file -
M 0123456789ABCDEFGHIJKL
PR0123456789JIDFJDIFJD0244
PA0123456789JFDJF9384384K
We have module configuration where we are converting this to a line value pair something like this -
<?xml version="1.0" encoding="utf-8"?>
<ns:GMTLog xmlns:ns="http://sap.com/xi/GMStoreConnectivity">
<Line>
<Value>M 0123456789ABCDEFGHIJKL
</Value>
</Line>
<Line>
<Value>PR0123456789JIDFJDIFJD0244
</Value>
</Line>
<Line>
<Value>PA0123456789JFDJF9384384K
</Value>
</Line>
</ns:GMTLog>
When I tried to test my xpath in xpath tester it is working fine with the below xpath expressions -
1. /ns:GMTLog/Line[Value][1] --> This returned the first record completely
2. substring(/ns:GMTLog/Line[Value][1], 4, 4) --> This returned exactly what I am expecting "1234"
But the above 2 are not working in condition editor.
May I know the exact xpath expression to be used in this case to route the message to receiver when 4th to 7th position is "1234".
Thanks a lot in advance.
Regards,
Sarat
Hi Sarat,
that should look like:
substring(/ns:GMTLog/Line[1]/Value[1],4,4)
/Udo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Udo, Adarsh,
I tried both of your options and they yielded the below error -
Error: com.sap.aii.adapter.xi.routing.RoutingException: Can't determine receivers because condition evaluation failedcom.sap.aii.adapter.xi.routing.condition.ConditionException: Could not resolve needed Extractors for ConditionFragment
Thanks,
Sarat
You might want to use EX operator and try the below link
http://wiki.sdn.sap.com/wiki/display/XI/Xpath+Condition+in+Receiver+Determination
Oh sorry,
It should be
/p1:Segment/Field[substring(4,7) = '1234'] then EX
This should work. BTW this thread exactly matches ur requirement. Go through
http://wiki.sdn.sap.com/wiki/display/XI/Xpath+Condition+in+Receiver+Determination
It will work. Do one thing, in receiver determination, for this condition add the receiver system. In other words, when it is 1234 ( Use it as '1234' only) then route it to receiver.Add another condition and another receiver system. Type in a dummy business system name for second condition & don't forget to select condition 'If no receiver is determined proceed as follows: Select Ignore'. For the second condition, type in as ns:GMTLog/Line[1]/Value[not(substring(4,7)='1234')]
Reward points if helpful.
Hi Adarsh,
PI instantiates 2 flows for every message i.e. both the conditions are being met and the message is being sent to both the receivers.
Is there anyway of doing it correctly. Also I might have 5 more conditions like "2222" or "3333" or "4444" or "5555" I have to send it to receiver system. In all other cases I should not send it to any receiver. Message needs to be suppressed in PI(which can be achieved by selecting the option " Ignore" in ICO.
Thanks,
Sarat
Hi,
Can you please click on the picture which I had uploaded in my last post. In that one, I had considered a condition that if field is '1234' then it will go to the receiver system.If not then I am routing it to a dummy non existing business system, I typed in the name of the business system & to ensure that this dummy system does not give error, I selected, ignore in case of no receiver is found. As far as the issue of having multiple conditions is concerned, you can have multiple conditions as well as shown in the blog below:
Hope this helps..Reward points if useful.
Hi Adarsh,
Thanks for your reply but when I save the ICO its obviously throwing error that the business system doesn't exist. Also even if I create one and assign it with some channel (say File channel) I dont want all other messages (where condition is failing)to be processed through this dummy business system.
The issue is still open.
Thanks,
Sarat
Hi Sarat,
Can you do try one more thing pls. In the receiver configuration, you give conditions for sending to receiver like if substring is '1234' then send to receiver1 if '4567'then receiver 2. And select ignore if no receiver is determined, without giving a dummy business system name. Can you show me the screenshot of the receiver configuration step. Here is what should it be like:
Good day. Can I please have some clarity on what I need to correct on my Receiver expression test.
For the number of instances of the Summary segment, I am required to identify and test the Summary amount of SUMME if this is more than 5.00 (a currency amount). SUMME is a string so I thought I should convert this to a "number" value to test it.
Also ensuring that SUMME is checked when the SUMID is equal to 011.
Now I hope part of my solution below is correct, but the test of the field value is not being done.
Please help.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
AFAIK this condition check will happen only for the 1st occurrence of the Node...If its repeating then it will not check for each of the Node values...
Can you try to test this condition with just single occurrence of Node E1EDS01 with correct values..
(You sud have opened a new thread instead of posting in an Answered one)
Regards,
Azhar
Darren,
This cannot be achieved at Receiver Determination's Condition Editor because the segment occurs more than once and hence after your SUMID condition check you cannot do a condition check on the "corresponding" SUMME's value (where SUMMID = 011).
You can achieve this requirement at Message Mapping level. Do this condition check at the root node and create this root node only when condition check is success.
If you have opened a new thread for this issue by now, please provide the link here so for quick reference.
Thanks,
Sarat
Try substring as :
/p1:Segment/Field(substring(4,7) = '1234')
Also check
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
24 | |
12 | |
9 | |
7 | |
6 | |
5 | |
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.