Application Development 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: 

Fetching data from Table control into internal table

0 Kudos
198

Hello all,

I have this requirement in which I need to fetch data from the table control into an internal table (any changes can be in any row), the table control is empty initially, user enter values one by one.

The problem is after getting first row and user presses enter, it works fine but when he enters new row and pressing enter, the internal tables is filled with three rows, that is two first rows and one new (second one).

Please help with some solution.

MODULE user_command_0100 INPUT.
  APPEND wa_item TO it_item.
  CLEAR wa_item.
ENDMODULE.
PROCESS BEFORE OUTPUT.
  MODULE status_0100.
  MODULE init_0100.
  LOOP AT it_item INTO wa_item  WITH CONTROL tc_item.

  ENDLOOP.
*
PROCESS AFTER INPUT.
  MODULE exit_module_0100 AT EXIT-COMMAND.
  LOOP AT it_item.
    MODULE user_command_0100.
  ENDLOOP.

1 REPLY 1

Sandra_Rossi
Active Contributor
0 Kudos
135

Use the debugger and you will see that you add a line in the MODULE user_command_0100.

It's called all the time, so you should test the "OK field" (sort of sy-ucomm).