cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver Determination Question

Former Member
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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

Former Member
0 Kudos

Like this i have so many status codes. so many "OR" conditions

Any other thoughts??

Regards

Former Member
0 Kudos

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

Former Member
0 Kudos

This is what i have in my X-Path editor

http://img820.imageshack.us/img820/7162/xpath1.jpg

Regards

Former Member
0 Kudos

It should be ...


/ShipmentStatusTransaction/ShipmentStatus/ShipmentStatusDetail/ShipmentStatusCode[upper-case(@value)='PICKUP']  

Former Member
0 Kudos

Ram,

Did as you said, now also it is selecting other Receiver.

Always it is going to else receiver only even though we have status as pickup or some thing else

Regards

Former Member
0 Kudos

Did your input values contains any spaces??? Kindly provide the part of the input message!!

Regards

Ramg

Former Member
0 Kudos

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

Former Member
0 Kudos

I Checked with SUM function with other field, that is working fine absolutely

I doubt the issue might be with the "upper-case" function!!

Any one tested this from your end??

Regards

Former Member
0 Kudos

hi

Upper case or lower case are XPATH 2.0 functions.. try using translate function



/ShipmentStatusTransaction/ShipmentStatus/ShipmentStatusDetail/ShipmentStatusCode[translate(@value,'pickup','PICKUP')='PICKUP']  



Regards

Ramg

Former Member
0 Kudos

Thank you Ram

Regards

Answers (2)

Answers (2)

anupam_ghosh2
Active Contributor
0 Kudos

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

baskar_gopalakrishnan2
Active Contributor
0 Kudos

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

henrique_pinto
Active Contributor
0 Kudos

>

> This editor trims square bracket in this expresssion

You can input square brackets using the markup.

/p1:MT_AAAA[toUpperCase(fieldName)]='PICKUP'.

BR,

Henrique.

Former Member
0 Kudos

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_gopalakrishnan2
Active Contributor
0 Kudos

Dont see square bracket in your attachment.. something as below...

/p1:MT_AAAA[upper-case(fieldName)]='PICKUP'.

Former Member
0 Kudos

You have written something like /root/.../upper-case(@value)

Can you try upper-case(/root/.../@value)?

i.e. apply upper-case() or whatever the function name is to the entire X-path and not attribute only( as you have done) )

rgds

gab

PS: Just a guess, I am not sure

Former Member
0 Kudos

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

Former Member
0 Kudos

Did you try it, Bhavana?

rgds

gab

Former Member
0 Kudos

Gaurav, i tried that option. Din't worked!!!

I am using External Definition, will that making any difference here?

Regards

Former Member
0 Kudos

No, it does not matter

Also you are using = to compare strings ... there is another option with waved = sign ( the third from top). You may try that :$

rgds

gab

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Dont use right hand operand and just follow the link I given... only left and operation

operation is EX

Former Member
0 Kudos

This 3rd option from Top also didn't worked

Regards

Former Member
0 Kudos

Baskar,

I did as u suggested, this time is routed to Error folder even though the status is "pickup" i have

It has to goto ECC

Regards