‎2010 Jan 21 1:23 PM
Hi Folks,
Need some help !
I have created a table control and its working fine, but now what I want is the number of rows of the table should vary dynamically. Meaning, now if the table is displayed it shows large number of rows even if they are not filled. For example, if the table contains 3 records still it shows remaining empty rows (around 20-25) alongwith these 3 records.
I want is, if I have 3 records in the output internal table then the table control should display only 3 rows, if it contains 5 records then the table control should display only 5 rows. No blank rows should be displayed.
Is there any way to acheive this?
Please help.
‎2010 Jan 21 1:45 PM
Thanks Nitwick and Anil,
I have tried option that you suggested, but still its showing 3 data records (filled rows) followed by number of blank rows.
Does this thing has anything to do with the size of the table control?
‎2010 Jan 21 1:29 PM
Hi,
If you are only displaying contents on the table control, then you could probably set the tablecontrol-lines to the number of records in the table control in the PBO.
describe table it_tab lines lv_lines.
tablecontrol-lines = lv_lines.
‎2010 Jan 21 1:30 PM
Hi,
Use the variable
table_ctrl-LINES = No of lines of your table.
Try this in PAI or PBO
‎2010 Jan 21 1:45 PM
Thanks Nitwick and Anil,
I have tried option that you suggested, but still its showing 3 data records (filled rows) followed by number of blank rows.
Does this thing has anything to do with the size of the table control?
‎2010 Jan 22 2:59 AM
Hi Sudarshan,
In PBO
" This should always be implemented in PBO only
Module status_100. " Implement this in the program as shown below.
loop at itab with control tc.
endloop.
in Program.
module status_100.
* SET PF-STATUS 'XXX'.
* SET TITLE 'XXX'.
describe table itab lines tc-lines. " this makes sure only filled row displayed and others grayed out.
Now if you want to enable one more line for the user to enter follow this.
if tc-lines <> 0.
tc-lines = tc-lines + 1. " One Extra line is enabled every time so that use can enter otherwise omit this
endif.
endmodule.Cheerz
Ram
‎2010 Jan 21 1:50 PM
Thre is prpperty called lines for the table control, you must set it.
describe table itab lines lv_lines.
tb_ctrl-lines = lv_lines.
‎2010 Jan 21 1:54 PM
PBO.
Module fill_lines.
LOOP WITH CONTROL tb_ctrl.
MODULE fill_tb_ctrl.
ENDLOOP.
Module fill_lines.
describe table int_table lines lv_lines.
tb_ctrl-lines = lv_lines.
endmodule.
module fill_tb_ctrl.
READ TABLE int_table into wa INDEX tb_ctrl-CURRENT_LINE.
endmodule.