on 02-25-2011 5:05 PM
Dear all,
I have to determine the receiver based on one input field.
If Status is PICKUP or DELIVERY OR READY TO DELIVER, i have to send it to ECC, else i have to send to Error folder.
I did with Receiver determination X-path, and working fine.The issue is if i give "PICKUP" in lower case like "pickup" it is going to error folder.
Means this is case sensitive, How to handle this. In mapping we can transform to Upper case but how in x-path editor to handle this?
Regards
Hi,
Just add another condition in Receiver Determination where you check in XPath whether Status=PICKUP OR STATUS=pickup.
Repeat the same for DELIVERY OR READY TO DELIVER if necessary. That's the simplest way to solve your issue.
Happy to help
Thanks
Biswajit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I think you can use the Xpath functions (here fn:upper-case(string)) in the condition editor by manually editing the Xpath expression.
http://wiki.sdn.sap.com/wiki/display/XI/XpathConditioninReceiverDetermination
/people/shabarish.vijayakumar/blog/2006/06/07/customise-your-xpath-expressions-in-receiver-determination
xpath functions -
http://www.w3schools.com/Xpath/xpath_functions.asp#string
I haven't tried this ever..but theoritically, it should work.
Edited by: nagarjuna _s on Feb 25, 2011 6:34 PM
I dont have any spaces in input file value. it is just pickup
<ShipmentStatusDetail>
<ShipmentStatusCode value="pickup"/>
<ShipmentStatusReason>NS</ShipmentStatusReason>
<ShipmentStatusTime>
<Date>
<Day>25</Day>
<Month>2</Month>
<Year>2011</Year>
</Date>
<Time>
<Hour>14</Hour>
<Minute>30</Minute>
<Second>0</Second>
<Millisecond>0</Millisecond>
<TimeZone>CS</TimeZone>
</Time>
</ShipmentStatusTime>
</ShipmentStatusDetail>
Regards
Hi Bhavana,
Best way, as you already suggested is that in the message mapping where you are putting values into the field Status, convert characters to upper case.Like this UDF below will convert all character to upper case thus receiver determination will work properly. The name of the UDF is changeCase. I have always used upper case for receiver determination.
INPUT to the UDF=" PIckup"
OUTPUT string= "PICKUP"
public class UpperCase {
/**
@param args
*/
public static String changeCase(String s)
{
String a="";
try
{
int i,l;
l=s.length();
for(i=0;i<l;++i)
{
if(s.charAt(i)>='a' && s.charAt(i)<='z')
{
a+=(char)((int)s.charAt(i)- ('a'-'A'));
}
else
{
a+=s.charAt(i);
}
}
}
catch(Exception e)
{
e.printStackTrace();
}
return a;
}
public static void main(String[] args) {
// TODO Auto-generated method stub
String s="pickupa";
System.out.println(changeCase(s));
}
}
regards
Anupam
Edited by: anupamsap on Feb 27, 2011 4:31 AM
Edited by: anupamsap on Feb 27, 2011 4:43 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Use XPath expression something similar below....
/p1:MT_AAAA [ toUpperCase(fieldName) ]='PICKUP' . This editor trims square bracket in this expresssion
Note: start square bracket after AAAA and end before =
Use this link and follow how they do for substring function..similarly we need to do here
http://wiki.sdn.sap.com/wiki/display/XI/XpathConditioninReceiverDetermination
Edited by: Baskar Gopal on Feb 25, 2011 1:01 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I used like this and getting error saying like Error when determining the receiver: Problem
evaluating a condition: Exception CX_SWF_RLS_RULE
Check the screen from x-path
http://img708.imageshack.us/img708/3640/xpath.jpg
Regards
Baskar,
Now modified the x-path expression and looks like as you suggested. Even though i am getting the issue.
Please see the x-path Left Operand , Operation, Right Operand all are correct or not.
And also one more thing is i am getting the PICKUP values from Attribute in source structure not from Element. If u see the XPath Expression, u will notice that
http://img829.imageshack.us/img829/7162/xpath1.jpg
Regards
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
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.