I have an table control (ctrl) and an internal table (snctab).
I want to add items snctab from the table control. I can add but not modify a record from snctab. Here are my PBO and PAI modules:
PROCESS BEFORE OUTPUT.
MODULE status_0100.
LOOP AT snctab WITH CONTROL ctrl CURSOR ctrl-current_line.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT snctab.
MODULE update.
ENDLOOP.
MODULE user_command_0100.
MODULE update INPUT. "my update module
READ TABLE snctab INDEX ctrl-current_line.
IF sy-subrc <> 0.
APPEND snctab.
ELSE.
MODIFY snctab INDEX ctrl-current_line.
ENDIF.
ENDMODULE. " UPDATE INPUT
scntabandctrl, the contents ofctrlis not being updated in your code? But if the record doesn't exist inctrl, it will successfully be added toctrl? - gkubed