Application Development and Automation 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: 
Read only

table control?

Former Member
0 Likes
308

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,

2 REPLIES 2
Read only

Former Member
0 Likes
290

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

Read only

Former Member
0 Likes
290

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.