2010 Jan 28 7:40 AM
Hi all,
greetings!!!
am displaying output data using alv oops ..,
but am unable to display header ...
kindly advise me the solutions to display header using alv oops.
pleasee..
Thanks
Jack
2010 Jan 28 10:49 AM
Hi all,
greetings!!!
am displaying output data using alv oops ..,
but am unable to display header ...
kindly advise me the solutions to display header using alv oops.
pleasee..
Thanks
Jack
2010 Jan 28 8:05 AM
Hi,
Which header do you mean?
If you have passed everything properly in the fieldcatalog the header should come properly.
Could you be more specific?
Regards,
Ankur Parab
2010 Jan 28 8:21 AM
you had to user TOP_OF_PAGE to display ALV header .
①create event class like below
CLASS LCL_EVENT_RECEIVER DEFINITION.
PUBLIC SECTION.
METHODS: HANDLE_TOP_OF_PAGE
FOR EVENT TOP_OF_PAGE OF CL_GUI_ALV_GRID
IMPORTING
E_DYNDOC_ID
TABLE_INDEX ,
ENDCALSS .
CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
METHOD HANDLE_TOP_OF_PAGE .
PERFORM EVENT_TOP_OF_PAGE USING E_DYNDOC_ID
TABLE_INDEX .
ENDMETHOD.
ENDCALSS .
②set event handle for display alv object
IF OBJ_EVENT_RECEIVER IS INITIAL .
CREATE OBJECT OBJ_EVENT_RECEIVER.
ENDIF .
SET HANDLER :
OBJ_EVENT_RECEIVER->HANDLE_TOP_OF_PAGE FOR GRID1 .
※grid1 is display ALV object
③ trigger top_of_event (for this step must be after the ALV method SET_TABLE_FOR_FIRST_DISPLAY)
CALL METHOD GRID1->LIST_PROCESSING_EVENTS
EXPORTING
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = OBJ_DYNDOC_ID
I_TABLE_INDEX = 1
※ OBJ_DYNDOC_ID is top_of_page contents that you can edit .
④edit header for top_of_page display
at hear create form for top_of_page contents like below
FORM EVENT_TOP_OF_PAGE USING IM_OBJ_DYNDOC_ID TYPE REF TO CL_DD_DOCUMENT
IM_TABLE_INDEX TYPE SYINDEX .
"1 .at this form use class CL_DD_DOCUMENT's method ADD_TEXT, NEW_LINE .
CALL METHOD I_OBJ_DYNDOC_ID->ADD_TEXT
EXPORTING
TEXT = 'Top_of_page'
SAP_STYLE = CL_DD_AREA=>HEADING
SAP_FONTSIZE = CL_DD_AREA=>EXTRA_LARGE
SAP_COLOR = CL_DD_AREA=>LIST_HEADING_INT.
"2 .create a customer container for display CL_DD_DOCUMENT
if OBJ_HTML_CNTRL is initial .
CREATE OBJECT OBJ_HTML_CNTRL
EXPORTING
PARENT = 'customer_container'.
endif .
CALL METHOD IM_OBJ_DYNDOC_ID->MERGE_DOCUMENT.
CALL METHOD IM_OBJ_DYNDOC_ID->DISPLAY_DOCUMENT
EXPORTING
REUSE_CONTROL = 'X'
PARENT = OBJ_HTML_CNTRL
EXCEPTIONS
HTML_DISPLAY_ERROR = 1.
ENDFORM .
2010 Jan 28 8:40 AM
2010 Jan 28 8:47 AM
Hi Logjie,
I have tried the code suggested by u..but its not working
Jack
2010 Jan 28 10:49 AM
2010 Jan 29 5:57 AM
Hello,
There is grid_title attribute in the layout of alv grid.
Give the grid name there.
2010 Jan 29 1:30 AM
hi jack .
can you give me more information for your code . i tried my source code . it's works fine .
one more question,
did you create custom container at the SE51 for display top of page .it's different to main ALV container .
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |