on 12-17-2004 1:13 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.