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: 

alv

Former Member
0 Kudos

how can i select multiple records in alv grid .and how can i catch those recards?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

Change layout selection field. Use like this...



 clear gs_layout.
    gs_layout-sel_mode   = 'A'.       "Allow multi line selection
    gs_layout-info_fname = 'ROW_COLINFO'.
    gs_layout-zebra      = 'X'.


    call method gcc_grid_dm->set_table_for_first_display
      exporting
*          i_structure_name              = c_s_dmhdr
        is_variant                    = gs_variant
        i_save                        = 'A'
        is_layout                     = gs_layout                                   "layout
*        it_toolbar_excluding          = gt_excl_fun[]
      changing
        it_outtab                     = gt_not_linked_debitmemos[]
        it_fieldcatalog               = gt_fcat[]
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.
    if sy-subrc <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.

Use this method to get selected rows...


call method gcc_grid_dmtr->get_selected_rows
            importing
              et_index_rows = lt_rows.

Hope it will helps

12 REPLIES 12

Former Member
0 Kudos

hey,

You can use the checkbox in the alv and then using that you will be able to select multiple lines.

Regards.

Midhun Abraham

0 Kudos

thank u ..how can i catch them?

Former Member
0 Kudos

Hi,

Change layout selection field. Use like this...



 clear gs_layout.
    gs_layout-sel_mode   = 'A'.       "Allow multi line selection
    gs_layout-info_fname = 'ROW_COLINFO'.
    gs_layout-zebra      = 'X'.


    call method gcc_grid_dm->set_table_for_first_display
      exporting
*          i_structure_name              = c_s_dmhdr
        is_variant                    = gs_variant
        i_save                        = 'A'
        is_layout                     = gs_layout                                   "layout
*        it_toolbar_excluding          = gt_excl_fun[]
      changing
        it_outtab                     = gt_not_linked_debitmemos[]
        it_fieldcatalog               = gt_fcat[]
      exceptions
        invalid_parameter_combination = 1
        program_error                 = 2
        too_many_lines                = 3
        others                        = 4.
    if sy-subrc <> 0.
*     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.

Use this method to get selected rows...


call method gcc_grid_dmtr->get_selected_rows
            importing
              et_index_rows = lt_rows.

Hope it will helps

0 Kudos

thank u but its not working .i hav given 'A'.

Former Member
0 Kudos

Plz refer -

Regards,

Aparna

former_member181995
Active Contributor
0 Kudos

>

> how can i select multiple records in alv grid .and how can i catch those recards?

By select statement.

0 Kudos

>By select statement.

I am doubtful, he should use key board Ctrl Shift buttons, not the select statement 😛

0 Kudos

> I am doubtful, he should use key board Ctrl Shift buttons, not the select statement 😛

Why not just Ctrl +Y

no need of too bother for press Shift

@subhir :

iam not allowed to press ctrl shift buttons

Are you still using Boxes?

Cheers

Edited by: Ámit Güjärgoüd on Oct 1, 2008 11:53 AM

Former Member
0 Kudos

Hi

Good

check this forum link, hope this will help you to solve your problem.

https://forums.sdn.sap.com/post!reply.jspa?threadID=1016192

Thanks

mrutyun^

Former Member
0 Kudos

Hi,

Press Ctrl or shift button and then select rows. it will select....

0 Kudos

iam not allowed to press ctrl shift buttons

Former Member
0 Kudos

Hi,

Other wise use check box to select multiple rows..

Please refer this program : BCALV_EDIT_05 in SE38 tcode