Skip to Content
0
Former Member
May 13, 2010 at 08:34 PM

Change lines of text when pressed 'ENTER' in Text box to SFORM

32 Views

Hi!

I have this piece of code that I am using to concatenate the lines typed in the text box which

I am then printing it onto a Smartform. Everything seems to work fine except when I have some text

that is typed in with 'enter' pressesd to show them on different lines, it still concatentes into one single line and show off as

one continous text. I was wondering if we can show them on three different lines whenever we press 'enter' while entring the text.

Typed text was

"Trainers off: Carlos (v), Gatting B (back)

Points Down: 9875 (KMP)

Notes: Safety classes @ 11:15 am SHARP at Main St."

But when I print it it shows as

""Trainers off: Carlos (v), Gatting B (back) Points Down: 9875 (KMP) Notes: Safety classes @ 11:15 am SHARP at Main St."

LOOP AT TA_TLINE.

      ltp_buffer3 = ta_tline-tdline.
      w_len = 82 - strlen( ltp_buffer2 ).
      w_len1 = strlen( ltp_buffer3 ).

      IF w_len > w_len1 .
        IF ltp_buffer2 is INITIAL.
          ltp_buffer2 = ta_tline-tdline.
        ELSE.
          CONCATENATE LTP_BUFFER2 TA_TLINE-TDLINE INTO LTP_BUFFER2 SEPARATED BY SPACE.
        ENDIF.
      ELSE.
        while ta_tline-tdline+w_len(1) <> space and w_len gt 0.
          SUBTRACT 1 FROM w_len.
        ENDWHILE.
        IF w_len NE 0.
          IF ltp_buffer2 is INITIAL.
            ltp_buffer2 = ta_tline-tdline+0(w_len).
          else.
            CONCATENATE LTP_BUFFER2 TA_TLINE-TDLINE+0(w_len) INTO LTP_BUFFER2 SEPARATED BY SPACE.
          ENDIF.
          ADD 1 TO w_len.
        ENDIF.

        APPEND ltp_buffer2 to ltp_buffer1.
        CLEAR ltp_buffer2.

        ltp_buffer2 = ta_tline-tdline+w_len.
      ENDIF.

    ENDLOOP.
    CONDENSE ltp_buffer2.
    APPEND ltp_buffer2 to ltp_buffer1.