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: 

paramters of subroutine for ALV events.

Former Member
0 Kudos
389

Hi all,

While we are using the FM <b>REUSE_ALV_GRID_DISLAY</b> we will give the intenal table name for the parameter <b>IT_EVENTS</b>. At that time we will mention the subroutine name for each event.What are the total parameters that are passed to each subroutine for each event.If any body have the list please let me know.

sathish

5 REPLIES 5

Former Member
0 Kudos
90

events in ALV

1 CALLER_EXIT

2 USER_COMMAND

3 TOP_OF_PAGE

4 TOP_OF_COVERPAGE

5 END_OF_COVERPAGE

6 FOREIGN_TOP_OF_PAGE

7 FOREIGN_END_OF_PAGE

8 PF_STATUS_SET

9 LIST_MODIFY

10 TOP_OF_LIST

11 END_OF_PAGE

12 END_OF_LIST

13 AFTER_LINE_OUTPUT

14 BEFORE_LINE_OUTPUT

15 REPREP_SEL_MODIFY

16 SUBTOTAL_TEXT

17 GROUPLEVEL_CHANGE

for each of these events,if you give any FORM name,that will be executed,else that event will be ignored.

we need to pass any values to that FORM routine. just form name is enough.

here is the part of the code, for your understanding.

FORM SET_EVENTS .
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
            I_LIST_TYPE     = 0
       IMPORTING
            ET_EVENTS       = IT_EVENTS
       EXCEPTIONS
            LIST_TYPE_WRONG = 1
            OTHERS          = 2.
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

*--Text To be displayed at TOP OF LIST
  CLEAR WA_EVENT.
  READ TABLE IT_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_LIST'.
<b>  WA_EVENT-FORM = 'HEADER'.
  MODIFY IT_EVENTS FROM WA_EVENT INDEX SY-TABIX.</b>
*--Text To be displayed at END OF LIST
  CLEAR WA_EVENT.
  READ TABLE IT_EVENTS INTO WA_EVENT WITH KEY NAME = 'END_OF_LIST'.
 <b> WA_EVENT-FORM = 'FOOTER'.
  MODIFY IT_EVENTS FROM WA_EVENT INDEX SY-TABIX.</b>

ENDFORM.                    " SET_EVENTS

*&---------------------------------------------------------------------*
*&      Form  HEADER
*&---------------------------------------------------------------------*
*       text : Text to be displyed at the TOP OF LIST
*----------------------------------------------------------------------*
<b>FORM HEADER .</b>
*-- standard top of page
write your header text
ENDFORM.                    " HEADER

*&---------------------------------------------------------------------*
*&      Form  FOOTER
*&---------------------------------------------------------------------*
*       text :Text to be displyed at the END OF LIST
*----------------------------------------------------------------------*
<b>FORM FOOTER .</b>
*-- Standard end of report
write your footer text
ENDFORM.                    " FOOTER

Regards

srikanth

Message was edited by: Srikanth Kidambi

Former Member
0 Kudos
90

can you show ur code where you are passing parameters ?

generally for the events of REUSE_ALV_GRID_DISPLAY there are no standard parameters passed for the FORMS of the events i guess ,

when we are using CL_GUI_ALV_GRID we pass the parameters for the methods

Former Member
0 Kudos
90

HI

good

go through this example and use accordingly,

&----


*& Form f100-end_of_page

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM f100-end_of_page.

clear: wa_listheader, it_end_listheader, it_end_listheader[].

concatenate 'Date' sy-datum into w_date separated by space.

wa_listheader-key = ''.

wa_listheader-typ = 'S'.

wa_listheader-info = 'Date'.

append wa_listheader to it_end_listheader.

clear: wa_listheader.

concatenate 'Time' sy-uzeit into w_date separated by space.

wa_listheader-key = ''.

wa_listheader-typ = 'S'.

wa_listheader-info = 'Time'.

append wa_listheader to it_end_listheader.

clear: wa_listheader.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = it_end_listheader[]

  • I_LOGO =

  • I_END_OF_LIST_GRID =

.

ENDFORM. " f100-end_of_page

-


In grid display there will be no end_of_page and no end_of_list.

You have show in top_of_page itself.

Otherwise use list display instead of grid.

Suresh Avutu

-


These steps have to be carried out...

DATA: gc_formname_top_of_page TYPE slis_formname

VALUE 'TOP_OF_PAGE'.

DATA: gc_formname_end_of_page TYPE slis_formname

VALUE 'END_OF_PAGE'.

DATA: gt_list_top_of_page TYPE slis_t_listheader.

DATA: gt_list_end_of_page TYPE slis_t_listheader.

-


PERFORM e03_eventtab_build USING gt_event[].

PERFORM e04_comment_build USING

gt_list_top_of_page[].

PERFORM e06_comment_build USING

gt_list_end_of_page[].

PERFORM list_alv_display.

-


FORM list_alv_display .

gt_event-name = slis_ev_top_of_list.

gt_event-form = 'TOP_OF_PAGE'.

APPEND gt_event.

gt_event-name = slis_ev_end_of_list.

gt_event-form = 'END_OF_PAGE'.

APPEND gt_event.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

i_bypassing_buffer = 'X'

i_buffer_active = ' '

i_callback_program = ....

-


FORM end_of_page.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

i_logo = ''

it_list_commentary = gt_list_end_of_page

I_END_OF_LIST_GRID = 1.

ENDFORM. "END_OF_PAGE

-


FORM e06_comment_build

USING e06_lt_end_of_page TYPE slis_t_listheader.

DATA: ls_line TYPE slis_listheader.

DATA: yl_uname(60).

< here u can concatenate system date and time to

yl_uname>

