Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Classes in Modulepool

Former Member
0 Likes
672

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

3 REPLIES 3
Read only

former_member196299
Active Contributor
0 Likes
638

hi ,

According to my knowledge, you can not define classes in module pool programs .

Regards,

Ranjita

Read only

Former Member
0 Likes
638

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

Read only

Former Member
0 Likes
638

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