cancel
Showing results for 
Search instead for 
Did you mean: 

Query on Mapping Function

Former Member
0 Kudos

Hi Experts,

I am not clear about the functionality of the standard mapping functions

Indexof() and Lastindexof().

What is the functionality of 2 and 3 input parameters..

It would be help full if some one could explain with examples...

Accepted Solutions (1)

Accepted Solutions (1)

santhosh_kumarv
Active Contributor
0 Kudos

Hi saravana,

>>Indexof (2 input parameter)

Returns the positon where the second string is found in the first string.

Eg: santhosh & a = 1.

santhosh & s = 0.

>>Indexof(3 input parameter)

Returns the positon where the second string is found in the first string but the search starts from the specified position.

Eg: santhosh & s & 0 = 0 but

santhosh & s & 3 = 6 bcz after the 3rd pos s occurs at 6th pos.

>>Lastindex of(2 input parameter)

Eg: santhosh & s = 6.

>>Lastindexof(3 input parameter)

santhosh & s & 3 = 6

Lastindex is same as index except it searches for the last occurance

Hope this clears

Regards

San

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Santhosh/Das

Thanks for your replies...

Former Member
0 Kudos

Hi sarvanan,

indexOf(2 input parameters) means result is first position at which string Y is found in X and –1 if Y does not occur at all.

indexOf(Biplab,b)=0 and indexOf(Biplab,S)= -1

indexOf(3 input parameters) means first position from position Z at which string Y is found in X and –1 if Y does not occur at all

indexOf(Biplab,b,5)=1 (here search starts from "a")

indexOf(Biplab,l,5)= -1

LASTINDEX is same as index but reverse of Index....

lastIndexOf(2 input parameters) means last position at which string Y is found in X and –1 if Y does not occur at all.

lastIndexOf(3 input parameters) means last position from position z at which string Y is found in X and –1 if Y does not occur at all

for more info check text function here...

http://help.sap.com/saphelp_nw04/helpdata/en/2c/2d8c4024d26e1de10000000a1550b0/frameset.htm

Regrads

BILL