Application Development and Automation 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: 
Read only

alv

Former Member
0 Likes
1,403

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,349

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

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

12 REPLIES 12
Read only

Former Member
0 Likes
1,349

hey,

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

Regards.

Midhun Abraham

Read only

0 Likes
1,349

thank u ..how can i catch them?

Read only

Former Member
0 Likes
1,350

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

Read only

0 Likes
1,349

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

Read only

Former Member
0 Likes
1,349

Plz refer -

Regards,

Aparna

Read only

Former Member
0 Likes
1,349

>

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

By select statement.

Read only

0 Likes
1,349

>By select statement.

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

Read only

0 Likes
1,349

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

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

Read only

Former Member
0 Likes
1,349

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^

Read only

Former Member
0 Likes
1,349

Hi,

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

Read only

0 Likes
1,349

iam not allowed to press ctrl shift buttons

Read only

Former Member
0 Likes
1,349

Hi,

Other wise use check box to select multiple rows..

Please refer this program : BCALV_EDIT_05 in SE38 tcode