cancel
Showing results for 
Search instead for 
Did you mean: 

fixing number of table rows in smartforms?

satvik_panchal
Participant
0 Kudos

Hello all abapers,

I have made a packing material defects smartform. My question to all is can we fix the number of table rows? Because the client requirement is that he wants the number of rows to be fixed i.e. around 30 rows irrespective of the data. For example, if the data contains in 4 rows, then the remaining empty 26 rows should also be displayed. Any solution for this?

Thanks in advance,

Satvik

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Fix the size of the main window to display 30 lines. Now based on the data's available in the internal table used to print the main window, fill the internal table with blank lines for remaining number of columns.

Eg : is 4 records are available in the internal table, then append extra 26 blank lines also into the internal table and check.

If this is not working, then try to put a column as sr no in the internal table and then fill the sl no column for the rest 26 lines and append it into the internal table.

Regards,

Harish

satvik_panchal
Participant
0 Kudos

Hi Harish,

Can u explain me how to fix the lines (eg. 30 lines) in the table?

prakashjasti
Contributor
0 Kudos

In table you will have the options

to loop from Row to row in the data tab

Regards,

Prakash

Answers (5)

Answers (5)

satvik_panchal
Participant
0 Kudos

Hello friends,

I have tried one code to solve my problem.

Suppose I want 13 fixed columns. I have managed to get empty columns at the end of table.

describe TABLE itab LINES lin.

*IF lin < 13.

*DO 3 TIMES.

*INSERT INITIAL LINE INTO TABLE itab.

*ENDDO.

*ENDIF.

So this will insert 3 empty lines in the table at the end.

But the data in the table willl be dynamic. So the lines for data will not be fixed. It can be any

number of lines upto 13. So what extra code should I add so that I get fixed 13 lines irrespective of

the data.

Thanks and Regards,

Satvik.

Former Member
0 Kudos

Hi Satvik,

Just create a secondary window with same size as that of main window. Inside that secondary window create a template whose height should be equal to main window height and rows & columns should be 1 (u need to create only 1 cell template)

Now remove all the borders from main window and set the frames & borders for the template of secondary window.

Do as stated and you can resolve the issue.

Do appreciate if found helpful.

BR,

Vinit

Former Member
0 Kudos

Hello Satvik,

You can use template which has fixed number of rows unlike table which is dynamic.

Template will your requirement for displaying empty rows when there is no data.

Hope this helps.

Regards,

Abhijeet Kapgate

Former Member
0 Kudos

what about deleting records over 30 from your itab or, make dummy records for below 30?

I know thats a bit unusual but it may help.

prakashjasti
Contributor
0 Kudos

Count the table lines of data using describe table

and take the empty line with the same line type

below the data line ie at footer odf the table andsubtract the variable from

30 and by looping that many times you can print at footer level