Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic table in smartforms depending on the number of selected elements on selection screen

Former Member
0 Kudos
957

Hey all,

I have a selection screen where I choose the number of table cells. According to this number of table cells I want to make a table in smartforms with 2 colums and the number of rows depends on the selected number of cells. If the number of table cells is odd the last row should contain only one column, but all rows should have the same width.

For example if we would choose the number of cells 4 then we need to draw a table like this:

In case of number of cells 5 we would need to draw a table like this:


How could I achieve this? Please help me I am a beginner with smartforms.

Regards,
Robert

1 ACCEPTED SOLUTION

0 Kudos
217

Hello Robert Birkus,

Let us say Selection screen as N


Take All ur records want to Print into 2 Column table

In case of Odd N except last record

In Smartform

Print in case of N odd last record into Footer

Eg: 4 I/p

Here Flag will Be Initial


Append

1st row  1st Clums 1, 2nd Coumn 2

2nd Row 1st Clums 3, 2nd Coumn 4

If 5 I/p as Odd Number

Flag = X

Where u will print last record in to footer

1st row  1st Clums 1, 2nd Coumn 2

2nd Row 1st Clums 3, 2nd Coumn 4


Table Footer With 5th Record which will taken into some other variable

3 REPLIES 3

Former Member
0 Kudos
217

Hi Robert,

Tables in smartforms are dynamic,meanes it will increase number of rows dynamically based on values which are assigned to that table.

For your requirement declare one internal table for selection screen field and assign all selection screen values to that internal table and pass that internal table to the table in the smartform in the Loop.then table will increase rows automatically based on values in the internal table.

Try this and revert.

Regards

Mani

0 Kudos
218

Hello Robert Birkus,

Let us say Selection screen as N


Take All ur records want to Print into 2 Column table

In case of Odd N except last record

In Smartform

Print in case of N odd last record into Footer

Eg: 4 I/p

Here Flag will Be Initial


Append

1st row  1st Clums 1, 2nd Coumn 2

2nd Row 1st Clums 3, 2nd Coumn 4

If 5 I/p as Odd Number

Flag = X

Where u will print last record in to footer

1st row  1st Clums 1, 2nd Coumn 2

2nd Row 1st Clums 3, 2nd Coumn 4


Table Footer With 5th Record which will taken into some other variable

Private_Member_7726
Active Contributor
0 Kudos
217

Hi,

Convert and pass to smartform the data in a table with two columns per row. Define a Table node in Smartform with two row types: for two cells and for one cell. After that it's just about setting the conditions for choosing the right row type to output: all the rows before the last should be output using row type for two cells, but the last record - for one cell.

cheers

Jānis