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: 

row selection in TC

Former Member
0 Kudos

I have set my column selection to single.. And this works perfectly when i select different rows in the same page (meaning the first row is unmarked and second row is marked)

But when I select a row in one page and another in second page, both the rows remain highlighted. How do I avoid this? I can write a logic to give an error from code, but how do I prevent this happening in table control?

4 REPLIES 4

Former Member
0 Kudos

You have set the column selection to single, but have you also set the row selection to single?

Rob

0 Kudos

I have encountered this many times. I believe that it is a bug in the table control itself.

I allows write code to address the issue with pop-ups to tell the user that they have selected multiple rows (on multiple pages).

0 Kudos

Rob, it is at both row and column level..

And John thanx for confirming that.. I am doing the same... Which do you think is better? unmarking the row on previous page or popup message?

0 Kudos

Hi SSG

I think your problem depends on how you store the selected rows in your data program.

If you choose a single selection, you should use a field i/o doesn't belong your internal table, for example MARK:

PROCESS PBO

LOOP AT ......

MODULE SET_SELECTED_ROW.

ENDLOOP.

PROCESS PA1

LOOP AT ......

FIELD MARK MODULE GET_SELECTED_ROW.

ENDLOOP.

MODULE SET_SELECTED_ROW.

IF T_CTRL-CURRENT_LINE = SELECTED_LINE.

MARK = 'X'.

ELSE.

MARK = SPACE.

ENDIF.

ENDMODULE.

MODULE GET_SELECTED_ROW.

  • Init SELECTED_LINE

IF SY-STEPL = 1.

SELECTED_LINE = 0.

ENDIF.

CHECK MARK = 'X'.

SELECTED_LINE = T_CTRL-CURRENT_LINE.

ENDMODULE.

If you choose a multiple selection, you should use a field i/o belonging your internal table, for example ITAB-MARK:

MODULE SET_SELECTED_ROW.

IF ITAB-MARK.

MARK = 'X'.

ELSE.

MARK = SPACE.

ENDIF.

ENDMODULE.

MODULE GET_SELECTED_ROW.

ITAB-MARK = MARK.

ENDMODULE.

Max

Message was edited by: max bianchi