2007 Jun 28 10:52 AM
Hi.
In a fied i need the last 10 characters but i don´t know the leght of the field.
Any idea.
Thanks.
2007 Jun 28 10:57 AM
Hi,
Please try this FM ACEPS13_AWKEY_DECODE.
<b>Reward points</b>
Regards
2007 Jun 28 10:55 AM
use describe statment to know the length of the field
DESCRIBE FIELD f
2007 Jun 28 10:55 AM
Hello,
Do like this.
data: char(20) value 'select last characters',
len type i.
len = strlen ( Char).
len = len - 10.
write: char+len(10).
Vasanth
2007 Jun 28 10:56 AM
Hi
get the length of the same using STRLEN.
subtarct the toatl length - 10.
then use the offset method and pass the value
then pass the val;ue of this as offset and value as 10
Regards
Shiva
2007 Jun 28 10:57 AM
data : len type i,
text(40) value 'abcdefghijklmon',
ntext(10).
compute len = strlen( text ).
len = len - 10.
ntext = text+len(10).
write : / ntext.
regards
shiba dutta
2007 Jun 28 10:57 AM
Hi,
Please try this FM ACEPS13_AWKEY_DECODE.
<b>Reward points</b>
Regards
2007 Jun 28 10:57 AM
Use the to STRLEN( <c> ).get the lenght of the field
lv_len = STRLEN( <c> ).
2007 Jun 28 10:59 AM
The field is a type string and the content can to be variable.
2007 Jun 28 11:02 AM
Hi,
Check this can help you.
DATA: FLD(8),
LEN TYPE I.
DESCRIBE FIELD FLD LENGTH LEN IN CHARACTER MODE.
Result: LEN contains the value 8.
2007 Sep 11 4:04 PM
REPEAT: The variable is a type string and the before code not is accept.
2007 Sep 11 4:34 PM
HI,
This will work.. irrespective of the length..
data: char(20) value 'select last characters',
len type i.
len = strlen ( Char).
if len > 10.
len = len - 10.
write: char+len(10).
else
write char.
endif.
Thanks
Mahesh
2007 Sep 11 4:40 PM
I modified Mahesh's code a bit:
DATA: char TYPE string VALUE 'select last characters',
len TYPE i.
len = STRLEN( char ).
IF len > 10.
len = len - 10.
WRITE: char+len(10).
ELSE.
WRITE char.
ENDIF.
Rob