CLEAR ls_line.

ls_line-typ = 'S'.

ls_line-info = yl_uname.

APPEND ls_line TO e06_lt_end_of_page.

endform. "e06_comment_build

Suman Tyagi

-


An Example:

REPORT ZALV_GRID.

TABLES :vbap.

type-pools : slis.

data i_events TYPE slis_t_event.

DATA : my_alv TYPE REF TO cl_gui_alv_grid.

TYPES : BEGIN OF itab,

vbeln LIKE vbap-vbeln,

arktx LIKE vbap-arktx,

END OF itab.

TYPES : itab1 TYPE TABLE OF itab.

DATA : display TYPE itab1.

DATA : fcat TYPE SLIS_T_FIELDCAT_ALV.

DATA : wa LIKE LINE OF FCAT.

DATA WA1 LIKE VBAP.

DATA: container TYPE REF TO cl_gui_custom_container.

data report_id like sy-repid.

SELECT-OPTIONS s_vbeln FOR vbap-vbeln.

report_id = sy-repid.

SELECT * FROM vbap INTO CORRESPONDING FIELDS OF TABLE display WHERE

vbeln IN s_vbeln.

wa-fieldname = 'VBELN'.

wa-tabname = 'VBAP'.

wa-key = 'X'.

WA-HOTSPOT = 'X'.

wa-text_fieldname = 'Doc no.'.

APPEND wa TO fcat.

CLEAR wa.

wa-fieldname = 'ARKTX'.

wa-tabname = 'VBAP'.

wa-text_fieldname = 'Item Text'.

APPEND wa TO fcat.

PERFORM f0650_build_event USING 'USER_COMMAND'

'F0750_USER_COMMAND'.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY '

EXPORTING

I_CALLBACK_PROGRAM = report_id

IT_FIELDCAT = FCAT

IT_EVENTS = i_events

TABLES

t_outtab = DISPLAY

.

FORM f0650_build_event USING value(w_c_event_name)

value(w_c_event_form).

DATA: f0650_wa_event TYPE slis_alv_event.

CLEAR f0650_wa_event.

f0650_wa_event-name = w_c_event_name.

f0650_wa_event-form = w_c_event_form.

APPEND f0650_wa_event TO i_events.

ENDFORM.

FORM f0750_user_command USING w_ucomm TYPE sy-ucomm

w_selfield TYPE slis_selfield.

CASE w_ucomm.

WHEN '&IC1'.

READ TABLE DISPLAY INTO WA1 INDEX w_selfield-tabindex.

  • MESSAGE E000 WITH

  • ' You have no authorization to view the report'.

call transaction 'SE11'.

ENDCASE.

ENDFORM.

thanks

mrutyun^

Former Member
0 Kudos
90

Thanq all fou your answers.

But I need some more clarification. Whenever we are using the event USER_COMMAND we will pass the parameters sy-ucomm and slis_selfield. Like this what are the other parameters we can pass.For each event what are the total parameters we can pass.How can we know these standard parameters.

Sathish.

0 Kudos
90

Hi sathish,

1. Most events, do not have any

parameters,

however some have.

2. We can get this from the documentation

of the FM, under the paramter EVENTS.

3. (from documentation)

4.

TOP_OF_LIST no USING parameter

Information output at the start of the list

END_OF_LIST no USING parameter

Information output at the end of the list

TOP_OF_PAGE no USING parameter

Equivalent to the list processing TOP-OF-PAGE event

END_OF_PAGE no USING parameter

Not available for hierarchical-sequential lists.

Information output at the end of a page. This is only called for printing.

TOP_OF_COVERPAGE no USING parameter

The selection information and list status are output together (if they exist) on a separate page by default. See also the documentation of the parameters:

IS_PRINT-NO_COVERPAGE

IS_PRINT-NO_PRINT_SELINFOS

IS_PRINT-NO_PRINT_LISTINFOS

IS_LAYOUT-GET_SELINFOS

The user can format the header area of the 'cover page' himself or herself by specifying a Callback routine for this event.

END_OF_COVERPAGE no USING parameter

Analogously to TOP_OF_COVERPAGE the user can add other information to the information output by ALV (selection information, list status) at this event.

FOREIGN_TOP_OF_PAGE no USING parameter

The Top-of-page event is always processed in ALV and is only passed to the caller via the Callback mechanism. This is still the case if the caller, e.g. by a user action, processes a branch list which was not formatted by ALV (e.g. a popup with additional information about the list record selected and displayed by ALV).

In this case, top-of-page cannot be formatted by ALV analogously to the basic list, it must be handled completely by the caller. The event top-of-page still occurs in ALV. When ALV notices a top-of-page which was not caused by an ALV output, the form routine in FOREIGN_TOP_OF_PAGE is called.

FOREIGN_END_OF_PAGE no USING parameter

The event end-of-page is always processed in ALV and only passed to the caller via callback. This is still the case, e.g. when the caller processes a details list which was not formatted by ALV (e.g. a popup with further information about selected list records which were displayed by ALV).

In this case, end-of-page cannot be formatted by ALV analogously to the basic list, it must be handled completely by the caller. The event end-of-page still occurs in ALV. When ALV notices an end-of-page that was not caused by an ALV output, the form routine in FOREIGN_END_OF_PAGE is called.

<b>BEFORE_LINE_OUTPUT USING RS_LINEINFO TYPE SLIS_LINEINFO</b>

Output information before each output line. Should only be used in justified cases because it costs a lot of performance.

<b>AFTER_LINE_OUTPUT USING RS_LINEINFO TYPE SLIS_LINEINFO</b>

Output information after each output line. Should only be used in justified cases because it costs a lot of performance.

regards,

amit m.