2014 Jul 14 11:02 AM
Hi Experts,
I am facing one issue with the table control. I am not able to find an exact solution.
I wanted to extend the no lines in he table control as currently it is showing only 10 lines, I have wrote code in the PBO event as
DESCRIBE TABLE gt_serial_selected LINES lv_count.
tc1-lines = lv_count + 10.
The problem is the lines are getting extended and it became scrollable also,
but whenever I am trying to enter an 11th value the previous entry is getting cleared.I am not able to enter 11th value.
If anyone knows the exact solution for this please help me.
Thanks.
Regards,
Priya
2014 Jul 14 11:13 AM
Hello Priya Reddy.
Table control is just a reflection of your internal table data.
Before the table control screen is called, if your itab has 10 records, 10 lines will be editable, if it has 20 records, 20 lines will be editable.
Now you have increased the number of editable lines to additional 10.
Now you want data in the additional lines to be saved in itab and subsequently retained in table control.
To address this, you have to write the business logic in MODULE TC_SCREEN MODIFY ON CHAIN-REQUEST.
If you look at the auto-generated code inside the module, it will have logic to update table control data to itab.
Since the records that you are entering in the additional lines won't be in itab, you have to append it.
Inside the module add,
MODIFY itab INDEX TC_SCREEN-CURRENT_LINE.
if sy-subrc <> 0.
APPEND itab.
endif.
Regards.
2014 Jul 14 11:07 AM
Hi Priya,
When you are entering value on 11th row, make sure that row item has increased like table-field(11).
Regards,
Vijay
2014 Jul 14 11:11 AM
Hi Priya ,
make it simple , just place this code in pbo
tc1-lines = 10000.
hope it solve ur problem
with regards,
vikas
2014 Jul 14 11:15 AM
Hi Vikas,
Thanks for the reply. Same I have tried. Rows are coming,but previus entry is clearing.
Regards,
Priya
2014 Jul 14 11:32 AM
can you paste your code of both parts pai and pbo..
it will be better to understand
with regards,
vikas
2014 Jul 14 11:13 AM
Hello Priya Reddy.
Table control is just a reflection of your internal table data.
Before the table control screen is called, if your itab has 10 records, 10 lines will be editable, if it has 20 records, 20 lines will be editable.
Now you have increased the number of editable lines to additional 10.
Now you want data in the additional lines to be saved in itab and subsequently retained in table control.
To address this, you have to write the business logic in MODULE TC_SCREEN MODIFY ON CHAIN-REQUEST.
If you look at the auto-generated code inside the module, it will have logic to update table control data to itab.
Since the records that you are entering in the additional lines won't be in itab, you have to append it.
Inside the module add,
MODIFY itab INDEX TC_SCREEN-CURRENT_LINE.
if sy-subrc <> 0.
APPEND itab.
endif.
Regards.
2014 Jul 14 11:26 AM
Hi Arun,
Thanks for the reply.
could you please elaborate me more.
Regards,
Priya
2014 Jul 14 11:33 AM
2014 Jul 14 11:36 AM
2014 Jul 14 11:43 AM
Priya,
If you look inside the module TC_MODIFY INPUT, it will have auto-generated code like MODIFY itab TC-CURRENT_LINE.
This will update those lines of itab which are shown in table control.
If you are adding new line in table control, it won't be in itab.
The above modify statement will fail, so there you have to append it in itab.
For instance,