Types Begin of Type Type Type End of Data Type Standard Table of Data Type Ref To Type Ref To Data Type Type Parameters Type
Types Begin of Type Type Type End of Data Type Standard Table of Data Type Ref To Type Ref To Data Type Type Parameters Type
Types Begin of Type Type Type End of Data Type Standard Table of Data Type Ref To Type Ref To Data Type Type Parameters Type
*& Report ZMR_OOALV_CUSTOMCONT
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
REPORT ZMR_OOALV_DOCKINGCONT.
types : begin of ty_ekko,
ebeln type ebeln,
bukrs type bukrs,
aedat type aedat,
end of ty_ekko.
data : lt_ekko type STANDARD TABLE OF ty_ekko. "ekko.
DATA : LR_DOCK TYPE REF TO CL_GUI_DOCKING_CONTAINER,
LR_ALV TYPE REF TO CL_GUI_ALV_GRID.
data : lt_fldcat type lvc_t_fcat,
wa_fldcat type lvc_s_fcat.
PARAMETERS : p_lifnr type lifnr.
START-OF-SELECTION.
select ebeln bukrs aedat from ekko into TABLE lt_ekko where lifnr = p_lifnr.
if sy-subrc = 0.
call screen 9000.
else.
endif.
*&---------------------------------------------------------------------*
*& Module STATUS_9000 OUTPUT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
MODULE STATUS_9000 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
* CREATE OBJECT FOR DOCKING CONTINER
CREATE OBJECT LR_DOCK
EXPORTING
SIDE = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_RIGHT " C
ONSTANT
EXTENSION = 500
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
others = 6.
IF LR_dock IS NOT INITIAL.
* CREATE OBJECT FOR ALV GRID.
CREATE OBJECT LR_ALV
EXPORTING
I_PARENT = LR_dock "DOCKING CONTAINER OBJECT
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
others = 5.
IF LR_ALV IS NOT INITIAL. "IS BOUND
* Prepare field catalog.
wa_fldcat-COL_POS = 1.
wa_fldcat-FIELDNAME = 'EBELN'.
wa_fldcat-TABNAME = 'LT_EKKO'.
wa_fldcat-SCRTEXT_S = 'Pur Ord'.
wa_fldcat-SCRTEXT_m = 'Purchase Ord'.
wa_fldcat-SCRTEXT_l = 'Purchase Order'.
append wa_fldcat to lt_fldcat.
clear wa_fldcat.
wa_fldcat-COL_POS = 2.
wa_fldcat-FIELDNAME = 'AEDAT'.
wa_fldcat-TABNAME = 'LT_EKKO'.
wa_fldcat-REF_FIELD = 'AEDAT'.
WA_FLDCAT-REF_TABLE = 'EKKO'.
append wa_fldcat to lt_fldcat.
clear wa_fldcat.
wa_fldcat-COL_POS = 3.
wa_fldcat-FIELDNAME = 'BUKRS'.
wa_fldcat-TABNAME = 'LT_EKKO'.
wa_fldcat-REF_FIELD = 'BUKRS'.
WA_FLDCAT-REF_TABLE = 'T001'.
append wa_fldcat to lt_fldcat.
clear wa_fldcat.
* CALL METHOD SET TABLE FOR FIRST DISPLAY
CALL METHOD LR_ALV->SET_TABLE_FOR_FIRST_DISPLAY
CHANGING
IT_OUTTAB = LT_EKKO
IT_FIELDCATALOG = LT_FLDCAT
EXCEPTIONS
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
others = 4
.
ENDIF.
ENDIF.
ENDMODULE. " STATUS_9000 OUTPUT