<?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: string manipulation in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1408949#M197153</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Erik Dierinck ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go through the following procedure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Word wrapping/Split&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the fucntion module SWA_STRING_SPLIT to split a tring into&lt;/P&gt;&lt;P&gt;smaller strings or use function module SWA_STRING_SPLIT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example shows how to split the text in a field of one internal &lt;/P&gt;&lt;P&gt;table and place it into a field in another internal table that has&lt;/P&gt;&lt;P&gt;a shorter size&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT z_hfa_test .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Table containing texts that has to be split&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  BEGIN OF it_longstrings OCCURS 0,&lt;/P&gt;&lt;P&gt;    line TYPE string,&lt;/P&gt;&lt;P&gt;  END OF it_longstrings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Output table from function SWA_STRING_SPLIT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  it_string_components LIKE swastrtab OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Table containg the resukting strings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  BEGIN OF it_shortstrings OCCURS 0,&lt;/P&gt;&lt;P&gt;    line(10) TYPE c,&lt;/P&gt;&lt;P&gt;  END OF it_shortstrings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add some lines to it_longstrings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_longstrings-line = '123456789012345 Hallo this is a very long'.&lt;/P&gt;&lt;P&gt;APPEND it_longstrings.&lt;/P&gt;&lt;P&gt;it_longstrings-line = 'line, that has to be split.'.&lt;/P&gt;&lt;P&gt;APPEND it_longstrings.&lt;/P&gt;&lt;P&gt;  it_longstrings-line = 'The line has to be split into lines of 10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  characters'.&lt;/P&gt;&lt;P&gt;APPEND it_longstrings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Split each line of it_longstrings into lines with length 10&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The resuklting lines are palced in table it_string_components&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT it_longstrings.&lt;/P&gt;&lt;P&gt;  CLEAR it_string_components. REFRESH it_string_components.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'SWA_STRING_SPLIT'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      input_string                       = it_longstrings-line&lt;/P&gt;&lt;P&gt;      max_component_length               = 10&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    TERMINATING_SEPARATORS             =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    OPENING_SEPARATORS                 =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      string_components                  = it_string_components&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    MAX_COMPONENT_LENGTH_INVALID       = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    OTHERS                             = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add the lines to table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT it_string_components.&lt;/P&gt;&lt;P&gt;    it_shortstrings-line = it_string_components-str.&lt;/P&gt;&lt;P&gt;    APPEND it_shortstrings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  LOOP AT  it_shortstrings.&lt;/P&gt;&lt;P&gt;    WRITE: / it_shortstrings-line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Splitting delimited string&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of placing the substring ind l_output, it could be palced in an&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;internal&lt;/P&gt;&lt;P&gt;table using this syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT f AT g INTO TABLE itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each substring will be placed in its own table row. In the example below, the table would have 5 rows.&lt;/P&gt;&lt;P&gt;Note that all output fields must be of type char or string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT YDK8HENFR_TEST1 line-size 80.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_string(132) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of l_output,&lt;/P&gt;&lt;P&gt;       name(40)     type c,&lt;/P&gt;&lt;P&gt;       age(10)      type c,&lt;/P&gt;&lt;P&gt;       address(40)  type c,&lt;/P&gt;&lt;P&gt;       city(40)     type c,&lt;/P&gt;&lt;P&gt;       zipcode(4)   type c,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     end of l_output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_string = 'John;28;My street;My city;3000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  split l_string at ';' into l_output-name&lt;/P&gt;&lt;P&gt;                             l_output-age&lt;/P&gt;&lt;P&gt;                             l_output-address&lt;/P&gt;&lt;P&gt;                             l_output-city&lt;/P&gt;&lt;P&gt;                             l_output-zipcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  write: / l_output-name.&lt;/P&gt;&lt;P&gt;  write: / l_output-age.&lt;/P&gt;&lt;P&gt;  write: / l_output-address.&lt;/P&gt;&lt;P&gt;  write: / l_output-city.&lt;/P&gt;&lt;P&gt;  write: / l_output-zipc.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck and reward me for the same&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ashok.N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 22 Jun 2006 07:55:10 GMT</pubDate>
    <dc:creator>ashok_kumar24</dc:creator>
    <dc:date>2006-06-22T07:55:10Z</dc:date>
    <item>
      <title>string manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1408945#M197149</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;I am an absolute beginner in ABAP, maybe somebody can help me with this :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If a certain string variable has a length bigger than 60 characters, the value should be cut after 57th character and "..." added. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;with regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 07:45:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1408945#M197149</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T07:45:51Z</dc:date>
    </item>
    <item>
      <title>Re: string manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1408946#M197150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Eric ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use SPLIT statement to split a string at a particular location and CONCATENATE statement to concatenate this new string with the required remaining portion.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The syntax is &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT &amp;lt;source_string&amp;gt; at &amp;lt;location&amp;gt; into &amp;lt;new_string&amp;gt;.&lt;/P&gt;&lt;P&gt;CONCATENATE &amp;lt;new_string&amp;gt; &amp;lt;remaining_portion&amp;gt; into &amp;lt;final_string&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or you can find the offset and then concatenate them..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;SP.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 07:49:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1408946#M197150</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T07:49:03Z</dc:date>
    </item>
    <item>
      <title>Re: string manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1408947#M197151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Erik,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA : VAR(60) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now if you want the last 3 characaters&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;VAR2 = VAR+57(3).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now var2 will have 3 characters from the 58th position.&lt;/P&gt;&lt;P&gt;Now you can concatenate&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONCATENATE VAR2 '...' INTO VAR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ravi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note : Please mark the helpful answers and close the thread if the issue is resolved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 07:52:38 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1408947#M197151</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-06-22T07:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: string manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1408948#M197152</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;check this code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;len = strlen( string_variable )&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF len &amp;gt; 57.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; string_variable+57(remaing_lenght) = SPACE.&lt;/P&gt;&lt;P&gt; string_variable+57(4) = '....'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Wasim Ahmed&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 07:54:19 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1408948#M197152</guid>
      <dc:creator>dani_mn</dc:creator>
      <dc:date>2006-06-22T07:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: string manipulation</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1408949#M197153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Erik Dierinck ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Go through the following procedure&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Word wrapping/Split&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="-----------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use the fucntion module SWA_STRING_SPLIT to split a tring into&lt;/P&gt;&lt;P&gt;smaller strings or use function module SWA_STRING_SPLIT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example shows how to split the text in a field of one internal &lt;/P&gt;&lt;P&gt;table and place it into a field in another internal table that has&lt;/P&gt;&lt;P&gt;a shorter size&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT z_hfa_test .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA:&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Table containing texts that has to be split&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  BEGIN OF it_longstrings OCCURS 0,&lt;/P&gt;&lt;P&gt;    line TYPE string,&lt;/P&gt;&lt;P&gt;  END OF it_longstrings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Output table from function SWA_STRING_SPLIT&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  it_string_components LIKE swastrtab OCCURS 0 WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Table containg the resukting strings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  BEGIN OF it_shortstrings OCCURS 0,&lt;/P&gt;&lt;P&gt;    line(10) TYPE c,&lt;/P&gt;&lt;P&gt;  END OF it_shortstrings,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add some lines to it_longstrings&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;it_longstrings-line = '123456789012345 Hallo this is a very long'.&lt;/P&gt;&lt;P&gt;APPEND it_longstrings.&lt;/P&gt;&lt;P&gt;it_longstrings-line = 'line, that has to be split.'.&lt;/P&gt;&lt;P&gt;APPEND it_longstrings.&lt;/P&gt;&lt;P&gt;  it_longstrings-line = 'The line has to be split into lines of 10&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  characters'.&lt;/P&gt;&lt;P&gt;APPEND it_longstrings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Split each line of it_longstrings into lines with length 10&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;The resuklting lines are palced in table it_string_components&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;LOOP AT it_longstrings.&lt;/P&gt;&lt;P&gt;  CLEAR it_string_components. REFRESH it_string_components.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CALL FUNCTION 'SWA_STRING_SPLIT'&lt;/P&gt;&lt;P&gt;    EXPORTING&lt;/P&gt;&lt;P&gt;      input_string                       = it_longstrings-line&lt;/P&gt;&lt;P&gt;      max_component_length               = 10&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    TERMINATING_SEPARATORS             =&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    OPENING_SEPARATORS                 =&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    TABLES&lt;/P&gt;&lt;P&gt;      string_components                  = it_string_components&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  EXCEPTIONS&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    MAX_COMPONENT_LENGTH_INVALID       = 1&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;    OTHERS                             = 2&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;            .&lt;/P&gt;&lt;P&gt;  IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Add the lines to table&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;  LOOP AT it_string_components.&lt;/P&gt;&lt;P&gt;    it_shortstrings-line = it_string_components-str.&lt;/P&gt;&lt;P&gt;    APPEND it_shortstrings.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;END-OF-SELECTION.&lt;/P&gt;&lt;P&gt;  LOOP AT  it_shortstrings.&lt;/P&gt;&lt;P&gt;    WRITE: / it_shortstrings-line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Splitting delimited string&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="----------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Instead of placing the substring ind l_output, it could be palced in an&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;internal&lt;/P&gt;&lt;P&gt;table using this syntax:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SPLIT f AT g INTO TABLE itab. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Each substring will be placed in its own table row. In the example below, the table would have 5 rows.&lt;/P&gt;&lt;P&gt;Note that all output fields must be of type char or string&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPORT YDK8HENFR_TEST1 line-size 80.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: l_string(132) type c.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data: begin of l_output,&lt;/P&gt;&lt;P&gt;       name(40)     type c,&lt;/P&gt;&lt;P&gt;       age(10)      type c,&lt;/P&gt;&lt;P&gt;       address(40)  type c,&lt;/P&gt;&lt;P&gt;       city(40)     type c,&lt;/P&gt;&lt;P&gt;       zipcode(4)   type c,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     end of l_output.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;start-of-selection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  l_string = 'John;28;My street;My city;3000'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  split l_string at ';' into l_output-name&lt;/P&gt;&lt;P&gt;                             l_output-age&lt;/P&gt;&lt;P&gt;                             l_output-address&lt;/P&gt;&lt;P&gt;                             l_output-city&lt;/P&gt;&lt;P&gt;                             l_output-zipcode.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  write: / l_output-name.&lt;/P&gt;&lt;P&gt;  write: / l_output-age.&lt;/P&gt;&lt;P&gt;  write: / l_output-address.&lt;/P&gt;&lt;P&gt;  write: / l_output-city.&lt;/P&gt;&lt;P&gt;  write: / l_output-zipc.&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---------------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good Luck and reward me for the same&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Ashok.N&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Jun 2006 07:55:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/string-manipulation/m-p/1408949#M197153</guid>
      <dc:creator>ashok_kumar24</dc:creator>
      <dc:date>2006-06-22T07:55:10Z</dc:date>
    </item>
  </channel>
</rss>

