cancel
Showing results for 
Search instead for 
Did you mean: 

How to Call Methods of one component into another Component

Former Member
0 Kudos

Hi Experts,

I have one requirement...

I have 2 components A and B, i used A comp in B, i need to call Comp A methods in Component B, can anybody give me the syntax?? please...

Thanks and Regards,

Kissna.

Accepted Solutions (0)

Answers (2)

Answers (2)

saket_abhyankar
Active Participant
0 Kudos

Hi,

First of all you have to make (declare) the method of component A as interface. You can do this by selecting the check box in front of the method (Interface).

Then click on the wizard, select second radio button i.e. 'Method Call in Used Controller' and fill all the details, then enter the code to call method will be generated automatically.

Regards,

Saket.

Former Member
0 Kudos

Thanks Manas and saket,

now i got an idea... problem solved.

Former Member
0 Kudos

Hi,

In used component Comp Controller create a method, mark it as interface method.

In calling component after you hav declared usage and all then initiate the used compoent and then call the method.

with the used comp reference.

It is same as ALV method calls ( as ALV is also a used component )

Check WDT_ALV for syntax.

Regards

Manas Dua

Former Member
0 Kudos

Hi Manas Thanks for your fast reply,

My question is, for example we have wd_comp_controller or wd_this objects to call methods of view from view and comp controller right.. like this we have any methods to call used component methods? if yes can u please give me the objects syntax?...

Thanks and regards,

Kissna.