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: 

avl evevts

Former Member
0 Kudos

Hi all.

We are using 'REUSE_ALV_EVENTS_GET' FM in ALV program. please tell me what is the use of this function module. What will happens if we not use this function module in our program.

Regards.

Prajwal.k

5 REPLIES 5

Former Member
0 Kudos

Hi Prajwal,

Function module ‘REUSE_ALV_EVENTS_GET’ returns table of possible events for a list type into a internal table.

This is basically to get the events used for processing of ALV's. It will returns table of possible events for a list type.

This function module returns a table of event names.The table has 2 fields they are NAME and FORM.

call function 'REUSE_ALV_EVENTS_GET'

exporting

i_list_type = 0

importing

et_events = rt_events.

Read table rt_event with key name and put the corresponding subroutine name in corresponding field of the event. As under :

Read table rt_event with key name and put the corresponding subroutine name in corresponding field of the event. As under :

read table rt_events with key name = slis_ev_top_of_page into ls_event.

if sy-subrc = 0.

move g_top_of_page to ls_event-form.

append ls_event to rt_events.

endif.

Here slis_ev_top_of_page is a constant defined in type pool SLIS having value

‘TOP_OF_PAGE’. Also, g_top_of_page = ‘TOP_OF_PAGE’. A list or internal table is prepared having all the events and corresponding columns have the subroutine name that will be called on occurrence of the event.So same if performed for all events.

TOP_OF_PAGE event will call this subroutine.

form top_of_page.

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

i_logo = 'ENJOYSAP_LOGO'

it_list_commentary = gt_list_top_of_page.

endform.

Reward if helpful.

Regards,

Harini.S

former_member198275
Active Contributor
0 Kudos

This is basically to get the events used for processing of ALV's. It will returns table of possible events for a list type.

This function module returns a table of event names.The table has 2 fields they are NAME and FORM.

When importing parameter I_LIST_TYPE = 0, it will returns all possible events in table ET_EVENTS.

ET_EVENTS-NAME contains the event names.

And later u have to modify this returned table ET_EVENTS with ur form names.

Function module ‘REUSE_ALV_EVENTS_GET’ returns table of possible events for a list type into a internal table.

call function 'REUSE_ALV_EVENTS_GET'

exporting

i_list_type = 0

importing

et_events = rt_events.

Read table rt_event with key name and put the corresponding subroutine name in corresponding field of the event. As under :

Read table rt_event with key name and put the corresponding subroutine name in corresponding field of the event. As under :

read table rt_events with key name = slis_ev_top_of_page into ls_event.

if sy-subrc = 0.

move g_top_of_page to ls_event-form.

append ls_event to rt_events.

endif.

Here slis_ev_top_of_page is a constant defined in type pool SLIS having value

‘TOP_OF_PAGE’. Also, g_top_of_page = ‘TOP_OF_PAGE’. A list or internal table is prepared having all the events and corresponding columns have the subroutine name that will be called on occurrence of the event.So same if performed for all events.

TOP_OF_PAGE event will call this subroutine.

form top_of_page.

call function 'REUSE_ALV_COMMENTARY_WRITE'

exporting

i_logo = 'ENJOYSAP_LOGO'

it_list_commentary = gt_list_top_of_page.

endform.

You have to call your function like this:

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

...

I_CALLBACK_PROGRAM = z_variant-report

(or your program name, not sy-repid because this will

change during the use of ALV Grid)

I_CALLBACK_USER_COMMAND = 'USER_COMMAND2'

(or some other name)

...

then you define your form:

form user_command2 using r_ucomm like sy-ucomm

rs_selfield type slis_selfield.

case r_ucomm.

when '&IC1'. (doubleclick)

if rs_selfield-tabindex > 0 and

rs_selfield-sumindex le 0.

read table itab into wa index

rs_selfield-tabindex.

perform second_grid.

endif.

endcase.

then your form for the second grid:

form second_grid.

(here you can make your selections for the second grid

based on the row you selected into workarea wa from the

first grid, and then call REUSE_ALV_GRID_DISPLAY again,

with another field catalog, internal table etc...)

endform.

good luck.

0 Kudos

Hi Kaushik

you told that it is basically used to get events used for processing of ALV.please tell me about events in ALV, what are the events used in alv.

Former Member
0 Kudos

Whenever u are using EVENTS in ALV u need to use this FM..

Wat this FM does is it fills up the table of events..there are 17 events dat r used in ALV...the actions that need 2 b done wen any of these events occur is written in a PERFORM and the name of this FORM is passed on to the event table in ALV..

This FM populates the events table which has 2 columns..

1.Event

2.Form Name.

and we specify that on which events which perform shud be called.

Accordingly as the events are triggered the respective actions(as specified in dat perform) get called.

Hope it helps...

Former Member
0 Kudos

FU REUSE_ALV_EVENTS_GET

Returns table of possible events for a list type

Functionality

This table can be passed to the ALV display module with the form name.

Parameters

I_LIST_TYPE

ET_EVENTS

Exceptions

LIST_TYPE_WRONG

Function Group

SALV