cancel
Showing results for 
Search instead for 
Did you mean: 

Collumn alignment problem in Smartforms

Former Member
0 Kudos

Hi all,

I have created a Smatforms to print the content of a table that have only 1 field of 150 characters long.

To populate this field I do a CONCATENATE RESPECTING BLANKS in the calling ABAP program. I concatenate various fields together and I add some blanks between each other.

Generally it works fine and the columns are aligned correctly where they should be but it some cases if a field value is blank then the columns are not aligned no more. In my internal table the data is aligned correctly but when the Smartforms is printed the reserved blanks are not respected in some cases.

Does someone have any idea what is the cause of this malfunction?

Can it be linked to the font size? I am using COURRIER 7,5pt in all of the Smartstyle.

Thank you very much for your help.

BR,

Sylvain

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Sylvain,

From what I understood I can say that since there field value which is empty of the 150 char long output it shifting towards left and hence non alignment and nothing to do with font size & smart style.

I may be wrong for above statement.

So, What I suggest is instead of having single field have multiple fields so that if any empty value also the alignment will be correct.

Hope this helps.

BR

Dep

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Guys,

Thank you for your answers. Issue closed.

Best regards,

Sylvain

Former Member
0 Kudos

Hi,

Since you are concatenating multiple fields to a single one,when one of the field is empty it is affecting the alignment?

Try with CONDENSE statement in your driver program,if any one of the field is blank.

Jshree

Former Member
0 Kudos

Hi,

Thank you all for your answers. After trying different options, like using string fields instead of characters and MOVE field1(length) to result_field+position(length) instead of CONCATENATE, I still have some alignment problems is my Smartforms.

I cannot use CONDENSE because I want to keep the blanks between each fields. Do you know if a blank take less or more printing space that a character or a number in Smartforms?

Here are my coding lines which are rather simple:

LOOP AT i_det_layatt INTO wa_det_layatt.

IF wa_det_layatt-col_head_len IS NOT INITIAL.

MOVE wa_det_layatt-col_head_1 TO wa_print_dta-ylinedta+w_pos(wa_det_layatt-col_head_len).

ADD wa_det_layatt-col_head_len TO w_pos.

ADD wa_det_layatt-col_head_space TO w_pos.

ENDIF.

ENDLOOP.

IF sy-subrc = 0.

APPEND wa_print_dta TO i_print_dta_h.

ENDIF.

The result field "wa_print_dta-ylinedta" has a length of 255 characters but I only print the first 150 in the Smartforms. There are 3 other fields contained in my internal table structure but they are not printed in the Smartforms.

In debug mode the result field is populated correctly for each table occurrence which means that each data is displayed at the correct starting position. When one value of wa_det_layatt-col_head_1 is blank on the second table occurrence, the printed data are shifted either of couple of spaces left or a couple of spaces right.

At this time, I'm only checking the form result in print preview since I do not have access to a printer.

I hope that these details will be helpful for providing more answers or suggestions.

Thank you,

Sylvain

Former Member
0 Kudos

Hi,

Try using the font size 7 pt.

Former Member
0 Kudos

If your table has only one field of 150 characters, there should not be a problem with your smartform.

Please clarify your requirements. Please be specific.

As per your description, I guess there should be issue while filling up the table fields itself.

Check the table contents before the smartform is called.

If there is any blank field during concatenate it would be considered as single space.

You might need to handle this problem with string operations (offsets).

Please give examples so that I can help you with your issue.