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: 

top of page in alv

Former Member
0 Kudos

HI All

I am displaying some data in the header at the top of page event of ALV.

such as below:

New Item(button)

Warehouse No. ____

Storage Type._____

and below is the standard alv list.

how to do ?

7 REPLIES 7

Former Member
0 Kudos

HI

You can put ur requiremnt in the TOP-OF-PAGE event.

or else you can pass them as a variable(title) to your FM REUSE_ALV_GRID_DISPLAY.

I think the 1st options best suits your requiremnt

Regards

winnie

Former Member
0 Kudos

Hi,

Use the Events in the ALV FM check out the SLIS type pool,

Populate that table and try out.

Pls search SDN for more on this as there are many thread.

Regards

Lekha

Former Member
0 Kudos

Hi hongtan ,

If you are using ALV Grid, you can use the function module "REUSE_ALV_COMMENTARY_WRITE".

You need to fill the parameters for this function module and call this in the top-of-page event.

Before that you need to register it in the EVENTS table that wil be passed on to the ALV function module.

If you are using ALV LIST, you can directly use WRITE statements to display the header. These write statements will be in the top-of-page event.

If you need examples - you can search for ALV in sdn. You would get so many....

Best Regards,

Ram.

0 Kudos

Yes,I am using the TOP_OF_PAGE envent in ALV Grid

Former Member
0 Kudos

Hi,

Follow the link below :

[Top of Page in ALV|https://www.sdn.sap.com/irj/sdn/advancedsearch?query=topofpageinALV&cat=sdn_all]

Regards,

Swapna.

Former Member
0 Kudos

Hi,

refer to the following code:

TOP-OF-PAGE.

WRITE:/ 'Requester: ', sy-uname,

100 'Page: ', sy-pagno,

/ 'Program:', sy-repid,

100 'Date: ', sy-datum.

SKIP 3.

WRITE:/45 'Title: ', sy-title.

SKIP 3.

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 = 'USER_COMMAND'

  • I_STRUCTURE_NAME =

  • IS_LAYOUT = wa_layout

it_fieldcat = i_fieldcat

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = 'X'

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IR_SALV_LIST_ADAPTER =

  • IT_EXCEPT_QINFO =

  • I_SUPPRESS_EMPTY_DATA = ABAP_FALSE

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = it_vbap[]

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

hope it will help you.

Thanks

Rajesh Kumar

Mohamed_Mukhtar
Active Contributor
0 Kudos

hi



DATA : wa_header TYPE slis_listheader,  "----------> list header in top of page
           it_header TYPE slis_t_listheader.


DATA : wa_event TYPE slis_alv_event,  "------->  work area for the event topofpage
           it_event TYPE slis_t_event.


start-of-selection.

wa_event-name = 'TOP_OF_PAGE'.
  wa_event-form = 'TOP_VENDOR'.
  APPEND wa_event TO it_event.

" Use function module REUSE_ALV_GRID_DISPLAY

Pass this event parameter


 form TOP_VENDOR.
REFRESH it_header.

  wa_header-typ = 'H'.
  wa_header-info = 'VENDOR MASTER DETAILS'.
  APPEND wa_header TO it_header.

  wa_header-typ = 'S'.
  wa_header-key = 'VENDOR N'(001).
  wa_header-info = p_lifnr.
  APPEND wa_header TO it_header.

  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary       = it_header
     i_logo                   = 'ENJOYSAP_LOGO'
*   I_END_OF_LIST_GRID       =
*   I_ALV_FORM               =
            .
endform. "TOP_VENDOR

Regards.