01-14-2008 11:37 AM
What is the ABAP code to find the last three characters of a string?
01-14-2008 11:43 AM
data : a type string,b type i,c type string,d type i.
a = 'abcdefghi'.
b = strlen( a ). "9
d = b - 3. "6
c = a + d(3). "ghi
write
c.
01-14-2008 11:40 AM
hi,
data : lv_string type string.
to get last 3 characters use the code
lv_string + 3.
01-14-2008 11:43 AM
data : a type string,b type i,c type string,d type i.
a = 'abcdefghi'.
b = strlen( a ). "9
d = b - 3. "6
c = a + d(3). "ghi
write
c.
01-14-2008 11:43 AM
Hi,
var1 = STRLEN(var)
var2 = var1 - 3
var+var2(var1) would give you the lst three characters
Pankaj
01-14-2008 11:46 AM
SHIFT lf_string RIGHT CIRCULAR BY 3 PLACES.
WRITE lf_string(3).
11-13-2013 5:52 AM
06-17-2014 8:32 AM
01-14-2008 11:47 AM
Use FM 'STRING_REVERSE'. Reverse your string and select first 3 characters
01-14-2008 12:02 PM
but then the content is backwards, e.g. "ramuk hsekum"!
you'd have to put the result into STRING_REVERSE again to get the actual sequence.
Edited by: Aravinda A Hegde on Jul 27, 2009 3:02 PM
07-27-2009 11:52 AM
data: c TYPE string VALUE 'this is string',
c1(3),
len TYPE i.
len = STRLEN( c ).
len = len - 3.
c1 = c+len(3).
WRITE / c1.
try this
Edited by: mayank jain on Jul 27, 2009 1:03 PM
10-05-2011 12:42 PM