Application Development and Automation 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: 
Read only

displaying header using alv oops

Former Member
0 Likes
1,566

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

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,133

any alternative solutions please

7 REPLIES 7
Read only

Former Member
0 Likes
1,133

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

Read only

Former Member
0 Likes
1,133

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 .

Read only

0 Likes
1,133

Thanks

Read only

0 Likes
1,133

Hi Logjie,

I have tried the code suggested by u..but its not working

Jack

Read only

Former Member
0 Likes
1,134

any alternative solutions please

Read only

0 Likes
1,133

Hello,

There is grid_title attribute in the layout of alv grid.

Give the grid name there.

Read only

Former Member
0 Likes
1,133

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 .