<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: counting string length in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502347#M1258573</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the string has only integers and commas you can use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIND ALL OCCURRENCES OF ',' IN string MATCH COUNT mcnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The number of integers is mcnt + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Sandra Marques&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Apr 2009 11:32:12 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-04-17T11:32:12Z</dc:date>
    <item>
      <title>counting string length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502345#M1258571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i want the count of the number of integers used in the string '1,2,10,22,3,5' leaving commas.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;plz help.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 11:22:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502345#M1258571</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-17T11:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: counting string length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502346#M1258572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

data:p_string.  "Your string

data :w_num(10) value '0123456789',
        count type i.

w_len = strlen(p_string)


do w_len times.



if p_string+count(count + 1) CA sy-abcde.      "if character add character to output

chara = charct + 1.

elseif p_string+count(count + 1) CA w_num.          "if chara cter is number adding to number

nunber = number + 1.
endif.

count = count + 1.
enddo.


write : charat.

write : number.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Prabhudas&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Prabhu Das on Apr 17, 2009 4:58 PM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: Prabhu Das on Apr 17, 2009 4:59 PM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 11:27:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502346#M1258572</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-17T11:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: counting string length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502347#M1258573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the string has only integers and commas you can use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FIND ALL OCCURRENCES OF ',' IN string MATCH COUNT mcnt.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The number of integers is mcnt + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards.&lt;/P&gt;&lt;P&gt;Sandra Marques&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 11:32:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502347#M1258573</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-17T11:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: counting string length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502348#M1258574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;

p_string "input string.

data : w_num(10) type '0123456789'.

data : begin of itab occurs 0,
            num type char10.
         end of itab.

split p_string at ',' into itab.

loop at itab.
if itab-num CA w_num.
count = count + 1.
endif.
endloop.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 11:33:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502348#M1258574</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-17T11:33:54Z</dc:date>
    </item>
    <item>
      <title>Re: counting string length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502349#M1258575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if its only commas and integers then you can do this way.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;replace all occurence of ',' in p_string with space.
condense p_string.
len = strlen( p_string ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit Mohan Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 11:45:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502349#M1258575</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-17T11:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: counting string length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502350#M1258576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi sonu,&lt;/P&gt;&lt;P&gt;chk this code snippet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  znitesh1.
DATA: a TYPE string VALUE '1,2,3,,4,5,6'.
DATA: b TYPE i VALUE 0.
REPLACE ALL OCCURRENCES OF ',' IN a WITH ' '.
b = STRLEN( a ).
WRITE b.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 11:49:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502350#M1258576</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-17T11:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: counting string length</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502351#M1258577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if it is more than , and integers then you can do this way.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;data: wa_num(10) value '0123456789',
count type i,
len type i.
len = strlen( p_string ).
do len times.
if p_string+0(1) ca wa_num.
count = count + 1.
endif.
shift p_string circular.
enddo.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Lalit Mohan Gupta.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Apr 2009 11:53:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/counting-string-length/m-p/5502351#M1258577</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-04-17T11:53:34Z</dc:date>
    </item>
  </channel>
</rss>

