cancel
Showing results for 
Search instead for 
Did you mean: 

Raising Event Programatically

Former Member
0 Kudos

Hi,

The problem scenario is:

I have a webdynpro component A. I've declared Usage of another WD component B in A. I've created some events in Used Component B, and their event handlers are written in my component A.

Now i want to raise an event of the used component B from a method written in component A.

I tried using the below code but it gives error as

Code :

 RAISE EVENT MYEVENT EXPORTING WDEVENT. 

Error : Object type "CL_SAL_ADVANCE_VIEW_CTR" does not have an event "MYEVENT".

where the MYEVENT is the name of the event, i want to raise which is created in WD component B.

SAL_ADVANCE_VIEW is the name of the view.

Please help.

Accepted Solutions (0)

Answers (3)

Answers (3)

Chaitanya_Priya
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

The events are present in Comp B.

Once you have used the Comp B in comp A.

Then the events of comp B are made visble in comp A.

Go to Methods tab of comp A.( depends in which view you implement.go the corresponding methods Tab)

Give the method name .select the method type of a event handler. In the event column .click on f4 help.select which event of comp B needs to be callled in comp A.

So now u r able to acess the events of comp B in comp A.

Priya

Former Member
0 Kudos

hi,

I dont know why you want to call the Event programatically. Rather you can easily call the event handler of Comp B .

The event handler of COMP B is already present in Comp A.

SO you can direclty call event handler of Comp B from any method in Comp A using Code wizard.

Former Member
0 Kudos

hi Rohit ,

to call the method of one component in the another component , use code wizard :

1 Press control +F7 ( go to code wizard)

2 Select the radio button , Method call in used controller

3 give the name of the component A and the component B which is being used

4 give controller name as INTERFACE CONTROLLER

5 in the method name , in this radio button , give the name of the mthod which is to be called

eg OnActionMYEVENT in ur case

I hope u have got it and this wud solve ur problem

regards,

amit