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

Placing Checkbox in ALV Grid Cell

Hi,

I am using ALV grid control (oops concept)for displaying report.

My requirement is to display certain rows of a column as checkbox.

How can change the fieldcatalogue for a particular line where a checkbox is to be displayed?

Regards

Siraj

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • Posted on Jan 10, 2007 at 10:34 AM

    hi,

    chk this std pgm BCALV_EDIT_05

    BCALV_EDIT_05 This example shows how to use checkboxes within an ALV Grid Control. You learn:

    (1) how to define a column for editable checkboxes for an attribute of your list

    (2) how to evaluate the checked checkboxes

    (3) how to switch between editable and non-editable checkboxes

    Regards

    Anver

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 10:37 AM

    For certain rows it is not possible ,

    u can do this

    1.Make the full column as checkbox

    2.Make the ones which u need in edit mode and the others in display mode

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 02:59 PM

    Hi,

    To make a column as check box set the parameter

    <wa_fieldcat>-checkbox = 'X'.

    Thanks,

    Rashmi.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 10, 2007 at 03:05 PM

    Define the final output table with the first columns as TYPE C.

    Eg. DATA: BEGIN OF I_itab occurs 0,
                    cb(1)   TYPE c,
    ....................
                   END OF I_itab.

    Then while building the fieldcatalog.

    CASE ...
    WHEN 'CB'.
    w_fieldcat-checkbox = 'X'.
    ..
    ENDCASE.

    Hope this solves ur problem.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 10, 2007 at 03:12 PM

    Hi

    At declaring field catalog using structure LVC_S_FCAT

    mark CHECKBOX = 'X' and also EDIT = 'X'.

    For reference check below subroutine in program BCALV_EDIT_05.

    form build_fieldcat changing pt_fieldcat type lvc_t_fcat.

    data ls_fcat type lvc_s_fcat.

    call function 'LVC_FIELDCATALOG_MERGE'

    exporting

    i_structure_name = 'SFLIGHT'

    changing

    ct_fieldcat = pt_fieldcat.

    *§A2.Add an entry for the checkbox in the fieldcatalog

    clear ls_fcat.

    ls_fcat-fieldname = 'CHECKBOX'.

    • Essential: declare field as checkbox and

    • mark it as editable field:

    ls_fcat-checkbox = 'X'.

    ls_fcat-edit = 'X'.</b>

    • do not forget to provide texts for this extra field

    ls_fcat-coltext = text-f01.

    ls_fcat-tooltip = text-f02.

    ls_fcat-seltext = text-f03.

    • optional: set column width

    ls_fcat-outputlen = 10.

    *

    append ls_fcat to pt_fieldcat.

    endform.

    let me know if u need any more inputs.

    - Sankar

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 11, 2007 at 02:26 PM

    populate the filed catalog as follows:-

    data: l_pos type i.

    data: g_flcat type lvc_s_fcat,

    g_t_flcat type lvc_t_fcat,

    clear: g_flcat, g_t_flcat[], l_pos.

    • CHECKBOX

    l_pos = '1'.

    g_flcat-col_pos = '1'.

    g_flcat-fieldname = 'CHECKBOX'.

    g_flcat-checkbox = 'X'.

    g_flcat-edit = 'X'.

    g_flcat-emphasize = 'C1'.

    g_flcat-inttype = 'C'.

    g_flcat-outputlen = '6'.

    g_flcat-coltext = 'Delete record'.

    append g_flcat to g_t_flcat.

    • PLANT

    clear g_flcat.

    l_pos = l_pos + 1.

    g_flcat-col_pos = l_pos.

    g_flcat-fieldname = 'WERKS'.

    g_flcat-emphasize = 'C1'.

    g_flcat-inttype = 'C'.

    g_flcat-outputlen = '6'.

    g_flcat-coltext = 'Plant'.

    append g_flcat to g_t_flcat.

    when the ALV with g_t_flcat will be displayed, first field will be checkbox.

    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.