‎2007 May 08 8:22 PM
Hi, All:
I create a table control on a screen. when I click on a table control vertical scroll bar, why all data within it disappear.
any help, appreicate.
Regards,
‎2007 May 08 8:46 PM
Write down the code under PAI :
Loop at i_data . i_data is your internal table
MODULE table_modify. " Mention the code here
endloop.
MODULE table_modify INPUT.
MODIFY i_data INDEX t_tc-current_line. " t_tc is the Table control
IF sy-subrc <> 0.
INSERT t_tcdata INDEX t_tc-current_line.
ENDIF.
ENDMODULE.
Reward Points if it is helpful
Thanks
Seshu
‎2007 May 08 8:46 PM
each time u scroll or do any action, the screen is getting refreshed.. ie, PAI and PBO is executing once.
so if u need the data in table control not to vanish, then in PAI, u shud move ur data in table control to an internal table...and in pbo, move that data from int tab to table control again...
many ways to code this..see this sample code..
in PAI.
LOOP AT G_VBELN.
MODULE MODIFY_G_VBELN.
ENDLOOP.
MODULE MODIFY_G_VBELN INPUT.
MOVE-CORRESPONDING G_VBELN TO I_VBELN.
CLEAR G_VBELN.
READ TABLE G_VBELN INDEX TCTRL_VBELN-CURRENT_LINE.
IF G_VBELN-VBELN IS INITIAL.
MOVE-CORRESPONDING I_VBELN TO G_VBELN.
INSERT G_VBELN INDEX TCTRL_VBELN-CURRENT_LINE.
ELSE.
MODIFY G_VBELN FROM I_VBELN INDEX TCTRL_VBELN-CURRENT_LINE.
ENDIF.
ENDMODULE.
and in pbo.
LOOP AT G_VBELN WITH CONTROL TCTRL_VBELN CURSOR
TCTRL_VBELN-CURRENT_LINE.
ENDLOOP.