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

Highlight table control rows when select all button is clicked

Former Member
0 Likes
2,757

Hi Experts,

I have a table control and filling up rows through user input and i have also created button such as Select All* , De-Select All, and Delete.

Now the issue is when i am pressing the select all button all the rows are marked for deletion(internal 'X' flag is set) but the rows are not highlighted(so that user will be able to know that all rows are selected).

Anything that i am missing, please guide......

Regards,

Abhijit G. Borkar

17 REPLIES 17
Read only

Former Member
0 Likes
1,873

Hi,

try this

MODULE SELECT_ALL INPUT.
  IF OK_CODE = 'SALL'.           select all
    LOOP AT IT_TAB. 
      IT_TAB-LINESEL = 'X'.
      MODIFY IT_TAB.
    ENDLOOP.
  ENDIF.
ENDMODULE.

or in the user command write:

WHEN 'SALL'.
      LOOP AT IT_TAB.
        IT_TAB-LINESEL = 'X'.
        MODIFY IT_TAB TRANSPORTING LINESEL.
      ENDLOOP.

Edited by: Radhika Parag Rajopadhye on Jan 27, 2010 1:12 PM

Read only

0 Likes
1,873

Hi Radhika,

Thanx for your response.....

The code you have given is correct i have written the same code but my problem is the when we press the Select All button all the rows in the table control must be highlighted right .... but that is not happening .... this is the problem.....

rest is OK....

Regards,

Abhijit G. Borkar

Read only

0 Likes
1,873

Hi,

I must work.

I think you must have made some mistake while writing the code.

Check where have you written the code in User-command or in a separate PAI module.

It should be in User-command

Read only

0 Likes
1,873

Hi Abhijit,

Are you facing the problem only while doing the 'select All' option, or even when selecting a single record?

Regards,

Swarna Munukoti

Read only

0 Likes
1,873

Select All.

Read only

0 Likes
1,873

Hi Abhijit,

Can you check in debug mode whether the value of LINE_SELECTOR variable in table control is set to X or not?(in PBO)

Regards,

Swarna Munukoti.

Read only

0 Likes
1,873

it is getting updated ....

because see what happens is that when i click on 'Select All' then the lines are not highlighted but after that if I press on 'Delete' Button then all the rows are deleted .

Regards,

Abhijit G. Borkar

Read only

0 Likes
1,873

Hello Abhijit,

I'm in the same pool with you,thought to ask you since this thread is not very much old

Were you able to found any solution? It would be great if you could share the solution though.

Below is code snippet which I have written to do so.

MODULE USER_COMMAND_6000 INPUT.
  case sy-ucomm.
        when  'SELA'. " Function code of Select All.
 mark = 'X'." Mark is W/selcolum from table control.
  LOOP AT itab.
  itab-mark = 'X'. "Also I have appended the Mark in internal table.
    modify itab.
  ENDLOOP.

I'm sure I'm missing a obvious thing but unfortunately I'm not able to locate it.

Any help would be highly appreciated.

Update : Okay, Iu2019ve done this. And glad to share the solution, which is below.

Just keep the w/selcolumn flag from table control with the name like ITAB-MARK (I'm assuming that you have appended the MARK in ITAB).

If so then my above code should work for you.

Cheers

Read only

0 Likes
1,873

Hi Abhi,

In Screen Painter select mulitple line selection.
" Just incase you are selecting the data in PBO then restrict it to once only so that data updated in Itab wont get refreshed.
" If your purpose is already served Close this Thread
In TOP include

DATA : BEGIN OF itab OCCURS 0, " I lately found this is somewhat old thread any how this migh work for you
       mark.
        INCLUDE STRUCTURE sflight.
DATA END OF itab.

In PBO.
module highlight.
loop at itab with control tc.
module show.
endloop.

in program.
module show.
loop at screen.
if itab-mark = 'X'.
screen-intensified = 1.
modify screen.
endif.
endloop.
endmodule.

module highlight.
case ok_code.
when 'SEL'.
LOOP AT ITAB.
ITAB-MARK = 'X'.
MODIFY ITAB INDEX SY-TABIX. " This is a tested code in my system
ENDLOOP.
    WHEN 'DES'.
      LOOP AT itab.
        CLEAR  itab-mark.
        MODIFY itab INDEX sy-tabix.
      ENDLOOP.
endcase.
endmodule.

Cheerz

Ram

Read only

0 Likes
1,873

Hi Amit,

Good to hear from you,

I tired your suggestion but still it is not working......

i just wanted to added something in the above question,

Since the LINE_SELECTOR is ON so when I select a line in the table control it gets highlighted and after that if i Press ENTER the the highlighted view no longer stays but internally if we check the internal table the MARK field = 'X'.

This might be the case which is depriving me of the view to see all the lines selected when i press the Select All Button.

I am not able to figure out the exact issue.

Regards,

Abhijit G. Borkar

Read only

0 Likes
1,873

Hi Ram,

I tried your suggestion but it resulted in the change of color of the Font of the rows in the internal table

but i need to selection view in the table control just as when we select a row of table control it gets highlighted I want the same functionality.

Any help on this will be appreciated.

Regards,

Abhijit G. Borkar

Read only

0 Likes
1,873

Solved myself.

Read only

0 Likes
1,873

Hi Abhijit,

Can you share how did u solve the issue?

Regards,

Swarna Munukoti

Read only

0 Likes
1,873

Hi Dear friend,

Same problem Im facing can you please advise me.

Thank you,

Sridhar,

Read only

0 Likes
1,873

Can you please advise how to solve this problem.Im also facing the same.

Thankyou,

sridhar

Read only

Former Member
0 Likes
1,873

Hi Abhijit,

Since you are using table control , if u are working with module Pool Programming,than...

Goto --the screen >Layoutin layout >tablecontrol> u can find the text *w/Selcolumn -


> Give the workarea as wa-sel ( Assumed u have already declared in Internal table).


When SelectAll.
wa-sel = 'X'.
MODIFY internal table transporting sel where sel <> 'X'.

Please try.

Regards

Arbind

Read only

Former Member
0 Likes
1,873

hi

Same problem. only font color is changed not highlight the rows. can you tell me how to solve this.

Thks.

Regards

Tra