Skip to Content
1
Former Member
Sep 03, 2012 at 06:34 AM

How to create TOP OF PAGE in CL_SALV_TABLE (IN CALL SCREEN 100)

3066 Views

Hi

How to display top_of_page in cl_salv_table while using call screen

sample is code of mine below, please help.

CLASS LCL_HANDLE_EVENTS DEFINITION.

Methods: ON_TOP_OF_PAGE FOR EVENT TOP_OF_PAGE OF CL_SALV_EVENTS_TABLE
IMPORTING r_top_of_page page table_index . " Set Top of page

endclass

CLASS LCL_HANDLE_EVENTS implementation.

METHOD ON_TOP_OF_PAGE.
ENDMETHOD.

endclass

MODULE PBO_100 OUTPUT.

PERFORM SET_STATUS_FOR_CHECKBOX.

SET PF-STATUS 'MAIN100'.

IF G_CUSTOM_CONTAINER IS INITIAL.
CREATE OBJECT G_CUSTOM_CONTAINER
EXPORTING
CONTAINER_NAME = G_CONTAINER.


TRY.
CALL METHOD CL_SALV_TABLE=>FACTORY(
EXPORTING
* LIST_DISPLAY = IF_SALV_C_BOOL_SAP=>FALSE
R_CONTAINER = G_CUSTOM_CONTAINER
* CONTAINER_NAME =
IMPORTING
R_SALV_TABLE = O_ALV
CHANGING
T_TABLE = IT_DATA ).
CATCH CX_SALV_MSG INTO LX_MSG.
ENDTRY.
LR_EVENTS = O_ALV->GET_EVENT( ).

LR_COLUMNS = O_ALV->GET_COLUMNS( ).
LR_COLUMNS->SET_OPTIMIZE( 'X' ).

TRY.
LR_COLUMN ?= LR_COLUMNS->GET_COLUMN( 'CHECKBOX' ).
LR_COLUMN->SET_F4( IF_SALV_C_BOOL_SAP=>TRUE ).
LR_COLUMN->SET_CELL_TYPE( IF_SALV_C_CELL_TYPE=>CHECKBOX_HOTSPOT ).
LR_COLUMN->SET_LONG_TEXT( 'CHECKBOX' ).
LR_COLUMN->SET_OUTPUT_LENGTH( 10 ).
CATCH CX_SALV_NOT_FOUND.
ENDTRY.


CALL METHOD O_ALV->GET_FUNCTIONS
RECEIVING
VALUE = LR_FUNCTION.
LR_FUNCTION->SET_ALL( 'X' ).

LR_FUNCTION->SET_VIEW_LOTUS( ' ' ).
********************TOP OF PAGE*

PERFORM built_header CHANGING lr_content.
o_alv->set_top_of_list( lr_content ).


********************TOP OF PAGE*

***********check box editable
CREATE OBJECT GR_EVENTS.

SET HANDLER GR_EVENTS->ON_DOUBLE_CLICK FOR LR_EVENTS.

SET HANDLER GR_EVENTS->ON_LINK_CLICK FOR LR_EVENTS.
SET HANDLER GR_EVENTS->ON_TOP_OF_PAGE FOR LR_EVENTS.


O_ALV->DISPLAY( ).
ENDIF.

endloop.