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 + event

Former Member
0 Kudos
127

Hiii

know how to use event in alv but i would like some explantion concerning there FM below

 
*i call this FM after setting the title but what is it's purpose???
 APPEND lwa_headerpage TO li_headerpage.
 CLEAR lwa_headerpage.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

* What it the porpose of this FM and explain more about i_event table how come we are importing the i_event in a FM that is empty can't we just skip the  'REUSE_ALV_EVENTS_GET' and put directly the read from i_event then append????

  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type     = 0
    IMPORTING
      et_events       = i_event
    EXCEPTIONS
      list_type_wrong = 1
      error_message   = 2
      OTHERS          = 3.
  IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  CLEAR lwa_event.
  READ TABLE i_event INTO lwa_event
                     WITH KEY name =  slis_ev_top_of_page.
  IF sy-subrc EQ 0.
    MOVE c_topofpage TO lwa_event-form.
    APPEND lwa_event TO i_event.
  ENDIF.

1 ACCEPTED SOLUTION

former_member188685
Active Contributor
0 Kudos
75

*i call this FM after setting the title but what is it's purpose???

*The function purpose is to write the Content in the TOP OF PAGE .
in Grid it is not possible to write the write statements in the top of page event, for that reason we populate the comment table and pass it to the FM in the top_of_page event

APPEND lwa_headerpage TO li_headerpage.

CLEAR lwa_headerpage.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

*What it the porpose of this FM and explain more about *i_event table how come we are importing the i_event in a FM *that is empty can't we just skip *the 'REUSE_ALV_EVENTS_GET' and put directly the read *from i_event then append????

It used to get all the available events in ALV. what ever the event you want you can add the form name to that entry in the event table.

yes you can directly populate the events required for your program instead of calling it.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = i_event

EXCEPTIONS

list_type_wrong = 1

error_message = 2

OTHERS = 3.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CLEAR lwa_event.

READ TABLE i_event INTO lwa_event

WITH KEY name = slis_ev_top_of_page.

IF sy-subrc EQ 0.

MOVE c_topofpage TO lwa_event-form.

APPEND lwa_event TO i_event.

ENDIF.

8 REPLIES 8

Former Member
0 Kudos
75

hi

SLIS_EV_ITEM_DATA_EXPAND

SLIS_EV_REPREP_SEL_MODIFY

SLIS_EV_CALLER_EXIT_AT_START

SLIS_EV_USER_COMMAND

SLIS_EV_TOP_OF_PAGE

SLIS_EV_TOP_OF_COVERPAGE

SLIS_EV_END_OF_COVERPAGE

SLIS_EV_FOREIGN_TOP_OF_PAGE

SLIS_EV_FOREIGN_END_OF_PAGE

SLIS_EV_PF_STATUS_SET

SLIS_EV_LIST_MODIFY

SLIS_EV_TOP_OF_LIST

SLIS_EV_END_OF_PAGE

SLIS_EV_END_OF_LIST

SLIS_EV_AFTER_LINE_OUTPUT

SLIS_EV_BEFORE_LINE_OUTPUT

SLIS_EV_SUBTOTAL_TEXT

These are all the ALV Events.

http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_events.htm

Cheers

Snehi

Former Member
0 Kudos
75

hiiii

this function module is used to displaying some information on the ALV header.Title is display then this.This function module is used when you want to display some info.like date Time Username or discription on to the ALV grid.we use it like below.

Move:
    'Discription' to i_header-key,
    'Extraction Progarm' to i_header-info.
     APPEND i_header.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
       EXPORTING
           it_list_commentary = i_header[].

regards

twinkal

former_member188685
Active Contributor
0 Kudos
76

*i call this FM after setting the title but what is it's purpose???

*The function purpose is to write the Content in the TOP OF PAGE .
in Grid it is not possible to write the write statements in the top of page event, for that reason we populate the comment table and pass it to the FM in the top_of_page event

APPEND lwa_headerpage TO li_headerpage.

CLEAR lwa_headerpage.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

*What it the porpose of this FM and explain more about *i_event table how come we are importing the i_event in a FM *that is empty can't we just skip *the 'REUSE_ALV_EVENTS_GET' and put directly the read *from i_event then append????

It used to get all the available events in ALV. what ever the event you want you can add the form name to that entry in the event table.

yes you can directly populate the events required for your program instead of calling it.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = i_event

EXCEPTIONS

list_type_wrong = 1

error_message = 2

OTHERS = 3.

IF sy-subrc NE 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

CLEAR lwa_event.

READ TABLE i_event INTO lwa_event

WITH KEY name = slis_ev_top_of_page.

IF sy-subrc EQ 0.

MOVE c_topofpage TO lwa_event-form.

APPEND lwa_event TO i_event.

ENDIF.

0 Kudos
75

What is the difference when we my user command in the event and what if we put it in the i_callback_user_command = c_usercommand when calling the ALV display???

0 Kudos
75

What is the difference when we my user command in the event and what if we put it in the i_callback_user_command = c_usercommand when calling the ALV display???

Both are same ,if you want to handle usercommand event then

you can give the i_callback_user_command parameter and implement the subroutine. in this case no need to pass the events table to it_events.

only you can do that for pf-status, usercommand, top_of_page.

some events you have to populate the events table and pass it to it_events.

Former Member
0 Kudos
75

Former Member
0 Kudos
75

you need to setup the IT_EVENTS option of the ALV function module by calling the REUSE_ALV_EVENTS_GET

please advise what does this means?

Former Member
0 Kudos
75

use data toolbar like std_button

APPEND toolbar TO e_object->mt_toolbar.

MOVE object TO ls_toolbar-icon.

hope u got what i wanted to say yet u can check std_button for more details