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

Check boxes in ALV

Hi Experts,

Please tell me how to put checkboxes in ALV Grid report. For example that report shows the sales document numbers.If i select 10 check boxes based on the selection we can generate secondary list for corresponding sales documents numbers only.

Please guide me in this requirement.

Thanks in Advance.

Thanks and Regards

Srihari.

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 31, 2008 at 01:42 PM

    Hi,

    Go through these links

    http://www.sapfans.com/forums/viewtopic.php?t=88376

    http://www.sapfans.com/forums/viewtopic.php?t=40968

    http://www.sapfans.com/forums/viewtopic.php?t=6919

    Herewith i am attaching sample report for checkbox alv report.

    Kindly go through it.

    REPORT YMS_CHECKBOXALV.

    TYPE-POOLS: slis.

    DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.

    DATA: s_fieldcatalog TYPE slis_fieldcat_alv.

    DATA: s_layout TYPE slis_layout_alv.

    DATA: BEGIN OF itab OCCURS 0,

    icon TYPE icon-id,

    vbeln TYPE vbeln,

    kunnr TYPE kunnr,

    erdat TYPE erdat,

    box TYPE c,

    END OF itab.

    DATA: v_repid TYPE syrepid.

    START-OF-SELECTION.

    Get the data.

    SELECT vbeln kunnr erdat UP TO 100 ROWS

    FROM vbak

    INTO CORRESPONDING FIELDS OF TABLE itab.

    IF sy-subrc 0.

    MESSAGE s208(00) WITH 'No data found'.

    LEAVE LIST-PROCESSING.

    ENDIF.

    Modify the record with red light.

    itab-icon = '@0A@'.

    MODIFY itab TRANSPORTING icon WHERE NOT vbeln IS initial.

    v_repid = sy-repid.

    Get the field catalog.

    CLEAR: s_fieldcatalog.

    s_fieldcatalog-col_pos = '1'.

    s_fieldcatalog-fieldname = 'ICON'.

    s_fieldcatalog-tabname = 'ITAB'.

    s_fieldcatalog-seltext_l = 'Status'.

    s_fieldcatalog-icon = 'X'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    CLEAR: s_fieldcatalog.

    s_fieldcatalog-col_pos = '2'.

    s_fieldcatalog-fieldname = 'VBELN'.

    s_fieldcatalog-tabname = 'ITAB'.

    s_fieldcatalog-rollname = 'VBELN'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    CLEAR: s_fieldcatalog.

    s_fieldcatalog-col_pos = '3'.

    s_fieldcatalog-fieldname = 'KUNNR'.

    s_fieldcatalog-tabname = 'ITAB'.

    s_fieldcatalog-rollname = 'KUNNR'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    CLEAR: s_fieldcatalog.

    s_fieldcatalog-col_pos = '4'.

    s_fieldcatalog-fieldname = 'ERDAT'.

    s_fieldcatalog-tabname = 'ITAB'.

    s_fieldcatalog-rollname = 'ERDAT'.

    APPEND s_fieldcatalog TO t_fieldcatalog.

    Set the layout.

    s_layout-box_fieldname = 'BOX'.

    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

    EXPORTING

    i_callback_program = v_repid

    is_layout = s_layout

    i_callback_pf_status_set = 'SET_PF_STATUS'

    i_callback_user_command = 'USER_COMMAND'

    it_fieldcat = t_fieldcatalog[]

    TABLES

    t_outtab = itab.

    -


    FORM SET_PF_STATUS *

    -


    ........ *

    -


    --> EXTAB *

    -


    FORM set_pf_status USING extab TYPE slis_t_extab.

    SET PF-STATUS 'TEST2'.

    ENDFORM.

    -


    FORM user_command *

    -


    ........ *

    -


    --> UCOMM *

    --> SELFIELD *

    -


    FORM user_command USING ucomm LIKE sy-ucomm

    selfield TYPE slis_selfield.

    Check the ucomm.

    IF ucomm = 'DETAIL'.

    LOOP AT itab WHERE box = 'X'.

    itab-icon = '@08@'.

    MODIFY itab TRANSPORTING icon.

    ENDLOOP.

    ENDIF.

    selfield-refresh = 'X'.

    ENDFORM.

    Regards,

    Satish

    Edited by: Satish Panakala on Jan 31, 2008 1:44 PM

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jan 31, 2008 at 01:42 PM

    Check Sample report:

    BCALV_EDIT_05

    Regards,

    Ravi Kanth Talagana

    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.