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: after scroll, 'single select' is not enforced

Former Member
0 Likes
407

Hi guys,

4.0B: I have a big table control that the user will need to scroll.

The table control allows only single line selection, however, when you scroll

the selected line off-screen (e.g. by using the mouse scroll button or the scrollbar), the line remains selected even when you select a new one.

I haven't been able to try this behaviour out yet in a newer release.

Does anyone know a fix for this? (btw - scrolling using the scrollbar does not trigger an ok_code)

Thanks in advance.

Hi guys,

4.0B: I have a big table control that the user will need to scroll.

The table control allows only single line selection, however, when you scroll

the selected line off-screen (e.g. by using the mouse scroll button or the scrollbar), the line remains selected even when you select a new one.

I haven't been able to try this behaviour out yet in a newer release.

Does anyone know a fix for this? (btw - scrolling using the scrollbar does not trigger an ok_code)

Thanks in advance.

2 REPLIES 2
Read only

Former Member
0 Likes
380

I have currently implemented a 'quick fix':

- in PBO, compare current TC-top_line with previously saved TC-top_line

- if scrolling is detected, all selection fields are deleted

This is a coarse hack, but I don't have the inspiration to improve this, currently.

Does any of you guys have a better idea?

Thanks,

Rob

Read only

0 Likes
380

Nevermind, I found a way.

For my own reference I'll give the code.


PROCESS AFTER INPUT.                              
  MODULE exit_command AT EXIT-COMMAND.            
  LOOP AT gt_assort.                              
    FIELD gs_assort-sel MODULE tc_mark ON REQUEST.
    MODULE tc_assort_pai.                         
  ENDLOOP.                                        
  MODULE user_command_0100.                       

and the module:


MODULE tc_mark INPUT.                                                
  DATA: ls_assort LIKE gs_assort.                                    
  CLEAR ls_assort.                                                   
  IF tc_assort-line_sel_mode = 1 AND                                 
     gs_assort-sel = 'X'.                                            
** clear SEL in whole TC                                             
    MODIFY gt_assort FROM ls_assort TRANSPORTING sel WHERE sel = 'X'.
** set SEL in current line                                           
    MODIFY gt_assort FROM gs_assort INDEX tc_assort-current_line     
      TRANSPORTING sel.                                              
  ENDIF.                                                             
ENDMODULE.                             " TC_MARK  INPUT              

Cheers,

Rob