ā2016 Jan 11 11:04 AM
in table control i want to modify table control internal table after user PRESS ENTER .
but internal table is not getting modified it is giving sy-subrc = 4.
please help me how to modify internal table and display the data in table control in module pool program
my logic:
FLOW LOGIC:
PROCESS BEFORE OUTPUT.
MODULE status_0483."""for pf status
LOOP AT gt_fdint INTO gs_fdint WITH CONTROL tab_con CURSOR
tab_con-current_line.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT gt_fdint .
CHAIN.
FIELD gs_fdint-zselno.
FIELD gs_fdint-zcustm.
FIELD gs_fdint-zfddes.
FIELD gs_fdint-zstart.
FIELD gs_fdint-zenddt.
FIELD gs_fdint-zaccrl.
FIELD gs_fdint-zintrs.
FIELD gs_fdint-zintdes.
FIELD gs_fdint-zpstdt.
FIELD gs_fdint-channel.
MODULE tc_acunt_modify ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE user_command_0483."""USER COMMAND SUBROUTINE
MODULE exit_command_483."""EXIT COMMAND SUBROUTINE
MODULE tc_acunt_modify INPUT.
MODIFY gt_fdint
FROM gs_fdint
INDEX tab_con-current_line.
ENDMODULE.
hear internal table is initially contains no record, if i give sone input in table control and press enter then
MODULE tc_acunt_modify ON CHAIN-REQUEST. is triggering and but it is not modifying the internal table
after MODIFY statement it is giving SY-SUBRC = 4.
ā2016 Jan 11 3:29 PM
Hi Chandu,
Modify statement never insert a new record in internal table.
MODIFY gt_fdint
FROM gs_fdint
INDEX tab_con-current_line.
IF sy-subrc <> 0.
INSERT gs_fdint INTO gt_fdint INDEX tab_con-current_line.
ENDIF.
Hope it helpful,
Regards,
Venkat.
ā2016 Jan 11 11:42 AM
Hi,
first insert a initial line in the internal table and then modify the same as below.
PROCESS AFTER INPUT.
LOOP AT gt_fdint .
CHAIN.
FIELD gs_fdint-zselno.
FIELD gs_fdint-zcustm.
FIELD gs_fdint-zfddes.
FIELD gs_fdint-zstart.
FIELD gs_fdint-zenddt.
FIELD gs_fdint-zaccrl.
FIELD gs_fdint-zintrs.
FIELD gs_fdint-zintdes.
FIELD gs_fdint-zpstdt.
FIELD gs_fdint-channel.
Module tc_insert_line ON CHAIN-REQUEST.
MODULE tc_acunt_modify ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE user_command_0483."""USER COMMAND SUBROUTINE
MODULE exit_command_483."""EXIT COMMAND SUBROUTINE
MODULE tc_insert_line INPUT.
READ TABLE gt_fdint INDEX tab_con-current_line TRANSPORTING NO FIELDS.
IF sy-subrc <> 0.
INSERT INITIAL LINE INTO gt_fdint INDEX tab_con-current_line.
ENDIF.
ENDMODULE. " tc_insert_line INPUT
MODULE tc_acunt_modify INPUT.
MODIFY gt_fdint
FROM gs_fdint
INDEX tab_con-current_line.
ENDMODULE.
Hope this helps.
ā2016 Jan 11 3:29 PM
Hi Chandu,
Modify statement never insert a new record in internal table.
MODIFY gt_fdint
FROM gs_fdint
INDEX tab_con-current_line.
IF sy-subrc <> 0.
INSERT gs_fdint INTO gt_fdint INDEX tab_con-current_line.
ENDIF.
Hope it helpful,
Regards,
Venkat.
ā2016 Jan 12 4:52 AM
Hi Venkat Ramesh,
thank you so much for your reply . really it is so helpful.
ā2016 Jan 11 3:47 PM
Create your table control using the table control wizard rather than doing it be hand.
Rich