12-17-2008 3:02 PM
Hi All,
I'm writing a screen which includes a table control and below is my code:
PROCESS AFTER INPUT.
LOOP AT gt_blds.
CHAIN.
FIELD gw_bld-ebeln.
FIELD gw_bld-ebelp.
FIELD gw_bld-quanty.
MODULE get_item ON CHAIN-INPUT.
ENDCHAIN.
endloop.
The get_item was used to summary the total quanty of each PO item.
The problem is that once the lines of gt_blds is 16 and my table control lines is 14, the get_item module will only calculate from line 1 to line14, the last 2 lines was lost...
Can anyone help me?
12-17-2008 4:24 PM
If you want to calculate the total every time for each line, just drop the 'ON CHAIN INPUT' and just do 'MODULE get_item.' I guess the on chain input event is not triggered for lines that are not currently displayed in the table control.
But executing the module every time should do the trick.
Hope that helps,
Michael
12-17-2008 4:33 PM
Hi Michael,
The problem is whether I dropped the on chain-input statement. The program only loops the lines of the screen but not the whole internal table which i used to store all the data.
12-18-2008 4:38 AM
Hi,
PROCESS AFTER INPUT.
LOOP AT gt_blds.
CHAIN.
FIELD gw_bld-ebeln.
FIELD gw_bld-ebelp.
FIELD gw_bld-quanty.
MODULE get_item ON CHAIN-INPUT.
ENDCHAIN.
**add one more module.
module modify_tabcontrol
endloop.
in program.
module modify_tabcontrol.
describe table itab lines tc-lines.
if tc-current_line > tc-lines.
append itab.
else.
modify itab index tc-current_line.
endmodule.
even you cannot acheive this.
add one more module after the loop statement
module count_qty.
in program
module count_qty.
*here you sum up or whatever you want
endmodule.
Regards
Ramchander Rao.K