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

WebDynpro: Access method from another view Controller

0 Likes
1,352

Hi Experts!

I have a doubt but I'm not sure how to resolve this one.

I have a view Controller with some methods implemented. Within a method, at a certain point I'd like to access a method from another view Controller. Is this possible? If so, do I have to create a reference in Attributes Tab?

I tried to declare a reference with Reference Type IG_<nameofview> but gives me a warning saying it doesn't exist.

Any help would be appreciated.

Thanks,

Lauro Ribeiro

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,154

Hello,

Do one thing Create your node in component controller and method also in component controller and use the nodes ann method in both View.

for more use..

https://www.google.co.in/#fp=a4c17cf7a703bf9a&q=use+of+component+controller+in+webdynpro+abap

.. Chandra..

6 REPLIES 6
Read only

Former Member
0 Likes
1,154

Hi Lauro,

The best thing you could do is implement those methods in the component's controller.

Martin

Read only

ronaldo_aparecido
Contributor
0 Likes
1,154

If you create a global class with a method you can use call service to call this method in web dynpro aplications.

See the link.

http://scn.sap.com/docs/DOC-2290

Read only

Former Member
0 Likes
1,155

Hello,

Do one thing Create your node in component controller and method also in component controller and use the nodes ann method in both View.

for more use..

https://www.google.co.in/#fp=a4c17cf7a703bf9a&q=use+of+component+controller+in+webdynpro+abap

.. Chandra..

Read only

0 Likes
1,154

hi,

Create an assistance class and define your method in the assistance class.

You will get a default reference to the assistance class as WD_ASSIST in all your views.

Access your required method using this reference.

This way you can achieve the Webdynpro recommended  MVC architecture also.

--

dp

Applexus technologies

Read only

uppu_narayan
Active Participant
0 Likes
1,154

hi lauro,

     Writing method in the view controller are specific to that view you cannot access them in another view, if you want to share the method or reuse a method then put them in component controller or use assistance class for storing method at one place for reuse.

Thanks and regards,

Uppu Narayan

Read only

0 Likes
1,154

Alright guys thanks a lot for the help!

I assumed I could write the method in component controller but was concerned if that would go against the MVC architecture...

All of the suggestions worked but creating an assistance class seemed better for my case.

Cheers!