Code: Alles auswählen.
method on_call_screen.
call function 'Z_DYNPRO_CALL_SCREEN'
exporting i_dynnr = dynnr i_popup = popup i_starting_x = starting_x i_ending_x = ending_x i_starting_y = starting_y i_ending_y = ending_y.
endmethod.
Code: Alles auswählen.
CLASS lcl_dynpro_9000 DEFINITION INHERITING FROM cl_ctrler_screen_window.
PUBLIC SECTION.
METHODS: constructor.
PROTECTED SECTION.
METHODS: navigate,
on_call_screen FOR EVENT handle_fcode OF cl_ctrler_screen_window, " eigentlich on_call_screen REDEFINITION, aber wie definiere ich dann den EH neu??
on_process_fcode REDEFINITION.
PRIVATE SECTION.
CLASS-DATA c_pfstatus_popup TYPE sypfkey.
DATA: c_titlebar TYPE gui_title,
c_repid TYPE syrepid,
c_pfstatus_window TYPE sypfkey.
ENDCLASS.
CLASS lcl_dynpro_9000 IMPLEMENTATION.
METHOD constructor.
DATA: l_pfstatus TYPE sypfkey.
super->constructor( ).
repid = c_repid.
dynnr = '9000'.
CASE popup.
WHEN space.
l_pfstatus = c_pfstatus_window.
WHEN OTHERS.
l_pfstatus = c_pfstatus_popup.
ENDCASE.
r_status->set_pfstatus( pfstatus = l_pfstatus pfstatus_repid = me->c_repid ).
"SET HANDLER navigate FOR me.
ENDMETHOD.
METHOD on_call_screen.
CALL FUNCTION 'Z_DYNPRO_CALL_SCREEN'
EXPORTING
i_dynnr = dynnr
i_popup = popup
i_starting_x = starting_x
i_ending_x = ending_x
i_starting_y = starting_y
i_ending_y = ending_y.
ENDMETHOD.
METHOD on_process_fcode.
*@78QImporting@ VALUE( FCODE ) TYPE SYUCOMM
super->on_process_fcode( fcode ).
IF r_status->pfstatus_repid EQ c_repid AND ( r_status->pfstatus EQ c_pfstatus_window OR r_status->pfstatus EQ c_pfstatus_popup ).
CASE fcode.
WHEN 'BACK' OR 'CANC' OR 'OK'.
SET SCREEN 0.
LEAVE SCREEN.
set_fcode_handled( ).
WHEN 'EXIT'.
LEAVE PROGRAM.
when 'PRESS_ME'.
raise event navigation_requested.
when 'HI'.
message 'OO Event Handler! Yay!' type 'I'.
set_fcode_handled( ).
WHEN OTHERS.
RAISE EVENT handle_fcode
EXPORTING fcode = fcode.
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD navigate .
IF dynnr = '9000'.
dynnr = '9100'.
ELSE.
dynnr = '9000'.
ENDIF.
CLEAR r_screen.
me->display( ).
me->set_fcode_handled( ).
ENDMETHOD.
ENDCLASS.
Code: Alles auswählen.
CLASS lcl_test_proc DEFINITION INHERITING FROM cl_ctrler_screen_window.
PUBLIC SECTION.
METHODS: constructor.
PROTECTED SECTION.
METHODS: navigate FOR EVENT handle_fcode of cl_ctrler_screen_window,
on_call_screen REDEFINITION,
on_process_fcode REDEFINITION.
PRIVATE SECTION.
DATA: c_titlebar TYPE gui_title VALUE 'TITLE',
c_repid TYPE syrepid VALUE 'CH_KOMM_TEST',
c_pfstatus_window TYPE sypfkey VALUE 'WINDOW',
c_pfstatus_popup TYPE sypfkey VALUE 'POPUP',
lvc_fieldcat TYPE lvc_t_fcat,
layout TYPE lvc_s_layo,
container TYPE REF TO cl_gui_custom_container,
alv TYPE REF TO cl_gui_alv_grid.
ENDCLASS.
CLASS lcl_test_proc IMPLEMENTATION.
METHOD constructor.
DATA: l_pfstatus TYPE sypfkey.
super->constructor( ).
repid = c_repid.
dynnr = '9000'.
CASE popup.
WHEN space.
l_pfstatus = c_pfstatus_window.
WHEN OTHERS.
l_pfstatus = c_pfstatus_popup.
ENDCASE.
* Weder der Status noch der Titel wird gesetzt beim Aufruf der unteren Methoden, dabei sind die übergebenen Parameter korrekt. Wenn ich SET PF-STATUS und
* SET TITLEBAR setze, dann werden diese auch gesetzt.
* SET PF-STATUS 'WINDOW'.
* SET TITLEBAR 'TITLE'.
r_status->set_pfstatus( pfstatus = l_pfstatus pfstatus_repid = me->c_repid ).
r_status->set_titlebar( titlebar = me->c_titlebar titlebar_repid = me->c_repid ).
* Bin mir immer noch nicht sicher ob das stimmt. Muss ich mir hierfür einen eigenen Event Handler schreiben?
SET HANDLER navigate FOR me.
ENDMETHOD.
METHOD on_call_screen.
CALL SCREEN dynnr.
ENDMETHOD.
* Mir ist die Verwendung unklar von on_process_code. Es handelt sich hierbei um ein Event, der geerbt wird. Wie muss ich ihn korrekt setzen?
METHOD on_process_fcode.
super->on_process_fcode( fcode ).
IF r_status->pfstatus_repid EQ c_repid AND ( r_status->pfstatus EQ c_pfstatus_window OR r_status->pfstatus EQ c_pfstatus_popup ).
CASE fcode.
WHEN 'BACK' OR 'CANC' OR 'OK'.
SET SCREEN 0.
LEAVE SCREEN.
set_fcode_handled( ).
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'EXEC'.
set_fcode_handled( ).
WHEN OTHERS.
RAISE EVENT handle_fcode EXPORTING fcode = fcode.
ENDCASE.
ENDIF.
ENDMETHOD.
METHOD navigate .
IF dynnr = '9000'.
dynnr = '9100'.
ELSEIF dynnr = '9100'.
dynnr = '9200'.
ELSE.
dynnr = '9300'.
ENDIF.
CLEAR r_screen.
me->display( ).
me->set_fcode_handled( ).
ENDMETHOD.
ENDCLASS.
***********************************************************************
** PROGRAM EVENTS
***********************************************************************
INITIALIZATION.
DATA screen TYPE REF TO lcl_test_proc.
CREATE OBJECT screen.
screen->display( ).