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

Question on Table control

Former Member
0 Likes
1,688


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

1 ACCEPTED SOLUTION
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
1,662

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.

9 REPLIES 9
Read only

VijayaKrishnaG
Active Contributor
0 Likes
1,662

Hi Priya,

When you are entering value on 11th row, make sure that row item has increased like table-field(11).

Regards,

Vijay

Read only

Former Member
0 Likes
1,662

Hi Priya ,

make it simple , just place this code in pbo

  tc1-lines = 10000.


hope it solve ur problem


with regards,

vikas

Read only

0 Likes
1,662

Hi Vikas,

Thanks for the reply. Same I have tried. Rows are coming,but previus entry is clearing.

Regards,

Priya

Read only

0 Likes
1,662

can you paste your code of both parts pai and pbo..

it will be better to understand

with regards,

vikas

Read only

Arun_Prabhu_K
Active Contributor
0 Likes
1,663

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.

Read only

0 Likes
1,662

Hi Arun,

Thanks for the reply.

could you please elaborate me more.

Regards,

Priya

Read only

0 Likes
1,662

Priya,

     Which portion you want me to elaborate?

Read only

0 Likes
1,662

Hi Arun,

I dint get the append portion.

Read only

0 Likes
1,662

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,