Split string to lines for displaying

DATA: lv_content TYPE string,
      lv_pos     TYPE i,
      lv_len     TYPE i.
lv_content = 'dummy string'.
lv_pos = 1.
WHILE lv_pos LE strlen( lv_content ).
  lv_len = 80.
  IF lv_pos + lv_len GT strlen( lv_content ).
    lv_len = strlen( lv_content ) - lv_pos.
  ENDIF.
  WRITE lv_content+lv_pos(lv_len).
  lv_pos = lv_pos + 80.
ENDWHILE.



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.