Skip to Content
0
Jun 27, 2008 at 02:59 PM

SPLIT for line break on ##

2426 Views

Hi everybody 😊

I tried to create a message for an internal abap ticket system.

The message is entered by an user on a bsp site. The Function module i have to use only takes the message as a table of char200 lines. So i have to put every 200 chars in another line of the table.

The problem is: I can't recognize the line breaks of the HTML. They are in the String from the site as ##. I tried the following: The split statement does not recognize the ## and does not split properly. can anyone please help? help will be rewarded!

while split_while = 'X'.

    clear lwa_text2.
    lwa_text = lv_html.
    replace all occurrences of lwa_text in lv_html with ''.

    "add new lines on '##'
    split lwa_text at '##' into table lt_split in character mode.
    if lt_split is initial.
      loop at lt_split into lwa_text.
        append lwa_text to lt_text.
      endloop.
    else.
      append lwa_text to lt_text.
    endif.


    if lv_html is initial.
      clear split_while.
    endif.
  endwhile.

THANKS a lot !

Best Regards