Skip to Content
author's profile photo Former Member
Former Member

need method to disable checkbox


My alv Grid report contains checkbox at end of each row, when ever user select the checkbox , I am taking the particular line to internal Table by using below code.

DATA cl_gui_alv_grid TYPE REF TO cl_gui_alv_grid.



e_grid = cl_gui_alv_grid.

CALL METHOD cl_gui_alv_grid->check_changed_data.

My problem is whenever user selects the checkbox the checkbox should go Gray(Disabled).

Is there any method to do this, If so pls give sample code.

I tried with SET_VISIBLE, but not working

I am using version 4.6C



Edited by: karthik karthik on Jan 9, 2008 7:52 PM

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 02:18 PM

    Hi Karthik,

    You can use this method cl_gui_alv_grid=>mc_style_disabled

    For example go through the program BCALV_EDIT_05

    In this program output ,If you double click on the check box it will be disabled , You can try the same logic in your program

    Regards Rk

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2008 at 02:45 PM

    hi karthik,

    this may be helpful to u

    You have to have in the Output Table:

    Types: begin of lt_io.

    include structure mara. " Your Structure

    Types: style_table type lvc_t_style.

    Types: end of lt_io.

    data: lt_io type table of lt_io,

    ls_layout type lvc_s_layo,

    lt_fcat type lvc_t_fcat,

    lo_grid type ref to cl_gui_alv_grid.

    field-symbols: <io> type lt_io,

    <fcat> type lvc_s_fcat.

    ... fill your output table ....

    ls_layout-stylefname = 'STYLE_TABLE'.

    loop at lt_io assigning <io>.

    PERFORM set_style USING 'CHECKBOX' "Your Filename

    CHANGING <io>.


    ... Fill Your Field Catalog lt_fcat

    read table lt_fcat assigning <fcat>

    where fieldname = 'CHECKBOX'.

    <fcat>-checkbox = 'X'.


    create grid control lo_grid.


    CALL METHOD lo_grid->set_table_for_first_display


    is_layout = ls_layout


    it_fieldcatalog = lt_fcat

    it_outtab = lt_io[].


    FORM set_style

    USING iv_fieldname TYPE lvc_fname

    CHANGING cs_io TYPE io.

    DATA: ls_style TYPE lvc_s_styl,

    lt_style TYPE lvc_t_styl.

    ls_style-fieldname = iv_fieldname.

    if cs_io-checkbox = ' '.

    ls_style-style = cl_gui_alv_grid=>mc_style_enabled.


    ls_style-style = cl_gui_alv_grid=>mc_style_disabled.


    ls_style-maxlen = 2.

    INSERT ls_style INTO TABLE io-style_table.

    ENDFORM. "set_style



    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.