Skip to Content
0

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

Nov 07, 2017 at 10:44 AM

184

avatar image
Former Member

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)
10 |10000 characters needed characters left characters exceeded

In the smart form, could you show the logic you used to print the text ?

0
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Raymond Giuseppi
Nov 07, 2017 at 11:24 AM
2

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?


hcopy.jpg (42.5 kB)
Show 2 Share
10 |10000 characters needed characters left characters exceeded
Former Member

I may also have the command to print the graphic in the standard text.

and as the text element will not print the graphic, I passed the text to READ_TEXT FM and later based on the FORMAT I passed the values to respective nodes.

if the format is /: then treated it as graphic and splited the string and passed it to the Graphic node.

and for the text, I have just passed the &GW_LINES-TDLINES& to the text element as new paragraph if format is * and asAPPEND DIRECTLY if FORMAT is = or space

0

Depending on tdformat you would have to concatenate some text data with a separating space (when ' ') or not (when '=' for example) so better use some standard FM like CONVERT_ITF_TO_ASCII.

0