‎2010 Jan 27 11:50 AM
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
‎2010 Jan 27 12:09 PM
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
‎2010 Jan 27 12:21 PM
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
‎2010 Jan 27 12:29 PM
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
‎2010 Jan 28 5:32 AM
Hi Abhijit,
Are you facing the problem only while doing the 'select All' option, or even when selecting a single record?
Regards,
Swarna Munukoti
‎2010 Jan 28 5:34 AM
‎2010 Jan 28 8:28 AM
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.
‎2010 Feb 01 6:53 AM
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
‎2010 Feb 08 12:59 PM
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
‎2010 Feb 09 3:07 AM
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
‎2010 Feb 09 8:47 AM
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
‎2010 Feb 09 8:53 AM
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
‎2010 Feb 15 7:16 AM
‎2010 Feb 15 10:41 AM
Hi Abhijit,
Can you share how did u solve the issue?
Regards,
Swarna Munukoti
‎2010 Aug 31 8:14 AM
Hi Dear friend,
Same problem Im facing can you please advise me.
Thank you,
Sridhar,
‎2010 Aug 31 8:22 AM
Can you please advise how to solve this problem.Im also facing the same.
Thankyou,
sridhar
‎2010 Jan 27 12:32 PM
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
‎2011 Oct 05 6:23 AM
hi
Same problem. only font color is changed not highlight the rows. can you tell me how to solve this.
Thks.
Regards
Tra