Unit 1: Introduction To Webdynpro ABAP
Unit 1: Introduction To Webdynpro ABAP
Unit 1 :
Introduction to Webdynpro ABAP
1.1 Introduction to webdynpro ABAP -1-
Webdynpro ABAP is SAP Standard UI technology for
developing web applications in ABAP Environment.
Advantages:
1. Reduces implementation effort.
2. Separation of layout and business data.
3. Reusability of components.
4. Automatic data transfer using context binding.
5. Support Stateful applications. i.e. Even when the pages
change the data in the previous page still remains.
Webdynpro Architecture:
It is based on MVC Architecture and supports:
1. Clear separation of business and display logic.
2. Meta-model Concept.
3. Execution on number of client platforms.
4. Extensive Platform Independence of interfaces.
1.1 Introduction to webdynpro ABAP -2-
MVC Architecture : The Model View Controller (MVC) design pattern
contains a clear distinction between processing control, data model and
displaying the data in the interface.
Model : The model is used as an application object of the application data
administration. It responds to information requests about its status, which
usually come from the view, as well as to statements for status changes,
which are usually sent by the controller. In this way, only the model is used
to process data internally, without making reference to the application and
its user interface. There can be different views for a model, which can be
implemented using different view pages.
View : The view handles the graphical and textual output at the interface
and therefore represents the input and output data in each interface
element, such as pushbuttons, menus, dialog boxes and so on. The view
takes of visualization. To visualize the status, the view queries the model, or
the model informs the view about possible status changes.
Controller : The controller interprets and monitors the data that is input
by the user using the mouse and the keyboard, causing the model or the
view later to change if necessary. Input data is forwarded and changes to
the model data are initiated. The controller uses the model methods to
change the internal status and then informs the view about this. This is how
the controller determines reactions to the user input and controls
processing.
1.1 Introduction to webdynpro ABAP -3-
1.2 Different types of controller in
Webdynpro ABAP
The different types of controllers in webdynpro abap are:
1. Component controller
2. Custom controller
3. Interface controller
4. View Controller
5. Window Controller
Before learning about the Controllers let us know something about different types
of interfaces that are created at the time of creation of the component. These
interfaces are as below.
1. IF_<ControllerName>
2. IG_<ControllerName>
3. IWCI_<ComponentName>
The interface begin with the prefix IF is local and can be used for coding only within
that controller.
The interface begin with the prefix IG is used for cross controller
communication.(E.g View controller to component controller)
The interface begin with the prefix IWCI is used for cross component
communication. (E.g. ComponentA to ComponentB)
1.2.1 Component Controller -1-
There is only one component controller per
webdynpro component and it is global. i.e Component
controller consist of data and processing logic that is
available to all the views in the component.
This controller does not have any visual interface.
The life time of the component controller is the life
time of the component.
Components of Component:
1.2.1 Component Controller -2-
Properties:
In the properties tab of the component controller we
can declare the component usage of the other
component so that the interface methods of that
component can be accessed by the methods of the
component controller.
1.2.1 Component Controller -3-
Context:
Context is a hierarchial form of storage of data which we will
breifly study about it in the upcoming posts. And for now
context is a place where you declare the data.
The Nodes declared here can be mapped to any number of
views and can be accessed from there hence making the data
of the component controller global.
1.2.1 Component Controller -4-
Attributes:
The attributes required by the Component controller are declared
in the attributes and are accessible to the methods of the
component controller using the handle provided for the
component controller(WD_THIS). These attributes can also
be accessed from different controllers using the handle provided
for the component controller(WD_COMP_CONTROLLER)
in the respective controller.
The attribute WD_THIS declared in any controller refers to the
interface of the current controller and the attribute WD_CONTEXT
declared referes to the corresponding context of the controller.
1.2.1 Component Controller -5-
Events:
Events can be created in component and custom controller.
Events created in the component controller are visible only within the component
which means it can only be triggered by the methods of the component
controller. But it can be handled in different contollers.
Thus Events are used to communicate between the controllers and enable one
controller to trigger the event and handler the event in different controller.
Events can also implement cross component communication provided that the
interface check box is checked.
1.2.1 Component Controller -6-
Methods:
Component controller consist of number of predefined methods called
hook up methods which are executed in a pre-defined manner. We will
study about these hook up methods in the later posts.
We can also created the methods on our own and the methods which we
created can be called from any controller using the handle for the
component controller(WD_COMP_CONTROLLER).
1.2.2 Custom Controller -1-
Custom controllers can be additionally created in the component and they
are exactly similar to the component controller in terms of functionality.
This means it is visible to all the elements in the component and life time of
the controller is the lifetime of the component. Any number of custom
controller can be created in the component and it provides the option of
structuring the data and functions. It only make sense to create a custom
controller if certain function and data are to be associated with the specific
set of views.
The first three components Properties, Context and Attributes are similary
to that of component controller and the only differ in the events and
method properties
1.2.2 Custom Controller -2-
Events:
Events are created and implement in a similar way to
the component controller except that they cannot
implement cross component communication. It can be
handled only within the component.
1.2.2 Custom Controller -3-
Methods:
Unlike component controller the custom controller does not
contain a number of hook up methods. We can create own
methods in the custom controller and these methods can be
used by any views provided that the custom controller is
added to the used controller in the properties tab of the view.
1.2.3 Interface Controller -1-
Interface controller is used for cross component
communication.
Interface controller does not contain any implementation.
Interface controller is the point of contact of communication
for other component to use this component. Only nodes,
methods and events marked as interfaces can be used by
other components.
Components of interface:
1.2.3 Interface Controller -2-
Properties:
In the Properties tab you will be able to see the
administration data and Interface that was created
for the external communication(IWCI).
1.2.3 Interface Controller -3-
Context:
In the context tab you will be able to see the
context nodes of the component controller which
is marked as interface node in the node properties
of the component controller.
1.2.3 Interface Controller -4-
Events:
In the events tab you will be able to see the events
which are marked as interface events for cross
component implementation.
1.2.3 Interface Controller -5-
Methods:
In the methods tab, you will be able to see the
interface methods that can be accessed by the
other components.
1.2.4 View Controller -1-
Each view exactly consist of one view controller.
Number of view controllers in a component depends upon the
number of views.
The view controller cares about the view specific flow logic like
checking user input, handling user actions etc. The lifetime of the
view controller is restricted to the life time of the view.
Components of view:
1.2.4 View Controller -2-
Properties:
The properties tab of the view controller consist of the admin data as well
as the option to add the used controllers for the view.
In this example I have added the custom controller of the same component
as the used component so that the methods of the custom controllers can
be accessed in this view.
1.2.4 View Controller -3-
Layout:
Layout tab of the view controller provides the
option for placing the UI element. It is WYSIWYG
type of editor. (What You See Is What You Get).
1.2.4 View Controller -4-
Inbound Plugs:
Plugs are required for the navigation between the views.
Inbound plugs consist plugs which is pointing into the view.
Unlike outbound plug the inbound plug consist of event
handler method which will be executed before displaying
the view.
1.2.4 View Controller -5-
Outbound Plug:
Outbound plugs consist plugs which is pointing away
from the view. This does not contain any event handler
method and the outbound plug can be fired using
following syntax.
WD_THIS->FIRE_<Plugname>_PLG.
1.2.4 View Controller -6-
Context:
Context as mention earlier is a hierarchical form of data
storage and the context node declared in the view can be
used only in that corresponding view and it cannot be
accessed in any other views. The node created in the view
context does not provide the option for interface node.
1.2.4 View Controller -7-
Attributes:
Attributes are similar to the attribute tab discussed in the component controller.
Here in the view controller you will be able to see the handler to the component
controller with reference to the interface of the type :
IG_(Cross controller).
Using this handler the attributes and methods of the component controller can be
accessed.
1.2.4 View Controller -8-
Actions:
Actions tab consist of the onaction events created
for the UI elements.
1.2.4 View Controller -9-
Methods:
In the methods tab you will be able to see the set of
hook methods specific to the view controller and
event handler methods created for the UI element
actions and own defined methods.
1.2.5 Window Controller -1-
Each window in a webdynpro component consist of
a window controller.
It is visible throughout the component and behaves
like component or custom controller.
Components of window controller:
1.2.5 Window Controller -2-
Properties:
Properties tab of the window controller is similar to
that of the view controller.
1.2.5 Window Controller -3-
Window:
In the window tab we will be able to see the views that are
embedded in the window, inbound and outbound plug of
each view and the view that is marked as default.
Here we can also specify the navigation link between the
views using the view plugs.
1.2.5 Window Controller -4-
Inbound Plug:
The properties of a windows inbound plug differ from a views inbound plugs by
the characteristics Interface and Startup or Resume that can be maintained:
Interface:
The interface check box determines whether the inbound plug is used only for
navigation within the component or cross component navigation.
Startup:
If the plug type is selected as start up then webdynpro application can be started
using this plug. When creating an webdynpro application only the interface view
inbound plug can be used. All other type of plugs can only be used for navigation in
an already running application. Window inbound plug also has the event handler
method. The Plug type suspend and resume are used for portal navigation and will
be discussed in later posts.
1.2.5 Window Controller -5-
Outbound plug:
Outbound plugs consist of interfaces, Exit and Suspend
characteristics.