Skip to Content
0
Former Member
Apr 04, 2013 at 12:23 PM

heading in alv grid display

16 Views

HI,

in the below code when i give I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE ' ,heading is coming in list.but,when i populate the it_events table and pass it to grid display,heading is not displaying in list.

below is the code ,where i commented the i_callback_top_of_page ,and passed the it_events.

REPORT ZPH_REP_ALV.



TYPE-POOLS: SLIS .

DATA : IT_EVENTS TYPE slis_t_event ,

WA_EVENTS TYPE slis_alv_event ,

IT_EKKO TYPE TABLE OF EKKO ,

WA_EKKO LIKE LINE OF IT_EKKO ,

IT_CSKS TYPE TABLE OF CSKS ,

WA_CSKS LIKE LINE OF IT_CSKS ,

IT_EKPO TYPE TABLE OF EKPO ,

WA_EKPO LIKE LINE OF IT_EKPO ,

IT_T001 TYPE STANDARD TABLE OF T001 ,

WA_T001 LIKE LINE OF IT_T001 ,

IT_FIELDCAT TYPE TABLE OF slis_t_fieldcat_alv ,

LIST_LAYOUT TYPE slis_layout_alv .


START-OF-SELECTION .

SELECT * FROM CSKS INTO TABLE IT_CSKS UP TO 30 ROWS .


PERFORM FILL_EVENT_TABLE .

END-OF-SELECTION .


PERFORM DISPLAY_DATA .

*PERFORM PREPARE_HEADER .



*&---------------------------------------------------------------------*

*& Form DISPLAY_DATA

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* --> p1 text

* <-- p2 text

*----------------------------------------------------------------------*

form DISPLAY_DATA .



CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

* I_INTERFACE_CHECK = ' '

* I_BYPASSING_BUFFER = ' '

* I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = SY-CPROG

* I_CALLBACK_PF_STATUS_SET = ' '

* I_CALLBACK_USER_COMMAND = ' '

* I_CALLBACK_TOP_OF_PAGE = 'TOP_OF_PAGE '

* I_CALLBACK_HTML_TOP_OF_PAGE = ' '

* I_CALLBACK_HTML_END_OF_LIST = ' '

I_STRUCTURE_NAME = 'CSKS'

* I_BACKGROUND_ID = ' '

* I_GRID_TITLE =

* I_GRID_SETTINGS =

* IS_LAYOUT =

* IT_FIELDCAT =

* IT_EXCLUDING =

* IT_SPECIAL_GROUPS =

* IT_SORT =

* IT_FILTER =

* IS_SEL_HIDE =

* I_DEFAULT = 'X'

* I_SAVE = ' '

* IS_VARIANT =

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

* 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_CSKS

* EXCEPTIONS

* PROGRAM_ERROR = 1

* OTHERS = 2

.

IF sy-subrc <> 0.

* Implement suitable error handling here

ENDIF.


endform. " DISPLAY_DATA

*&---------------------------------------------------------------------*

*& Form FILL_EVENT_TABLE

*&---------------------------------------------------------------------*

* text

*----------------------------------------------------------------------*

* --> p1 text

* <-- p2 text

*----------------------------------------------------------------------*

form FILL_EVENT_TABLE .


WA_EVENTS-NAME = 'TOP-OF-PAGE' .

WA_EVENTS-FORM = 'PREPARE_HEADER' .

APPEND WA_EVENTS TO IT_EVENTS .

endform. " FILL_EVENT_TABLE


FORM PREPARE_HEADER.



DATA : IT_HEADINGS TYPE slis_t_listheader ,

WA_HEADINGS TYPE slis_listheader .

CLEAR WA_HEADINGS.



WA_HEADINGS-TYP = 'H' .

WA_HEADINGS-INFO = 'DISPLAY OF COST CENTERS ' .

APPEND WA_HEADINGS TO IT_HEADINGS .



CLEAR WA_HEADINGS .

WA_HEADINGS-TYP = 'S' .

WA_HEADINGS-INFO = 'USING ALV' .

APPEND WA_HEADINGS TO IT_HEADINGS .



CLEAR WA_HEADINGS .

WA_HEADINGS-TYP = 'A' .

CONCATENATE SY-DATUM+6(2)'.'

SY-DATUM+4(2)'.'

SY-DATUM(4)

INTO WA_HEADINGS-INFO .

APPEND WA_HEADINGS TO IT_HEADINGS .



CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = IT_HEADINGS

I_LOGO = 'ZLOGO1'

* I_END_OF_LIST_GRID =

* I_ALV_FORM =
.
ENDFORM .