Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Lines of a table control are more than one table control problem.

Former Member
0 Kudos

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?

3 REPLIES 3

former_member589029
Active Contributor
0 Kudos

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

0 Kudos

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.

former_member1245113
Active Contributor
0 Kudos

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