Skip to Content

Correct text line in SapScript

Hi All!

Sorry, my English is very poor...

I have a variable with a text line. I´m going to show this text in the SapScript, but the text is very long...

How can I write de variable in 2 lines, without cut any word?

Thanks!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

7 Answers

  • Best Answer
    Apr 19, 2006 at 02:28 PM

    Hello,

    DO like

    &T001-BUTXT+0(15)& IN FIRST LINE

    &T001-BUTXT+15(10)& IN SECOND LINE.

    You can use FM : RKD_WORD_WRAP

    Regards,

    Naimesh

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 19, 2006 at 02:33 PM

    Hi,

    try with FM <b>RKD_WORD_WRAP</b>.

    Regards

    vijay

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 19, 2006 at 02:25 PM

    Hi,

    Do not bother about your Language buddy...

    If it is a standard text(Constant all the time). then define it as a std text in so10 transaction.

    Because you are defining it , you make sure you enter the text in two lines without any break in words.

    REgards,

    Ravi

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 19, 2006 at 02:26 PM

    Please check out function module FORMAT_TEXTLINES.

    Please remember to award points for helpful answers and mark your post as solved when solved completely. THanks.

    Regards,

    Rich Heilman

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 19, 2006 at 02:30 PM

    Hi all again! Thanks for your quickly request!

    CALL FUNCTION 'FORMAT_TEXTLINES'

    • EXPORTING

    • CURSOR_COLUMN = 0

    • CURSOR_LINE = 0

    • ENDLINE = 99999

    • FORMATWIDTH = 72

    • LINEWIDTH = 132

    • STARTLINE = 1

    • LANGUAGE = SY-LANGU

    • IMPORTING

    • NEW_CURSOR_COLUMN =

    • NEW_CURSOR_LINE =

    TABLES

    lines =

    • EXCEPTIONS

    • BOUND_ERROR = 1

    • OTHERS = 2

    .

    Where I have to put the variable in this function?? How is the result?

    Add comment
    10|10000 characters needed characters exceeded

    • Please see the following example program.

      
      
      report zrich_0001 .
      
      data: lines type table of   tline with header line.
      
      
      lines-tdline
         = 'This is the first line of the text and we need to format it'.
      append lines.
      
      lines-tdline
         = 'This is the second line of the text and we need to format it'.
      append lines.
      
      loop at lines.
        write:/ lines-tdline.
      endloop.
      
      
      call function 'FORMAT_TEXTLINES'
       EXPORTING
      *   CURSOR_COLUMN           = 0
      *   CURSOR_LINE             = 0
      *   ENDLINE                 = 99999
          formatwidth             = 30
      *   LINEWIDTH               = 132
      *   STARTLINE               = 1
      *   LANGUAGE                = SY-LANGU
      * IMPORTING
      *   NEW_CURSOR_COLUMN       =
      *   NEW_CURSOR_LINE         =
        tables
          lines                   = lines.
      * EXCEPTIONS
      *   BOUND_ERROR             = 1
      *   OTHERS                  = 2
      .
      if sy-subrc <> 0.
      * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
      *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      endif.
      
      skip 5.
      
      loop at lines.
        write:/ lines-tdline.
      endloop.
      
      

      Regards,

      Rich Heilman

  • Apr 19, 2006 at 02:48 PM

    Thanks!! I use FM: RKD_WORD_WRAP!!!

    😉

    Add comment
    10|10000 characters needed characters exceeded

  • Apr 19, 2006 at 02:48 PM

    Why are you concerned by this? Just ensure your output windown in SAP Script is at least 2 lines in height and SAP Script will handle the wrapping for you without cutting words.

    Add comment
    10|10000 characters needed characters exceeded