04-12-2007 7:08 AM
Dear All,
Can anyone tell me a Function Code or sample code to count the number of charactes in a text.
Regards,
Vijay
04-12-2007 7:18 AM
Hi to count the number of character in text... use the following code.
data: l_length type i,
text(200).
text = 'My TEXT'.
l_length = STRLEN( text ).
l_length = 7.
Message was edited by:
Abhay Chauhan
04-12-2007 7:18 AM
Hi to count the number of character in text... use the following code.
data: l_length type i,
text(200).
text = 'My TEXT'.
l_length = STRLEN( text ).
l_length = 7.
Message was edited by:
Abhay Chauhan
04-12-2007 7:59 AM
04-12-2007 8:01 AM
04-12-2007 8:23 AM
Hi,
Please check the code below:
To read the last characters of a string:
DATA: offset TYPE i.
DATA:str(15) TYPE c.
v_string = STRLEN( gt_dummy ).
v_string = v_string - 20.
Regards
Kannaiah
04-12-2007 8:27 AM
also chk this
REPORT ZTEST.
DATA : V_STR TYPE STRING VALUE 'asfrasgdgkjkasdgjkjdskgjsd',
V_LEN TYPE I.
CALL FUNCTION 'STRING_LENGTH'
EXPORTING
STRING = V_STR
IMPORTING
LENGTH = V_LEN.
WRITE : / V_LEN.
04-12-2007 8:29 AM
hi
<b>use the inbuilt function strlen</b>
Number of characters in arg; blanks at the end of data objects with a fixed length are not counted, although they are counted in type string data objects. If you use a non-Unicode double-byte code, a character that occupies 2 bytes is counted twice.
<b>example</b>
data: v_len type i,
v_str type string value 'gggugik'.
v_len = strlen( v_str ).
write:/ v_len.
Regards,
ravish
<b>plz reward points if helpful</b>
04-12-2007 8:29 AM
04-12-2007 8:30 AM
Hello,
Use the STRLEN command. Ex: STRLEN( variable ).
Regards,
Shehryar Dahar
04-12-2007 8:31 AM
Hi,
Use STRLEN() standard function provided in SAP.
Reward is useful,
Regards,
Tanmay
04-12-2007 8:32 AM
Hi,
Can u tell me your proper reqmnt. the above posts seems to solve your purpose what is your actual need.
if your purpose is solved close this post
regards,
Navneeth.K
04-12-2007 9:34 AM
Dear All,
Thanks a ton for your replies . The output was achieved as per your guidances.
Thanks once again!!!!
Regards,
Vijay