Skip to Content
avatar image
Former Member

Reg Alv End of list.

Hi sdns,

can anyone calrify my doubt please.

i am generating one ALv report. For this i dont have any problem. At end of the ALV report i need to display one or more reports for this wat i hav to do. I am thinking that i have to use END OF LIST. but i dnot know how to use this. .If u have any code regardin this. please give and help me.

Thank u very much.

Sirisha.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Aug 20, 2007 at 01:17 PM

    hi

    to use end of list event u have to call fm

    reuse_alv_events _get

    we get all the events in an internal table

    now loop throught that table and get the event..

    read table it_events withkey name = 'END_OF_LIST'.

    IF SY-SUBRC = 0.

    IT_EVENTS-FORM = 'FOOTER'. "name of the subroutine where u can write

    the relavent code...

    MODIFY IT_EVENTS INDEX SY-TABIX.

    ENDIF.

    HOPE IT HELPS U

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 20, 2007 at 01:24 PM

    Hi,

    please see this code.

    REPORT ZBHALV_LIST.

    TABLES:MARA.

    SELECT-OPTIONS: MATNR FOR MARA-MATNR.

    DATA:BEGIN OF ITAB OCCURS 0,

    MATNR LIKE MARA-MATNR,

    ERSDA LIKE MARA-ERSDA,

    MTART LIKE MARA-MTART,

    MBRSH LIKE MARA-MBRSH,

    END OF ITAB.

    SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE MATNR

    IN MATNR.

    TYPE-POOLS SLIS.

    DATA:FCAT TYPE slis_t_fieldcat_alv.

    DATA:LAYOUT TYPE slis_layout_alv.

    <b>DATA:EVE TYPE slis_t_event WITH HEADER LINE.

    DATA:HEAD TYPE slis_t_listheader WITH HEADER LINE.</b>

    DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.

    SORT-UP = 'X'.

    SORT-SPOS = 1.

    SORT-FIELDNAME = 'ERSDA'.

    SORT-tabname = 'MARA'.

    APPEND SORT.

    SORT-SPOS = 2.

    SORT-FIELDNAME = 'MTART'.

    SORT-tabname = 'MARA'.

    APPEND SORT.

    EVE-NAME = 'TOP_OF_PAGE'.

    EVE-FORM = 'TOPOFPAGE'.

    APPEND EVE.

    EVE-NAME = 'TOP_OF_LIST'.

    EVE-FORM = 'TOPOFLIST'.

    APPEND EVE.

    <b>EVE-NAME = 'END_OF_LIST'.

    EVE-FORM = 'ENDOFLIST'.

    APPEND EVE.</b>

    LAYOUT-ZEBRA = 'X'.

    LAYOUT-no_hline = 'X'.

    LAYOUT-NO_VLINE = 'X'.

    LAYOUT-window_titlebar = 'MATERIAL DETAILS'.

    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

    EXPORTING

    I_PROGRAM_NAME = SY-REPID

    I_INTERNAL_TABNAME = 'ITAB'

    • I_STRUCTURE_NAME =

    • I_CLIENT_NEVER_DISPLAY = 'X'

    I_INCLNAME = SY-REPID

    • I_BYPASSING_BUFFER =

    • I_BUFFER_ACTIVE =

    CHANGING

    CT_FIELDCAT = FCAT

    • EXCEPTIONS

    • INCONSISTENT_INTERFACE = 1

    • PROGRAM_ERROR = 2

    • OTHERS = 3

    .

    IF SY-SUBRC <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

    ENDIF.

    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

    EXPORTING

    • I_INTERFACE_CHECK = ' '

    • I_BYPASSING_BUFFER =

    • I_BUFFER_ACTIVE = ' '

    I_CALLBACK_PROGRAM = SY-REPID

    • I_CALLBACK_PF_STATUS_SET =

    • I_CALLBACK_USER_COMMAND =

    • I_STRUCTURE_NAME =

    IS_LAYOUT = LAYOUT

    IT_FIELDCAT = FCAT

    • IT_EXCLUDING =

    • IT_SPECIAL_GROUPS =

    IT_SORT = SORT[]

    • IT_FILTER =

    • IS_SEL_HIDE =

    • I_DEFAULT = 'X'

    • I_SAVE = ' '

    • IS_VARIANT =

    IT_EVENTS = <b>EVE[]</b>

    • IT_EVENT_EXIT =

    • IS_PRINT =

    • IS_REPREP_ID =

    • I_SCREEN_START_COLUMN = 5

    • I_SCREEN_START_LINE = 5

    • I_SCREEN_END_COLUMN = 120

    • I_SCREEN_END_LINE = 25

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER =

    • ES_EXIT_CAUSED_BY_USER =

    TABLES

    T_OUTTAB = ITAB

    • EXCEPTIONS

    • PROGRAM_ERROR = 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.

    FORM TOPOFPAGE.

    REFRESH HEAD.

    HEAD-TYP = 'H'.

    HEAD-INFO = 'MATERIALS'.

    APPEND HEAD.

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    IT_LIST_COMMENTARY = HEAD[]

    • I_LOGO =

    • I_END_OF_LIST_GRID =

    .

    ENDFORM.

    FORM TOPOFLIST.

    REFRESH HEAD.

    HEAD-TYP = 'H'.

    HEAD-INFO = 'MATERIALS-LISTTOP'.

    APPEND HEAD.

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    IT_LIST_COMMENTARY = HEAD[]

    • I_LOGO =

    • I_END_OF_LIST_GRID =

    .

    ENDFORM.

    <b>FORM ENDOFLIST.

    REFRESH HEAD.

    HEAD-TYP = 'H'.

    HEAD-INFO = 'MATERIALS-LISTEND'.

    APPEND HEAD.

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    IT_LIST_COMMENTARY = HEAD[]

    • I_LOGO =

    • I_END_OF_LIST_GRID =

    .

    ENDFORM.

    </b>

    <b>reward if helpful</b>

    rgds,

    bharat.

    Add comment
    10|10000 characters needed characters exceeded