cancel
Showing results for 
Search instead for 
Did you mean: 

Formating problem in smartforms

Former Member
0 Kudos

hi there,

see the attached screen-shot:

in my smartforms i have a header line with fixed text.

then i loop over a table and move the 3 fields of the internal table on the form.

how can i ensure in smartforms that the 3 fields are exactly under the header of the 3 fields.

in the screenshot you can see  that field numer 2 is only filled in 1 case. and in this case the amount starts in the next line.

how to avoid this ? it is not working right with tab-stops

br, Martin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

If your table lines are overflowing please use the formatting options, refer the below link;

http://help.sap.com/saphelp_nw2004s/helpdata/en/d1/803411454211d189710000e8322d00/frameset.htm

Hope this will help you

Thanks & Regards

Answers (4)

Answers (4)

ibulanova
Discoverer
0 Kudos

Hi,

I had this problem. This was because the type of the field NETWR (this was my case) is of 15 characters length, but the width of the column was not enough for this. Although you don’t see leading spaces, they are present and need space.

My solution was to use WRITE TO statement and to print char field instead of original one.

See also this link, please.

http://scn.sap.com/thread/289912

Regards,

Irina

Former Member
0 Kudos

Hi,

by the way this is not my post.. @scott..

@MartinI think you should try what Scott have explained..

Regards

Tejas

Former Member
0 Kudos

Hi,

what is the line type of header and item.. to get value in respective columns, you have to take same line type for header and items.

can you please share line type(in the table) screen shot of your header and items

Regards

Tejas

0 Kudos

Tejas,

I attached 3 images which should give you enough info to get it working.

1) you create the table. Specify the loop of your internal table into a work line (I used a field symbol) on the Data tab of the table definition

2) go to the table tab. when you click details button you can define your line types. You can see in the 2nd image I have 2 line types that both have 5 columns and they are the same widths for all the fields. The first one I use to have a shaded header line and the others for the line items in the loop. The table painter view will show you visually the size of these fields.

3) once you have these defined, you can add either type of line to either the header or main or footer area by right clicking on the header or main and create-->table line. You choose which line type you are creating and it creates the fields based on that line type. These fields are already positioned how you want them from your definition.

4) finally you create texts in your fields by right clicking and create-->text.  And in the text area (general tab) you can either hard code text like a label header, or reference a field in your work area. You can see in the last image, I reference <D>-inco1_mm which will pull the current work line field referenced and it will be automatically aligned with the header because the line types have the same sizes. You actually don't even need 2 line types. I have one so I can do shading of my header fields.

Please marked as solved if this helps.

Scott

0 Kudos

missed the first image...now shown below:

0 Kudos

I had this problem too at one point. Rather than looping on your own through an internal table, create a table in the smartform with a linetype that has the number of fields and the sizes of those fields that you want.

Now you will have a header, main area and footer for that line type and they all line up.

Then for each column you create a text object and place only the appropriate column to display. Do this in the header and the main area. In the header you will hardcode your header text using the same paragraph format as you use in the main area. In the main are you reference the field in the work area that you create in the smartform table. It removes the need to  deal with tabs and your internal table doesn't get "used up" prematurely.

also when creating the smartform table, you loop your internal table into a lineitem that you declare either of the same type or using a field symbol. The reference <fs>-field as your text item to display in the text object.