‎2007 Jun 11 6:36 AM
Hello all,
Can we define and implement the class in PAI while doing module pool. I want to trigger an event (to get userdefined buttons on to alv report ), when alv is displayed in PAI event.
If we can how we can go about it else is ther an alternative for that.
Regards
‎2007 Jun 11 6:40 AM
hi ,
According to my knowledge, you can not define classes in module pool programs .
Regards,
Ranjita
‎2007 Jun 11 7:37 AM
offcourse we <b>CAN</b> define a class .
when u right click on the program name we get option for defining and implementing class.. u can define method inside the class defintion .. u can define event inside it..
operation wihich is to be perfromed when a event is trigged is written inside the class implemention...here we implement the methods( methods which we define ine in the class definition) ..ie the operations to be perfromed...
by creating the handler of the class we can invoke the corresponding methods... inside these methods events will triggired
‎2007 Jun 11 7:44 AM
sample code
&----
*& Include ZCLASS_DEFINITION *
&----
class event_handling definition..
public section.
methods:
handle_double_click
for event node_double_click
of cl_gui_simple_tree
importing node_key,
handle_expand_no_children
for event expand_no_children
of cl_gui_simple_tree
importing node_key.
endclass. "event_handling DEFINITION
----
CLASS event_handling IMPLEMENTATION
----
*
----
class event_handling implementation.
method handle_double_click.
node_info = ' NODE_Double_click'.
n_key = node_key.
endmethod. "handle_double_click
method handle_expand_no_children.
node_info = 'Expaand_children'.
n_key = node_key.
endmethod. "handle_expand_no_children
endclass. "event_handling IMPLEMENTATION