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

table control in module pool.

0 Likes
877

Hi all,

i have made table control in which i am filling the data at run time,my issue is i can insert multiple rows but when i press ENTER or i scroll or any thing like any event , the table control deletes the rows , except the first rows remain the same,

how to solve this issue.?

5 REPLIES 5
Read only

sivaganesh_krishnan
Contributor
0 Likes
849

hi alpesh,

in PAI,PBO , make sure you do not delete the internal table entries. Debugging will solve the issue

Module Pool basics - ABAP Development - SCN Wiki

Regards,

Sivaganesh

Read only

Former Member
0 Likes
849

Hey Alpesh..

first go to debugger and find why its deleting...

i faced da same problem..i done with following code

check it..once..

it will work..

PAI.

     LOOP AT IT.

        MODULE READ_DATA.

     ENDLOOP.

__________________________

MODULE READ_DATA.

  READ TABLE IT INDEX TABC-CURRENT_LINE TRANSPORTING NO FIELDS.

  IF SY-SUBRC = 0.  

    MODIFY IT

    FROM WA

    INDEX TABC-CURRENT_LINE .

  ELSE.

     APPEND WA TO IT.

  ENDIF.

ENDMODULE.

__________________________

Read only

former_member196651
Contributor
0 Likes
849

Hai Alpesh,,

In PAI loop for the table control, place a module and write the following code there:

   MODIFY gt_table FROM wa_table INDEX table1-current_line.

   IF sy-subrc <> 0.

     INSERT gt_table INTO wa_table INDEX table1-current_line.

   ENDIF.

Similerly, please place the number of lines in your internal table in the table control's LINES property. In case if your table control is table1, then use the following code in any modules in PBO:

DESCRIBE TABLE gt_table LINES table1-lines.

I think this will work for you.

Thanks & Regards,

Abijith

Read only

Nag_
Explorer
0 Likes
849

Hi Alpesh,

When you press 'Enter', it will trigger the PAI Event of the program and the execution starts from the scratch, in the middle of the program you may be overwriting your internal table with the other data, or you may be clearing it in the middle of the process.

So put a breakpoint in the PAI event and check where it is clearing the internal table.

Thanks,

Siva

Read only

matt
Active Contributor
0 Likes
849

I guess you have the same homework question as