cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform String Issue

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

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.

FredericGirod
Active Contributor
0 Kudos

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.