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: 

heading is not displayed

Former Member
0 Kudos

hi,

I want to display heading in report, the heading box is coming but the heading info is not coming, i am posting my code here plz solve it.

TABLES : MARA,MAKT.

TYPE-POOLS: slis.

data process_data.

        • Selection Screen ******************

SELECTION-SCREEN BEGIN OF BLOCK b1.

SELECT-OPTIONS: s_matnr for mara-matnr.

SELECTION-SCREEN END OF BLOCK b1.

        • Selection Screen ******************

***Declaration of variables for ALV display ***

DATA: i_layout TYPE slis_layout_alv,

it_fieldcatalog TYPE slis_t_fieldcat_alv, "internal table for fieldcatalog

wa_fieldcatalog LIKE LINE OF it_fieldcatalog, "work area for fieldcatalog

  • i_heading TYPE slis_t_listheader,

i_events TYPE slis_t_event,

gt_events TYPE slis_t_event,

gv_repid LIKE sy-repid.

DATA: it_header TYPE slis_t_listheader,

wa_header TYPE slis_listheader.

TYPES : begin of ty_material,

matnr type mara-matnr,

maktx type makt-maktx,

end of ty_material.

DATA : it_material type standard table of ty_material,

wa_material type ty_material.

*Perform Routines

PERFORM process_data. "Fetch & Process Data

PERFORM prepare_fieldcatalog. "Prepares Field Catalog

PERFORM event_handling. "event handler

PERFORM display_grid. "Grid Display

form process_data.

select matnr

maktx

from makt

into table it_material

where matnr IN s_matnr.

ENDFORM.

&----


*& Form prepare_fieldcatalog

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form prepare_fieldcatalog .

CLEAR wa_fieldcatalog.

***Material number

wa_fieldcatalog-fieldname = 'MATNR'.

wa_fieldcatalog-seltext_l = text-001.

wa_fieldcatalog-hotspot = 'X'.

APPEND wa_fieldcatalog TO it_fieldcatalog.

      • Material descrption

CLEAR wa_fieldcatalog.

wa_fieldcatalog-fieldname = 'MAKTX'.

wa_fieldcatalog-seltext_l = text-002.

APPEND wa_fieldcatalog TO it_fieldcatalog.

endform. " prepare_fieldcatalog

&----


*& Form display_grid

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form display_grid .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = 'gv_repid'

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_CALLBACK_TOP_OF_PAGE = 'FM_TOP_OF_PAGE'

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

IS_LAYOUT = i_layout

IT_FIELDCAT = it_fieldcatalog

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = gt_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

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

t_outtab = it_material

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

endform. " display_grid

&----


*& Form event_handling

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form event_handling .

DATA: ls_event LIKE LINE OF i_events.

CLEAR ls_event.

ls_event-name = 'TOP_OF_PAGE'.

ls_event-form = 'FM_TOP_OF_PAGE'.

APPEND ls_event TO gt_events.

wa_header-typ = 'H'.

  • gt_header-key = 'Test'.

wa_header-info = 'Material info'.

APPEND wa_header to it_header.

endform. " event_handling

&----


*& Form FM_TOP_OF_PAGE

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


form FM_TOP_OF_PAGE .

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. " FM_TOP_OF_PAGE

1 REPLY 1

MarcinPciak
Active Contributor
0 Kudos

Hi,

You need to pass your it_header to FM REUSE_ALV_COMMENTARY_WRITE.


FORM top_of_page.
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
     EXPORTING
          i_logo             = 'ENJOYSAP_LOGO'
          it_list_commentary = it_header.
ENDFORM.                   

Please remove also this code, as it is not necessary:

CLEAR ls_event.

ls_event-name = 'TOP_OF_PAGE'.

ls_event-form = 'FM_TOP_OF_PAGE'.

APPEND ls_event TO gt_events.

Regards

M.

Edited by: Marcin Pciak on Dec 10, 2008 1:44 PM