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-Modify internal table

Former Member
0 Likes
1,033

hi all,

In my table control am displaying the data from internal table ,when i edit existing data and modify the data in

internal table it is not modofy in internal table.

PROCESS BEFORE OUTPUT.

MODULE STATUS_0100.

loop at it_all into wa_all WITH CONTROL tc.

ENDLOOP.

MODULE pbo_chk.

PROCESS AFTER INPUT.

loop at it_all.

MODULE scr_chk.

MODULE EDIT_SAVE. ========> Modify the data here

endloop.

MODULE USER_COMMAND_0100.

module EDIT_SAVE input.

MODIFY it_all FROM wa_all INDEX TC-CURRENT_LINE. ======> the newly entered data are not appended

How to solv this?

Thanks and regards

dharma

3 REPLIES 3
Read only

Former Member
0 Likes
601

Hi,

Try doing this

In the PAI



PROCESS AFTER INPUT.
 
  MODULE clear_internal_table.  <- Note this MODULE
  LOOP AT gt_itab1.
    MODULE read_data.
  ENDLOOP.
 
MODULEclear_internal_table INPUT.   "Clear the internal table 
   clear gt_itab1[].
   clear gt_itab1.
ENDMODULE.
 
MODULE read_data INPUT.
   gt_itab1-field1 = field1-value.     "Store table control values into the internal table
   gt_itab1-field2 = field2-value.
ENDMODULE.

Clear the internal table every time before the PAI is triggered so that the modified table control values are read into the internal table.

Read only

Former Member
0 Likes
601

Hi dharma,

Try this code in your save_edit module(Sample Code)


 READ TABLE t_assignment INTO x_temp INDEX tablecontrol-current_line.----->t_assignment is internal table

  IF sy-subrc = 0.
    MODIFY t_assignment FROM x_assignment INDEX tablecontrol-current_line.
  ELSE.
   if not x_assignment-employee_id is INITIAL or not x_assignment-activity is INITIAL
     or not x_assignment-material is initial.
    APPEND x_assignment TO t_assignment .
  endif.
  ENDIF.

Read only

Former Member
0 Likes
601

Answerd.

hi guys Thanks for your valuable input,I solve it by reading the internal table.

Thanks

Dharma