Skip to Content
0
Jan 12, 2005 at 06:19 AM

Problem in getting multiple selected rows in ALV

249 Views

Hi,

I m having a report which displays ouput in alv , Multiple row selection is enabled in alv.In ALV there is a delete button in the application toolbar , if i select one or more rows and click delete then all the selected rows should be deleted.

I dont know how to handle multiple selection in ALV and how to retrive the selected rows.

Can anyone please help me out in doing this.

<b>my ALV code is</b>

DATA: fieldcat TYPE lvc_t_fcat,

wa_fieldcat TYPE lvc_s_fcat.

DATA: layout TYPE lvc_s_layo. " layout

zstructure = 'ZREPAIR_ALLTYPES_RECORDS'.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

i_structure_name = zstructure

i_bypassing_buffer = 'X'

CHANGING

ct_fieldcat = fieldcat

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

  • Modify the layout.

layout-zebra = 'X'.

layout-cwidth_opt = 'X'.

layout-sel_mode = 'A'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'

EXPORTING

i_bypassing_buffer = 'X'

i_callback_program = zrepid

is_layout_lvc = layout

it_fieldcat_lvc = fieldcat[]

i_save = 'U'

is_variant = variant

it_events = events[]

it_event_exit = evexits[]

TABLES

t_outtab = allrecord

EXCEPTIONS

program_error = 1

OTHERS = 2.

Thanks in Advance.

Regards,

Rajanidhi Rajasekeran