Reputation: 155
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
Upvotes: 0
Views: 4400
Reputation: 155
I updated the update module like this and problem solved.
MODULE update INPUT. "my update module
MODIFY snctab INDEX ctrl-current_line.
IF sy-subrc <> 0.
APPEND snctab.
ENDIF.
ENDMODULE.
Upvotes: 1
Reputation: 18483
Your LOOP
statement in the PAI module does not take the table control into account - you are using an obsolete variant that was used to process step loops there. Check the demo program DEMO_DYNPRO_TABCONT_LOOP
in your system to see a working example.
Upvotes: 0