‎2009 Aug 17 12:54 PM
Hi ppl,
I am facing an issue with table controls.
I have created a table control on my selection screen of a report.
But, when I enter data in the table control and hit enter key, the data vanishes.
Please let me know if I have missed out on coding something or let me know of the resources available online which can be referred for help.
The code written so far is:
PROCESS BEFORE OUTPUT.
LOOP AT t_tbcl WITH CONTROL tbcl CURSOR tbcl-current_line.
ENDLOOP.
PROCESS AFTER INPUT.
LOOP AT t_tbcl.
CHAIN.
FIELD: t_tbcl-kostl,
t_tbcl-posnr,
t_tbcl-ebeln.
MODULE modify_t_tbcl ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE modify_t_tbcl INPUT.
t_tbcl-mark = 'X'.
MODIFY t_tbcl INDEX tbcl-current_line.
ENDMODULE. " modify_t_tbcl INPUT
Thanks,
David.
‎2009 Aug 17 1:02 PM
Hi,
This happens because every time you hit ENTER, the PAI is triggered and then your PBO of the screen where you havent populated your table control with values from the internal table.
Try this.
-> Repopulate your data in the internal table in the PBO as well.
PROCESS BEFORE OUTPUT.
LOOP AT t_tbcl WITH CONTROL tbcl CURSOR tbcl-current_line.
module display_data. "Populate your table control with data from the internal table t_tbcl.
ENDLOOP.
-> To avoid further problems, clear your internal table in the PAI in a module before the LOOP...ENDLOOP
PROCESS AFTER INPUT.
module cleartable.
LOOP AT t_tbcl.
CHAIN.
FIELD: t_tbcl-kostl,
t_tbcl-posnr,
t_tbcl-ebeln.
MODULE modify_t_tbcl ON CHAIN-REQUEST.
ENDCHAIN.
ENDLOOP.
MODULE modify_t_tbcl INPUT.
t_tbcl-mark = 'X'.
MODIFY t_tbcl INDEX tbcl-current_line TRANSPORTING mark. "try including the TRANSPORTING addition as well
ENDMODULE.
module cleartable.
clear t_tbcl.
clear t_tbcl[].
endmodule.
‎2009 Aug 17 1:26 PM
Hi David,
In This module you need to append the data first in table.
MODULE modify_t_tbcl INPUT.
t_tbcl-mark = 'X'.
MODIFY t_tbcl INDEX tbcl-current_line transporting fields.
ENDMODULE. " modify_t_tbcl INPUT
Regards,
Nilesh
‎2009 Aug 17 1:34 PM
HI,
try this
LOOP AT t_tbcl.
CHAIN.
FIELD: t_tbcl-kostl,
t_tbcl-posnr,
t_tbcl-ebeln.
ENDCHAIN.
MODULE modify_t_tbcl .
ENDLOOP.
MODULE modify_t_tbcl INPUT.
IF t_tbcl-mark = 'X'.
CLEAR :<fields> which are holding the data.
MODIFY t_tbcl INDEX tbcl-current_line Transporting <fields>
else.
MODIFY t_tbcl INDEX tbcl-current_line Transporting <fields>
endif.
ENDMODULE.
Regards,
Nagaraj
‎2009 Aug 17 10:24 PM
Hi,
Modify your internal in PBO, only then the content will display