<?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: spaces in string in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319698#M509080</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;You can use the function module SWA_STRINGLENGTH_GET to find the number of spaces in the string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for this you can call this function module twice.&lt;/P&gt;&lt;P&gt;first when you are not going to set the parameter CONDENSE_NO_GAPS.&lt;/P&gt;&lt;P&gt;and get the length of the string with spaces.&lt;/P&gt;&lt;P&gt;after that call the function module againg and set CONDENSE_NO_GAPS = X.&lt;/P&gt;&lt;P&gt;now the length of the string will be without spaces.&lt;/P&gt;&lt;P&gt;you can substract the two to get the number of spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 25 May 2007 08:09:58 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-05-25T08:09:58Z</dc:date>
    <item>
      <title>spaces in string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319695#M509077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have a string .&lt;/P&gt;&lt;P&gt;'My name is Roshan Lilaram Wadhwani'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to find the number of spaces used in this string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rather i need to segregate the string in two parts after a particular number of spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Roshan Lilaram.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2007 07:54:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319695#M509077</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-25T07:54:09Z</dc:date>
    </item>
    <item>
      <title>Re: spaces in string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319696#M509078</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;try the folowing codes:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data :&lt;/P&gt;&lt;P&gt;varxx type string value 'Test',&lt;/P&gt;&lt;P&gt;len type i.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;len = strlen( varxx ).&lt;/P&gt;&lt;P&gt;write: varxx, '  Lenght:', len.&lt;/P&gt;&lt;P&gt;len2 = len/2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;segregate the string in two parts like this:&lt;/P&gt;&lt;P&gt;move  varxx(len2 ) to temp1.&lt;/P&gt;&lt;P&gt;move  varxx+len2  to temp2.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2007 08:01:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319696#M509078</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-05-25T08:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: spaces in string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319697#M509079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please reward if this solves your problem,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sooness.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2007 08:02:17 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319697#M509079</guid>
      <dc:creator>dev_parbutteea</dc:creator>
      <dc:date>2007-05-25T08:02:17Z</dc:date>
    </item>
    <item>
      <title>Re: spaces in string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319698#M509080</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;You can use the function module SWA_STRINGLENGTH_GET to find the number of spaces in the string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;for this you can call this function module twice.&lt;/P&gt;&lt;P&gt;first when you are not going to set the parameter CONDENSE_NO_GAPS.&lt;/P&gt;&lt;P&gt;and get the length of the string with spaces.&lt;/P&gt;&lt;P&gt;after that call the function module againg and set CONDENSE_NO_GAPS = X.&lt;/P&gt;&lt;P&gt;now the length of the string will be without spaces.&lt;/P&gt;&lt;P&gt;you can substract the two to get the number of spaces.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Reward if helpful.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Mohit&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2007 08:09:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319698#M509080</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-25T08:09:58Z</dc:date>
    </item>
    <item>
      <title>Re: spaces in string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319699#M509081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;TRY THIS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
DATA : TEXT(50)  VALUE 'My name is Roshan Lilaram Wadhwani',
       LEN TYPE I,
       POS TYPE I,
       COUNTER TYPE I,
       V_CH,
       V_SPACE VALUE ' ',
       V_TXT(30),
       V_TXT2(20).

COMPUTE LEN = STRLEN( TEXT ).

DO LEN TIMES.
 V_CH = TEXT+POS(1).
 IF V_CH EQ SPACE.
  COUNTER = COUNTER + 1.
 ENDIF.

 IF COUNTER LT 3.
  CONCATENATE V_TXT V_CH INTO V_TXT.
 ELSE.
  CONCATENATE V_TXT2 V_CH INTO V_TXT2.
 ENDIF.
 POS = POS + 1.
ENDDO.

WRITE : / V_TXT.
WRITE : / V_TXT2.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REGARDS&lt;/P&gt;&lt;P&gt;SHIBA DUTTA&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 May 2007 08:12:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319699#M509081</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-25T08:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: spaces in string</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319700#M509082</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;i have used split command.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you all very much.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 May 2007 07:36:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/spaces-in-string/m-p/2319700#M509082</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-05-28T07:36:58Z</dc:date>
    </item>
  </channel>
</rss>

