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: 

How to remove the Multiple selection button in Alv Grid ?

former_member218528
Participant
0 Kudos

Hi ,

Can anyone tell how to remove the select all button in oo alv grid..

I have tried various things and did R&D ,but could not get the required result..

Please find the attachment ..

Regards,

Rohan

14 REPLIES 14

Sandra_Rossi
Active Contributor
0 Kudos

Using CL_GUI_ALV_GRID, CL_SALV_TABLE, or anything else?

Sandra_Rossi
Active Contributor
0 Kudos

I guess this button is present only when the layout is setup to allow selecting several lines at a time. I think the default behavior is maximum one line, but anyway, to do it:

Via CL_GUI_ALV_GRID, set this value via the layout : LVC_S_LAYO-SEL_MODE = 'B'

Via CL_SALV_TABLE, use lo_table->get_selections( )->set_selection_mode( IF_SALV_C_SELECTION_MODE=>SINGLE ).

0 Kudos

Hi Sandra,

I have tried the same code ,what happens is entire column is dissappeared..

image1.png

Please see the attachment..

I just want to remove the SELECT ALL icon ..

Regards,

Rohan

0 Kudos

I don't find a way to remove it. I think it's handled differently than the classic buttons in the top of the ALV grid control (these buttons may be hidden). Why do you need to remove it, by the way?

0 Kudos

Hi Sandra,

As per my Client request ,I need to remove that icon..

Regards,

Rohan

matt
Active Contributor

That's not an answer. Why is your client requesting the icon be removed? What is the business requirement behind the request?

former_member218528
Participant
0 Kudos

Hi Sandra,

Thank you for reply..

I have used CL_GUI_ALV_GRID for displaying the grid..so that is the reason why that SELECT ALL button is coming defaultly..Now I need to hide or remove it..Please suggest is there any way..

Regards,

Rohan

vamsilakshman_pendurti
Active Participant
0 Kudos

Hi,

Could you please share the screen shot of your ALV Grid Display Output.

Thanks ,

Vamsi.

0 Kudos

Hi Vamsi,

Please find the image attached..image.png

Regards,

Rohan

vamsilakshman_pendurti
Active Participant
0 Kudos

Hi,

Actually in your class, method-- CL_GUI_ALV_Grid=>Set_table_for_first_Display ...We have a parameter like IT_TOOLBAR_EXCLUDING there you can pass what ever you want to hide then it will be disappear as per you mention FCODE over there in the above Parameter IT_TOOLBAR_Excluding.

Hope it would be helpful for your problem...

Thanks,

Vamsi

0 Kudos

Hi Vamsi,

If i wanted to remove the tool bar icons ,then i need to populate that parameter..

I want to remove the Select All icon which is deputed into ALV grid..Please check the above image which i have marked..

Regards,

Rohan

raymond_giuseppi
Active Contributor

If you are not able in your version to disable the function selet all, try to handle event before_user_command, there 'intercept' this command e_ucomm = cl_gui_alv_grid=>mc_fc_select_all, there reset the function code with mygrid->set_user_command( i_ucomm = space ).

Regards,
Raymond

dstjacques
Participant
0 Kudos

Assign 'X' to your layout-no-rowmark.

DATA: go_grid TYPE REF TO cl_gui_alv_grid,

ls_layout TYPE lsv_s_layo,

lt_fieldcat TYPE lvc_t_fcat,

gt_alv TYPE (You table to display).

CREATE OBJECT go_grid.

ls_layout-no_rowmark = 'X'.

* Fulfill your lt_fiedcat

* Fulfill you internal data table (gt_alv)

CALL METHOD go_grid->set_table_for_first_display
EXPORTING is_layout = ls_layout
CHANGING it_fieldcatalog = lt_fieldcat
it_outtab = gt_alv.

DoanManhQuynh
Active Contributor
0 Kudos

i think that button is not "select all rows" but select "ALV all", so it generated since there are row and column in ALV. if you using NO_HEADER or NO_ROWMARK then that button disappear. but maybe that not what you want...