‎2007 Feb 20 2:08 PM
‎2007 Feb 20 2:16 PM
‎2007 Feb 20 2:08 PM
‎2007 Feb 20 2:16 PM
‎2007 Feb 20 2:18 PM
HI Rich,
From which version is this new change for i have developed a program of late, which does call a screen from a method of a class.
Regards,
Ravi
sample code:
report zexample.
*button to be clicked after which the event should get triggered
selection-screen: pushbutton /10(20) button user-command but1.
initialization.
button = 'LISTS'.
----
CLASS cl_names DEFINITION
----
*
----
class cl_names definition. " declare the events in this method
public section.
class-events: get_event exporting value(fcode) type sy-ucomm.
class-methods: user_action.
endclass. "cl_names DEFINITION
----
CLASS fcode_handler_class DEFINITION
----
*
----
class fcode_handler_class definition. " definition for handler events
public section.
methods: fcode_handler for event get_event
of cl_names importing fcode.
endclass. "fcode_handler_class DEFINITION
----
CLASS cl_names IMPLEMENTATION
----
*
----
class cl_names implementation. "Raise the event
method user_action.
raise event get_event exporting fcode = sy-ucomm.
endmethod. "USER_ACTION
endclass. "cl_names IMPLEMENTATION
----
CLASS fcode_handler_class IMPLEMENTATION
----
*
----
class fcode_handler_class implementation. "implement the handler event
method fcode_handler.
case fcode.
when 'BUT1'.
*WRITE: 'Hello Program !!'.
*message i001(zz) with 'Test'.
<b>call screen '0100'.</b>
endcase.
endmethod. "fcode_handler
endclass. "fcode_handler_class IMPLEMENTATION
data: h1 type ref to fcode_handler_class.
*start-of-selection.
at selection-screen.
create object h1.
set handler h1->fcode_handler." FOR ALL INSTANCES.
call method: cl_names=>user_action.
Call to the screen highlighted and is working fine.
Message was edited by:
Ravi Kanth Talagana
‎2007 Feb 20 2:27 PM
Hi Ravi,
in your example you are using local classes. I want to use Dynpros in global classes which are created with the Class Builder (SE24).
Thanks Rich for your response. Is there any documentation for your solution?
‎2007 Feb 20 2:38 PM
‎2007 Feb 20 2:49 PM