cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform - Field not outputting more than 255 characters in a loop

Former Member
0 Kudos

Hi,

I have the following problem with my Smartform:

I am looping from a table and into a structure (Loop function).

1 of those fields is 1000 characters long and will be filled usually at 500 characters inside.

However, when looping and outputting the field (text node) in the format &Tablename-Fieldname&, only up to 255 characters are output.

Why does this happen? How can I fix this? Are any symbols available in Smartforms, like they are in SAPscript?

Any possible solutions will help.

Please help – this is very important and very urgent.

Best Regards,

John

Edited by: Alvaro Tejada Galindo on Mar 17, 2008 4:06 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member194669
Active Contributor
0 Kudos

May try this way


v_length = 255.
&v_ltext(v_length)&&v_ltext+255(v_length)&&v_ltext+510(v_length)&

Former Member
0 Kudos

Hi,

The following worked:

v_length = 255.

&v_ltext(v_length)&&v_ltext255(v_length)&&v_ltext510(v_length)&

It worked, but I had to hardcode the 255 value, since V_length couldn't be used inside the symbol.

Now, the problem that I am having is that I have done this all the way up to "+3570". However, because of this, even with just the 1st one there ( &v_ltext(v_length)& ), there appears a space in between this text node and another one that follows (I can't merge them). How do I get rid of this unnecessary space?

Former Member
0 Kudos

Hi John,

Try using some formatting options like condensing spaces (C), it may help.

&itab-fld(C)& - condenses spaces.

Regards,

Narendra.

Former Member
0 Kudos

Does this condense all space (in between sections, at the beginning) or does it only remove the ending spaces?

raymond_giuseppi
Active Contributor
0 Kudos

That remove the spaces in each field, but there is a space between fields, so you have to split your text at a space, so Smartforms will not generate new spacing.

Regards

Answers (4)

Answers (4)

romanweise
Active Contributor
0 Kudos

Hi,

if you want to output a long string in a smartform putting it as &name& in a text will not help you. For printing such an information you use temp include texts you create an delete on the fly while processing the SF.

To Do so:

- define GV_SUFFIX type char2, GS_HEAD a structure with fields TDOBJECT type TDOBJECT, TDNAME type TDOBNAME, TDID type TDID, TDSPRAS type SPRAS

- define a code step importing the text, the language and the GV_SUFFIX, in the coding , you convert the string to itf and than use function module SAVE_TEXT to save the include text and put the information into GS_HEAD

- define an include text where you put out the newly created include text

- define a code step to delete the temporary text with function module DELETE_TEXT

Best Regards

Roman Weise

Former Member
0 Kudos

not yet answered fully

Former Member
0 Kudos

Hi John,

I had this problem earlier. This is happening because when you send a string to smartform with length >255 characters then it takes only first 255 characters. I overcomed this problem by splitting the string which was of around 500 char into two and then sending it to smartform as individual vairables and displaying the two variables one after the other in the smartform. Hope this helps.

Rgds,

Rahul

raymond_giuseppi
Active Contributor
0 Kudos

I suppose the field is mapped to a char field, maximum length is 255

CHAR: Character string. Fields of type CHAR may have a maximum length of only 255 in tables. If longer character fields are to be used in tables, you must choose data type LCHR. There are no restrictions on the length of such fields in structures.

You should try to split your LCHAR field in one to five fields of char 255 before sending them to print. (Look for function modules like G_SPLIT_LINE)

You may also explicitly define a field of length 1024 and move the LCHAR in it.

Regards