CLASS HANDLE_EVENT DEFINITION.
PUBLIC SECTION.
CLASS-METHODS : HANDLE_TOP_PAGE FOR EVENT TOP_OF_PAGE
OF CL_GUI_ALV_GRID IMPORTING E_DYNDOC_ID TABLE_INDEX.
ENDCLASS.
PUBLIC SECTION.
CLASS-METHODS : HANDLE_TOP_PAGE FOR EVENT TOP_OF_PAGE
OF CL_GUI_ALV_GRID IMPORTING E_DYNDOC_ID TABLE_INDEX.
ENDCLASS.
DATA : IT_MARA TYPE TABLE OF MARA,
WA_MARA TYPE MARA,
O_CUST TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
O_SPLI TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
O_REF1 TYPE REF TO CL_GUI_CONTAINER,
O_REF2 TYPE REF TO CL_GUI_CONTAINER,
O_ALV TYPE REF TO CL_GUI_ALV_GRID,
O_DOCU TYPE REF TO CL_DD_DOCUMENT.
WA_MARA TYPE MARA,
O_CUST TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
O_SPLI TYPE REF TO CL_GUI_SPLITTER_CONTAINER,
O_REF1 TYPE REF TO CL_GUI_CONTAINER,
O_REF2 TYPE REF TO CL_GUI_CONTAINER,
O_ALV TYPE REF TO CL_GUI_ALV_GRID,
O_DOCU TYPE REF TO CL_DD_DOCUMENT.
CLASS HANDLE_EVENT IMPLEMENTATION.
METHOD HANDLE_TOP_PAGE.
DATA :TEXT TYPE SDYDO_TEXT_ELEMENT.
TEXT = 'THIS IS MATERIAL HEADER DATA'.
call method O_DOCU->ADD_TEXT
exporting
TEXT = TEXT
* TEXT_TABLE =
* FIX_LINES =
* SAP_STYLE =
SAP_COLOR = CL_DD_DOCUMENT=>LIST_POSITIVE
SAP_FONTSIZE = CL_DD_DOCUMENT=>LARGE
METHOD HANDLE_TOP_PAGE.
DATA :TEXT TYPE SDYDO_TEXT_ELEMENT.
TEXT = 'THIS IS MATERIAL HEADER DATA'.
call method O_DOCU->ADD_TEXT
exporting
TEXT = TEXT
* TEXT_TABLE =
* FIX_LINES =
* SAP_STYLE =
SAP_COLOR = CL_DD_DOCUMENT=>LIST_POSITIVE
SAP_FONTSIZE = CL_DD_DOCUMENT=>LARGE
call method O_DOCU->ADD_PICTURE
exporting
PICTURE_ID = 'SAPLOGO1'
* WIDTH =
* ALTERNATIVE_TEXT =
* TABINDEX =
.
call method O_DOCU->DISPLAY_DOCUMENT
exporting
* REUSE_CONTROL =
* REUSE_REGISTRATION =
* CONTAINER =
PARENT = O_REF1
exceptions
HTML_DISPLAY_ERROR = 1
OTHERS = 2
.
if SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDMETHOD.
ENDCLASS.
exporting
PICTURE_ID = 'SAPLOGO1'
* WIDTH =
* ALTERNATIVE_TEXT =
* TABINDEX =
.
call method O_DOCU->DISPLAY_DOCUMENT
exporting
* REUSE_CONTROL =
* REUSE_REGISTRATION =
* CONTAINER =
PARENT = O_REF1
exceptions
HTML_DISPLAY_ERROR = 1
OTHERS = 2
.
if SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDMETHOD.
ENDCLASS.
SELECT-OPTIONS : S_MATNR FOR WA_MARA-MATNR.
START-OF-SELECTION.
PERFORM FETCH_DATA.
CALL SCREEN 100.
START-OF-SELECTION.
PERFORM FETCH_DATA.
CALL SCREEN 100.
FORM FETCH_DATA .
SELECT * FROM MARA INTO TABLE IT_MARA
WHERE MATNR IN S_MATNR.
ENDFORM.
SELECT * FROM MARA INTO TABLE IT_MARA
WHERE MATNR IN S_MATNR.
ENDFORM.
MODULE STATUS_0100 OUTPUT.
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS
* SET PF-STATUS 'xxxxxxxx'.
* SET TITLEBAR 'xxx'.
ENDMODULE. " STATUS
MODULE SPLIT_CONTAINER OUTPUT.
IF O_CUST IS NOT BOUND.
create object O_CUST
exporting
* PARENT =
CONTAINER_NAME = 'CUST'
* STYLE =
* LIFETIME = LIFETIME_DEFAULT
* REPID =
* DYNNR =
* NO_AUTODEF_PROGID_DYNNR =
exceptions
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6
.
if SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
IF O_CUST IS NOT BOUND.
create object O_CUST
exporting
* PARENT =
CONTAINER_NAME = 'CUST'
* STYLE =
* LIFETIME = LIFETIME_DEFAULT
* REPID =
* DYNNR =
* NO_AUTODEF_PROGID_DYNNR =
exceptions
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6
.
if SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
create object O_SPLI
exporting
* LINK_DYNNR =
* LINK_REPID =
* SHELLSTYLE =
* LEFT =
* TOP =
* WIDTH =
* HEIGHT =
* METRIC = CNTL_METRIC_DYNPRO
* ALIGN = 15
PARENT = O_CUST
ROWS = 2
COLUMNS = 1
exporting
* LINK_DYNNR =
* LINK_REPID =
* SHELLSTYLE =
* LEFT =
* TOP =
* WIDTH =
* HEIGHT =
* METRIC = CNTL_METRIC_DYNPRO
* ALIGN = 15
PARENT = O_CUST
ROWS = 2
COLUMNS = 1
* NO_AUTODEF_PROGID_DYNNR =
* NAME =
exceptions
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
OTHERS = 3
.
if SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call method O_SPLI->GET_CONTAINER
exporting
ROW = 1
COLUMN = 1
receiving
CONTAINER = O_REF1
.
call method O_SPLI->GET_CONTAINER
exporting
ROW = 2
COLUMN = 1
receiving
CONTAINER = O_REF2
.
create object O_DOCU
exporting
STYLE = 'ALV_GRID'
* BACKGROUND_COLOR =
* BDS_STYLESHEET =
* NO_MARGINS =
.
ENDIF.
exporting
ROW = 1
COLUMN = 1
receiving
CONTAINER = O_REF1
.
call method O_SPLI->GET_CONTAINER
exporting
ROW = 2
COLUMN = 1
receiving
CONTAINER = O_REF2
.
create object O_DOCU
exporting
STYLE = 'ALV_GRID'
* BACKGROUND_COLOR =
* BDS_STYLESHEET =
* NO_MARGINS =
.
ENDIF.
MODULE DISPLAY_MARA OUTPUT.
IF O_ALV IS NOT BOUND.
create object O_ALV
exporting
* I_SHELLSTYLE = 0
* I_LIFETIME =
I_PARENT = O_REF2
* I_APPL_EVENTS = SPACE
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
* I_FCAT_COMPLETE = SPACE
exceptions
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5
.
if SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
IF O_ALV IS NOT BOUND.
create object O_ALV
exporting
* I_SHELLSTYLE = 0
* I_LIFETIME =
I_PARENT = O_REF2
* I_APPL_EVENTS = SPACE
* I_PARENTDBG =
* I_APPLOGPARENT =
* I_GRAPHICSPARENT =
* I_NAME =
* I_FCAT_COMPLETE = SPACE
exceptions
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
OTHERS = 5
.
if SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
ENDMODULE.
SET HANDLER HANDLE_EVENT=>HANDLE_TOP_PAGE FOR O_ALV.
call method O_ALV->SET_TABLE_FOR_FIRST_DISPLAY
exporting
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'MARA'
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
* IS_LAYOUT =
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
* IR_SALV_ADAPTER =
changing
IT_OUTTAB = IT_MARA
* IT_FIELDCATALOG =
* IT_SORT =
* IT_FILTER =
exceptions
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
.
if SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call method O_ALV->SET_TABLE_FOR_FIRST_DISPLAY
exporting
* I_BUFFER_ACTIVE =
* I_BYPASSING_BUFFER =
* I_CONSISTENCY_CHECK =
I_STRUCTURE_NAME = 'MARA'
* IS_VARIANT =
* I_SAVE =
* I_DEFAULT = 'X'
* IS_LAYOUT =
* IS_PRINT =
* IT_SPECIAL_GROUPS =
* IT_TOOLBAR_EXCLUDING =
* IT_HYPERLINK =
* IT_ALV_GRAPHICS =
* IT_EXCEPT_QINFO =
* IR_SALV_ADAPTER =
changing
IT_OUTTAB = IT_MARA
* IT_FIELDCATALOG =
* IT_SORT =
* IT_FILTER =
exceptions
INVALID_PARAMETER_COMBINATION = 1
PROGRAM_ERROR = 2
TOO_MANY_LINES = 3
OTHERS = 4
.
if SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
call method O_ALV->LIST_PROCESSING_EVENTS
exporting
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = O_DOCU
* IS_SUBTOTTXT_INFO =
* IP_SUBTOT_LINE =
* I_TABLE_INDEX =
* changing
* C_SUBTOTTXT =
.
ENDIF.
ENDMODULE. " DISPLAY_MARA OUTPUT
exporting
I_EVENT_NAME = 'TOP_OF_PAGE'
I_DYNDOC_ID = O_DOCU
* IS_SUBTOTTXT_INFO =
* IP_SUBTOT_LINE =
* I_TABLE_INDEX =
* changing
* C_SUBTOTTXT =
.
ENDIF.
ENDMODULE. " DISPLAY_MARA OUTPUT
No comments:
Post a Comment