<?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: Replacing multiple new line characters in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058420#M1353627</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks I am able to solve the problem of multi line replacement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Sep 2009 10:22:15 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-15T10:22:15Z</dc:date>
    <item>
      <title>Replacing multiple new line characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058414#M1353621</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;how to replace multiple new line characters in a line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Suppose for example my line contains Example1#####Example2##Example3###Example4, &lt;/P&gt;&lt;P&gt;then the output should be Example1#Example2#Example3#Example4.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 10:16:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058414#M1353621</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T10:16:16Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing multiple new line characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058415#M1353622</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sid,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You Can try this code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA: ld_string TYPE string,&lt;/P&gt;&lt;P&gt;      ld_string1 TYPE string,&lt;/P&gt;&lt;P&gt;      ld_string2 TYPE string,&lt;/P&gt;&lt;P&gt;      ld_string3 TYPE string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ld_string = 'Example1#####Example2##Example3###Example4'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURRENCES OF '######' in ld_string with '#'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURRENCES OF '####' in ld_string with '#'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURRENCES OF '###' in ld_string with '#'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;REPLACE ALL OCCURRENCES OF '##' in ld_string with '#'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;write:/1 ld_string.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Pavan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 11:21:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058415#M1353622</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T11:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing multiple new line characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058416#M1353623</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE&gt;&lt;CODE&gt;
REPLACE ALL OCCURRENCES OF cl_abap_char_utilites=&amp;gt;new_line in ld_string with ``.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 11:42:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058416#M1353623</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-09-14T11:42:28Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing multiple new line characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058417#M1353624</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sidhartha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please make use the below code to solve your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;**************************************************************&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;DATA:   v_line(50) type c value'Example1#####Example2##Example3###Example4',&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;begin of itab occurs 0,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;          &lt;STRONG&gt;data(25) type c,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;        &lt;STRONG&gt;end of itab.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;split v_line at '#' into table itab.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;clear v_line.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;loop at itab where data is not initial.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;  &lt;STRONG&gt;concatenate v_line itab-data into v_line separated by '#'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endloop.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if v_line+0(1) = '#'.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;   &lt;STRONG&gt;v_line+0(1) = ''.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;endif.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;condense v_line no-gaps.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;write : / v_line.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;**********************************************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this will help you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Smart Varghese&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 11:43:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058417#M1353624</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T11:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing multiple new line characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058418#M1353625</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry my first attempt was nonsens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
  concatenate CL_ABAP_CHAR_UTILITIES=&amp;gt;newline '+' into pattern.
  replace all OCCURRENCES OF regex pattern in s with CL_ABAP_CHAR_UTILITIES=&amp;gt;newline.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 11:48:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058418#M1353625</guid>
      <dc:creator>rainer_hbenthal</dc:creator>
      <dc:date>2009-09-14T11:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing multiple new line characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058419#M1353626</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sidhartha,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try this piece of code -&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT sy-repid.

TYPES: BEGIN OF ty_split,
        str_lines(255),
       END OF ty_split.

DATA: str TYPE string,
      itab_split TYPE TABLE OF ty_split,
      wa_split TYPE ty_split.

* str contains your input string which has new line characters. you may put the value in that variable as per your logic.

SPLIT str AT cl_abap_char_utilities=&amp;gt;cr_lf INTO TABLE itab_split.

CLEAR str.
LOOP AT itab_split INTO wa_split.
  IF sy-tabix EQ 1.
    str = wa_split-str_lines.
  ELSE.
    CONCATENATE str cl_abap_char_utilities=&amp;gt;newline wa_split-str_lines  INTO str.
  ENDIF.
ENDLOOP.

WRITE str.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Himanshu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Sep 2009 11:49:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058419#M1353626</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-14T11:49:39Z</dc:date>
    </item>
    <item>
      <title>Re: Replacing multiple new line characters</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058420#M1353627</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks I am able to solve the problem of multi line replacement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Sep 2009 10:22:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/replacing-multiple-new-line-characters/m-p/6058420#M1353627</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-15T10:22:15Z</dc:date>
    </item>
  </channel>
</rss>

