cancel
Showing results for 
Search instead for 
Did you mean: 

How to Raise a class event from webdynpro

Former Member
0 Kudos

Hi Experts..

I am trying to raise an event which is defined in a Class(which is not my assistance class) in my WD comp.

I clicked on Pattern and selected option  Raise event, I gave the class name and selected the event which should raise.

But I am getting an error.


CL_<VIEW NAME>_CTR does not have  an event.



Thanks,

Pradeep.     

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Haridas, In order to raise an class event in webDynpro ABAP, call the class method which imports the events ( type SIBFEVENT ) listed in the class event tab. Eg                 call method zcl_demo=>RAISE_EVENT                       EXPORTING                   i_event      = 'DEMO_EVT'. Thanks, Chaitanya.

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

Hi Pradeep,

It is not possible to raise the event  of a class inside webdynpro method directly.

Instead, you need to have a method RAISE_EVENT in a class and the method should contain the logic to raise an event of its own class. Now, call the method RAISE_EVENT( ), and it fires the event.

Example:

Class: ycl_test_events.

Event : DATA_CHANGED

Public Method: raise_event( )


Method raise_event.

          raise event data_changed.

endmethod.

Now, call the method in Webdynpro methods


data lo_test_events type ref to ycl_test_events.

     create object lo_test_events.

          lo_test_events->raise_event( ).

Hope this helps you.

Regards,

Rama