Skip to Content
author's profile photo Former Member
Former Member

Smartform String Issue

I have some fields in the tables which are declared as string types(g) to take unlimited text. When I am calling these fields in smartforms they are not displaying all the text and getting truncated around 255 chars. Do I need to do something different when calling string types.

Thanks

RM

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Dec 17, 2004 at 08:34 AM

    Hi Rehmat,

    instead of long text, I use internal table type TLINE. That's the format of the text read in cluster table.

    Frédéric.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 17, 2004 at 01:22 PM

    I would say that you probably are just going to have to break the string down into an internal table of smaller elements. The following is some code from class CL_APL_ECATT_SCRIPT->SPLIT_STRING_255, that should break this down (even with word wrap).

    *@78QImporting@	VALUE( INSTRING )	TYPE STRING	
    *@78QImporting@	VALUE( LINE_LENGTH )	TYPE INT4  DEFAULT 255	Natural Number
    *@79QExporting@	OUTSTRINGTAB	TYPE ETXML_LINE_TABTYPE	XML Lines
    *@78QImporting@	WORD_WRAP	TYPE ETONOFF  DEFAULT SPACE	eCATT Switch On/Off
    * ...
      data actlen type i value 1.
      data linlen type i value 1.
      data line type etxml_line.
      data onechar.
    
      clear outstringtab.
      if line_length > 255.
        line_length = 255.
      endif.
      if line_length = 0.
        line_length = 1.
      endif.
    
      while actlen > 0.
        actlen = strlen( instring ).
        linlen = line_length.
        if actlen > line_length.
          if word_wrap <> space.
            onechar = instring+linlen(1).
            while onechar is not initial.
              linlen = linlen - 1.
              if linlen <= 1.
                exit.
              endif.
              onechar = instring+linlen(1).
            endwhile.
          endif.
          line = instring(linlen).
          append line to outstringtab.
          shift instring left by linlen places.
        else.
          line = instring.
          append line to outstringtab.
          clear actlen.
        endif.
      endwhile.
    

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.