Application Development and Automation 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: 
Read only

table control dynamic rows

Former Member
0 Likes
677

Hello Friends,

in my dialog prog i have one change button which will fetch the data from database table and will put it in table control in screen.

In the table control i want the provisison of adding more data but except first row all the other rows are in grey mode kindly guide me how to make the rows editable so the user can add more rows of data.

Regards,

Sunny

4 REPLIES 4
Read only

Former Member
0 Likes
621

Hi Sunny ,

Incase u have made the table control with wizard then do the following :

when you go through the coding of table control which wizard has done u will find one OK_CODE

i.e. 'INSR;,specify the button with fcode 'INSR' & debug it I am sure u will get the solution to add one more line and in this way u can ask user to add number of lines as per the reuirement .

Thnks

Sahil

Read only

Former Member
0 Likes
621

In the PBO module, inside the table control loop.. endloop write a module and in that module, write the below piece of code


DESCRIBE TABLE <internal_table_name> LINES tablecontrolname-lines.
tablecontrolname-lines = tablecontrolname-lines + 1. " here, 1 blank line will be added after the display of all the records.

Read only

I355602
Product and Topic Expert
Product and Topic Expert
0 Likes
621

Hi Sunny,

If you are fetching the data from internal table say itab into the table control and you want that the number of blank lines should be created after the last record, then you can use this code:-


DATA : line_count TYPE i. "variable to store the number of records in internal table

In the PBO of the screen in which the data is being displayed in the table control, use code:-


DESCRIBE TABLE itab "itab is the internal table
LINES line_count. "number of records populated into the internal table

tab_ctrl-lines = line-count + 10. "will insert 10 blank line after the internal table records
"tab_ctrl is the name of the table control on the screen

Hope this solves your problem.

Thanks & Regards

Tarun Gambhir

Read only

Former Member
0 Likes
621

THNKS