‎2009 Aug 27 8:58 AM
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
‎2009 Aug 27 9:52 AM
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.
‎2009 Aug 27 10:24 AM
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.
‎2009 Aug 27 12:41 PM
Answerd.
hi guys Thanks for your valuable input,I solve it by reading the internal table.
Thanks
Dharma