REPORT Z_DOCKING_ALV.
DATA: L_DOCKING TYPE REF TO CL_GUI_DOCKING_CONTAINER,
L_ALV TYPE REF TO CL_GUI_ALV_GRID ,
LT_MARA TYPE TABLE OF MARA ,
INIT(1),
IT_EXCLUDE TYPE TABLE OF SY-UCOMM.
PARAMETERS:P_COUNT TYPE I DEFAULT 10.
AT SELECTION-SCREEN OUTPUT.
IF INIT IS INITIAL.
INIT = 'X'.
APPEND 'ONLI' TO IT_EXCLUDE.
CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
EXPORTING
P_STATUS = SY-PFKEY
TABLES
P_EXCLUDE = IT_EXCLUDE.
ENDIF.
IF L_DOCKING IS INITIAL .
CREATE OBJECT L_DOCKING
EXPORTING
REPID = SY-REPID
DYNNR = SY-DYNNR
SIDE = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_BOTTOM
EXTENSION = '300'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5.
ENDIF .
SELECT * FROM MARA INTO TABLE LT_MARA UP TO P_COUNT ROWS.
IF L_ALV IS INITIAL.
CREATE OBJECT L_ALV
EXPORTING
I_PARENT = L_DOCKING.
CALL METHOD L_ALV->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'MARA'
CHANGING
IT_OUTTAB = LT_MARA.
ELSE.
CALL METHOD L_ALV->REFRESH_TABLE_DISPLAY.
ENDIF.
阅读(840) | 评论(0) | 转发(0) |