Você está na página 1de 82

ABAP Webdynpro

Company
Company Logo
Logo
Course Objective
After completing this course, you will
be able to:
Explain the architecture of a Web
Dynpro component
Describe the constituents of a Web
Dynpro controller
Create context elements in Web
Dynpro controllers
Explain how navigation and data
Definition :
Web Dynpro is the SAP NetWeaver
programming model for user
interfaces (UIs).
Features :
• The Web Dynpro model is based on
the Model View Controller
paradigm, and has been build on
the classic dynpro model
• Clear separation of business logic
and display logic
Main webdynpro
component’s parts
Component Controller

v Context
• Windows
v Controller
v Context
v Attributes
v Methods
v Enbedded views
v ........
• Views
v UI elements
v Layout
v Controller
v Plugs
v Actions
v Context
v ..................
Parts of webdynpro
component
Different types of
Controllers
Component Controller
Custom controller
Configuration controller
View controller
Window controller  
Different Webdynpro
entities
At runtime, all controller instances are singletons in respect to
their parent component. This is also true for view controllers; thus,
embedding a view in a view assembly more than one time is not
allowed.
Context
Context and data transport
Context Nodes and
Attributes
Cardinality

Cardinality Description

1...1 Only one element is instantiated.

At runtime, no more than one element is


0...1 instantiated, but it is also possible that no element
is instantiated.

n elements can be instantiated, but at least one


1...n
element must be instantiated.

The number of instantiated elements of the context


0...n
node can vary.
Example of Cardinality
Note: Since the root node of a context is only ever instantiated once, every no
directly below the root node (in our example, Vehicle) is always automatically
singleton node.
Exercise 1
Exercise 1:
Programming data fetching
Exercise 1: service call
wizard
Exercise 1: After service
call
Exercise 1: Context
mapping
Exercise 1: creating forms
Exercise 1 : context binding
Exercise 1: Adding button
and action
Exercise 1: creating action
Exercise 1: Event controlled
method
Exercise 1: creating table
Exercise 1: binding table
Exercise 1: binding table
Exercise 1: embedding
views
Exercise 1: Output
Exercise 2: creating
a webdynpro
application withCompany Logo

multiple views
Exercise 2: Application
overview
Exercise 2: design first view
Exercise 2: context
mapping of view1
Exercise 2: data binding
view1
Exercise 2: design second
view
Exercise 2: context
mapping view2
Exercise 2: data binding
view2
Exercise 2: view embedding
Exercise 2: creating
navigation links
Exercise 2: creating
application & test
Inter-
application
WD application 1
navigation
WD application 2

Company Logo
Example
Web Dynpro application
and aggregated
components
Principle of an inter-
application-navigation
scenario
Defining a Web Dynpro
Application in SAP
NetWeaver™ Developer
Studio
Interface
IPublicStartCompInterfaceVi
ew
View layout
Defining view controller
usage
Implementing eventhandler
Start Component and firing
exit plug
Target Component
Adding a startup plug
parameter
Defining the component
controller usage
User Interface
Elements

Company Logo
Standard UI elements are :
Button

Table

InputField
A
D
E
c
n
t
s UI elements help to execute
e
p
ro
tn
a
s
e
y
x
t
g
re
x
a
t
p
h

c
s
Various UI element sections

● favorites
● text
● action
● selection
● complex
● layout
● graphic
● integration
Various types of text forms
●      Static Texts
●      Dynamic Texts
●      Long texts
Messages

Company
Company Logo
Logo
Description
Messages are language-dependent
texts that are displayed on the screen
if, for example, an error occurs when
an application is run or the user
enters data in the wrong format.
Advisory
SAP recommends that you restrict the
number of messages to a manageable
amount. If there are too many
messages it overburdens the end user
Example
Three settings for handling
messages
Show message component if required

If messages exist, they are displayed

Always show message component


Messages in POPUP window
Configuration options for
Popups
●      Display all messages as up to
now (standard setting)
●      Only display the messages that
belong to their window as well as all
non-window-specific messages
●      Display no messages at all
Messages are integrated into the
message log of a component using
the Message Manager (interface
IF_WD_MESSAGE_MANAGER) . 
Methods for triggering
messages
CLEAR_MESSAGES
Deletes all messages
IS_EMPTY
Queries whether there are any
messages
REPORT_ATTRIBUTE_ERROR_MESSA
GE
Reports a Web Dynpro exception to
a context attribute
Configuration of message
display
data:
    l_api_mycomp type ref to if_wd_window_controller,
    l_wd_message_area type ref to if_wd_message_area.
 
  l_api_mycomp ?= wd_this->wd_get_api( ).
  l_wd_message_area = l_api_mycomp-
>get_message_area( ).
  l_wd_message_area-
>set_display_attributes( i_for_all_instances = ' '
                                             i_msg_lines_visible = '0'
                                             i_use_toggle_area   = '  '
                                             i_show_only_current = ' ' ).
Description of settings
Setting Description
i_use_toggle_area = ' ' New design of the message area (default setting)

i_use_toggle_area = 'X' Old design of the message area (with the toggle
area)

 
i_msg_lines_visible = 0 All messages are immediately visible (default
setting)

i_msg_lines_visible = <x> x > 0. Only x messages are immediately visible;


the rest become visible by scrolling.

 
i_show_only_current = 'X' Together with i_use_toggle_area = ' ' this means
that no message log can be displayed (default
setting)

i_show_only_current = ' ' Together with i_use_toggle_area = ' ' this means


that a link takes you to where the message log
can be displayed
Search Help

Company Logo
Two pre-implemented input
helps
OVS help
ABAP Dictionary Search Help
ABAP Search help
This input help is based on the search
help function of the ABAP Dictionary
in the SAP system. So you use search
helps for data elements and
structures defined in the ABAP
Dictionary so far as these are
supported by Web Dynpro.
Example
OVS help
You can use Object Value Selection
input help if it is not possible to carry
out the search using the ABAP
Dictionary, for example, if the value
set is to be calculated in the Web
Dynpro application.
Event OVS
The callback to the using component
is implemented through the OVS
event at the interface controller of the
OVS component. This event is
automatically triggered four times,
one after the other . It passes
parameter OVS_CALLBACK_OBJECT of
type IF_WD_OVS to the corresponding
event handler in the application
component. The phase is determined
from instance attribute
Various phase indicators
PHASE_INDICATOR = IF_WD_OVS=>CO_PHASE_0
PHASE_INDICATOR = IF_WD_OVS=>CO_PHASE_1
PHASE_INDICATOR = IF_WD_OVS=>CO_PHASE_2
PHASE_INDICATOR = IF_WD_OVS=>CO_PHASE_3

Você também pode gostar