cancel
Showing results for 
Search instead for 
Did you mean: 

Require a detailed explanation of Compare Function.

Former Member
0 Kudos

Hi Every One,

I require a an expalanation of the following function.

Compare Function:

When I try to compare two strings of values ABC and XYZABC it returns a value -23. Could you please provide me more details on how the comparision is been done by this function.

Kindly do the needy.

Thanq very much in advance

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

DID U CHK THIS:

http://wiki.sdn.sap.com/wiki/display/XI/StandardFunctionsinPI7.0

rajasekhar_reddy14
Active Contributor
0 Kudos

just i copied below content from help.sap.com,

http://help.sap.com/saphelp_nwpi71/helpdata/EN/c8/7e5e3c754e476ee10000000a11405a/frameset.htm

compare
 Compares string X with string Y:

R = 0, when the strings are equal
R = positive number i, when X is lexicographically larger than Y
R = negative number i, when X is lexicographically smaller than Y

i specifies the difference between the two strings lexicographically.

The function acts in the same way as the compareTo() method of the JDK class java.lang.String.

Regards,

Raj