07-07-2014 11:45 AM
Hi Experts,
I have created a table control having 10 lines in it using screen painter.
the purpose of this table control is to get data from user and store that data in Database Table.
For Eg., if the user wants to add 15 rows into it..then how can the no of rows in table control increased? ANy option available?
Regars,
Greeshma
07-07-2014 11:49 AM
Hi,
Their is a property in table control LINES
U can use (TBL_CNTRL is name of table control)
TBL_CNTRL-LINES = TBL_CNTRL-LINES + 15 (NO OF LINES TO BE ADDED)
Use this in PBO Module
Update current value of LINES by using any variable like
Describe table <itab> lines TBL_CNTRL-LINES or TBL_CNTRL-LINES = TBL_CNTRL-LINES + <any variable>
and Refresh table display using REFRESH CONTROL <name> using <screen no>
Regards:
Somendra
07-07-2014 11:57 AM
Hi Greeshma,
As per my understanding u want to increase the size of table control..so for that
you have do it in PBO part of module programming
in PBO
Module Set_status.
tc-lines = 15.
(here tc is name of table control)
hope it helps.
regards,
vikas
07-07-2014 12:43 PM
Dear Greeshma,
You can do it so easy!
Just Buld an empty Work Area,
Append it 15 times to your internal table that is for your table control
Then you will have a Table conterol with 15 empty lines!
Regards
Farzin
07-07-2014 1:06 PM
Thank you for the replies.
Actually, the no of rows which can be dynamic. It can be 20 or either any no. Is there any option to dynamically add the no of rows?
07-07-2014 1:15 PM
Hi Greeshma,
yes dynamic its also possible,
for that you have to describe the internal table first and based on that you have to assign.
eg.
in PBO part
describe table itab lines line.
tc-lines = Line.
hope it helps.
regards,
vikas
07-07-2014 1:19 PM
Hi Greeshma,
You can use page down option given by SAP. You can check the table control with wizard there the code will be generated automatically.
Thanks,
Govind
07-07-2014 1:52 PM
Hi,
as per Govind suggestion you can use Table control for Wizard.. it will generate coding for insert,remove,select all,deselect all, Scrolling etc..
Regards,
Thangam.P
07-14-2014 3:19 PM
Hi I am not using table wizard. currently the table is scrollable but when I am entering value for 11th row then it is clearing the first record and accordingly.. I am not able to solve this issue.
Thank for ur replies. Please suggest me how can I overcome this?
07-14-2014 3:26 PM
because your always changing row 1 at the moment even if you think its 11 - you need to update the current row in your table control processing
pbo
loop at g_tc_bu_names_itab
into g_tc_bu_names_wa
with control tc_bu_names
cursor tc_bu_names-current_line.
g_tc_bu_names_lines = sy-loopc.
endloop.
pai
loop at g_tc_bu_names_itab.
" do some pai processing etc then do your modify when ready...
modify g_tc_bu_names_itab
from g_tc_bu_names_wa
index tc_bu_names-current_line.
endloop.