Skip to Content
avatar image
Former Member

READ_TEXT FM is removing the spaces in the text lines in sap smartforms

Using the read_text FM i'm getting the long text to print in the form..

TYPES: BEGIN OF ty_tline,
        TDFORMAT  Type  TDFORMAT,
        TDLINE  Type  TDLINE,
       END OF ty_tline.
DATA GT_LINES TYPE STANDARD TABLE OF TY_TLINE .

CALL FUNCTION 'READ_TEXT'
        EXPORTING
*         CLIENT                        = SY-MANDT
          id                            = GW_FINAL1-TDID
          language                      = sy-langu
          name                          = GW_FINAL1-TDNAME
          object                        = GW_FINAL1-TDOBJECT
*         ARCHIVE_HANDLE                = 0
*         LOCAL_CAT                     = ' '
*       IMPORTING
*         HEADER                        =
        TABLES
          lines                         = gt_lines
       EXCEPTIONS
         id                            = 1
         language                      = 2
         name                          = 3
         not_found                     = 4
         object                        = 5
         reference_check               = 6
         wrong_access_to_archive       = 7
         OTHERS                        = 8
                .

the FM is removing the spaces in the lines.

the text which I maintained is

in debugging it is displaying as

and in the form no space is coming between the words

Here I have used 2 text elements to print the text in the form.

1. as new paragraph to print the line with TD format as *

2. using append directly to attach this new line to previous line if TD format is = or space.

How to get the space into the text?

takmt.png (28.4 kB)
5imy4.png (20.7 kB)
zjjdi.png (19.4 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Nov 07, 2017 at 11:24 AM

    So,

    • The FM doesn't remove any blank character, actually it added blanks at end of each line... I suppose your form did it, some wrong concatenate?
    • Why did you use READ_TEXT and didn't use an 'Include Text' for your text node?

    Add comment
    10|10000 characters needed characters exceeded