2009 Mar 01 6:36 AM
Hi All,
is there any class having a method to calculate the string length.
Thanks
2009 Mar 01 6:48 AM
does it have to be a class? There is a keyword NUMOFCHARS or STRLEN to determine this.
2009 Mar 01 6:50 AM
Hi Ravi,
you can use the STRLEN. i don't think we need the class for that.
you will get direcly the no. of charectes in the string.
try below.
data: lv_string type string.
data: lv_char type i.
lv_char = STRLEN(lv_sti).hope it helps you.
Regards!
2009 Mar 01 6:57 AM
Hi,
i know that we can use strlen to cslculate the string length
but i need some fm or class method to calculate the str length...
Thanks
Ravi Aswani
2009 Mar 01 7:04 AM
Hi,
Please Check the following FMs.
STRING_LENGTH
SWA_STRINGLENGTH_GET
Hope will solve out,
Kind Regards,
Faisal
2009 Mar 01 7:05 AM
Hi Ravi,
You can use the FM SWA_STRINGLENGTH_GET
data: lv_length type SWAEXPDEF-ELEMLENGTH,
lv_string type string.
CALL FUNCTION 'SWA_STRINGLENGTH_GET'
EXPORTING
expression = lv_string
* CONDENSE_NO_GAPS =
* CONDENSE =
* WITH_LEADING_BLANKS =
* IMPORTING
LENGTH = lv_length
* EX_MODIFY_EXPRESSION =
.hope it helps you
Regards!
2009 Mar 01 7:13 AM
Thanks for the reply...
but i don't want to use obselete fm or fm that has not been released...
thanks
2009 Mar 01 11:35 AM
2009 Mar 01 11:58 AM