2009 Jan 07 8:46 AM
Hi,
I have a proble in table control where my table control have 3 lines and when i enter three records i can see the records in table control scrren and when i want to add a 4 th line i need to press a BUTTON.when i press the button a new line inserted but i need to scroll to see the fourth record,but my req ments is to see the 4th record in the 3 rd line of the table control and 3 rd will be seen in the 2 nd line of the table control. Is there any good soultions to achieve this.
Thanks,
Deesanth
2009 Jan 07 8:56 AM
Hi Deesanth,
In the PBO of the screen just add code:-
tab_ctrl-lines = tab_ctrl-lines + 10. "tab_ctrl is name of table control
This will insert 10 extra line in the table control.
You can see these empty line when you scroll the vertical scroll bar of the table control.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
2009 Jan 07 8:56 AM
Hi Deesanth,
In the PBO of the screen just add code:-
tab_ctrl-lines = tab_ctrl-lines + 10. "tab_ctrl is name of table control
This will insert 10 extra line in the table control.
You can see these empty line when you scroll the vertical scroll bar of the table control.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir
2009 Jan 07 9:04 AM
Hi Gambir,
This not my my req ment,when i pree the ADD button i can able to insert a line which i can edit values,but to see the new added line i need to scrroll,but i dont want to scroll instead the new added line shoub be displayed in the last line of the table control screen.
Deesanth
2009 Jan 07 9:07 AM
Hi Deesanth,
If you want that the last line of the table control should always be empty and can be seen by the user all the time, then thats not possible.
You need to scroll down the table control to view the other line in it.
Thanks & Regards,
Tarun Gambhir
2009 Jan 07 9:17 AM
Hi,
try like this...
data : v_index type sy-tabix.
when 'ADD'.
describe table itab lines v_index.
v_index = v_index + 1.
insert initial line into itab index v_index.
2009 Jan 07 11:01 AM
2009 Jan 09 3:57 PM
after you add a line, in the PBO- put this code:
describe table lt_disp lines lv_lines.
table_control-lines = lv_lines.
if lv_lines GT 3.
table_control-top_line = lv_lines-3.
endif.
In this case, the last record would always be the third record in the Table cntrol.
Nikhil