cancel
Showing results for 
Search instead for 
Did you mean: 

What is the use of 3 controllers in webdynpro application?

gopalkrishna_baliga
Participant
0 Kudos

Hi experts,

I have seen that in a webdynpro component (ABAP) there are three(3) controllers namely, Component controller, View Controller and Interface controller.

Why do we have 3 controllers? For what conditions I can use them? When to use Component controller, View Controller and Interface controller?

thanks

Gopal

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Gopal

The purpose and usage of 3 controllers are :

1. View Controller is associated with a view .It is used for context elements/mapping, code etc that is specific to the view only.It's lifetime is only the duration for which the view is shown.

2.Component Controller is linked with the particular webdynpro component.It's a common place inside the controller in which context creation/mapping, code, functions are kept and it is shared by all views inside the controller.

Note: Custom controller is same as component controller which the user creates.

3. Interface controller is the place when you use the functionalities of a external component preferably DC (development component features which are published thru Public part - for sharing with other DC).

So if you are using the context, code, functions of a "Used DC" you use the Interface Controller.

Practically many developers are creating several DC and the sharing of code happens thru Public part.You add DC in the "Used DC" node , map the context to component controller and map again the view controller for the specific nodes you require.

Pleas post for more information.

Hope this helps

Regards

Ananda

gopalkrishna_baliga
Participant
0 Kudos

Hi Samta,

What do you mean by cross application? Can you give example?

I have a view which is a selection screen. It contains ranges. How do I pass selected range values to another view to display a ALV report?

Thanks

Gopal

Former Member
0 Kudos

Hi gopalkrishna,

What i have got from your question is that you have to pass the selected range from one view to another.

View to view data cannot be passed. It has to follow the path View1 -> Controller -> View2

For that,

1) In the view(selection range) create a context element and bind it to the data to be passed in the view.

2) Create a custom controller and create a mapping between the cutom controllers context and the view context.

Now the data to be passed is available in the custom controllers context.

3) Now in the second view, create context element and map it to the above created custom controllers context.

The data from the custom controller is now available in the second view.

Thanks,

Samta

Former Member
0 Kudos

Hi gopalkrishna,

The component controller provides data and processing logic that it should be possible to display or change for all views of a component.

The interface controller is used for cross-component communication.

The view controller contains data and functions are visible within the same view only

To create simple Web Dynpro applications, it is sufficient if you maintain the component controller and the view controller of a view

For further information, refer the following link -

<a href="http://help.sap.com/saphelp_nw2004s/helpdata/en/b9/b82c4142aef623e10000000a155106/frameset.htm">http://help.sap.com/saphelp_nw2004s/helpdata/en/b9/b82c4142aef623e10000000a155106/frameset.htm</a>

Thanks,

Samta