42
08/05/15 © 2007 Intelligroup, Inc. Confidential and 1 Learning Objectives As a result of this workshop, you will be able to: Appreciate the importance of WD4A Describe the eclarative programming approach use to create Web Dynpro applications !nerstan the benefits resulting from the metaata approach List the most important elements that are part of a Web Dynpro application "e able to create basic Web Dynpro applications in A"A#

ABAP Dynpros.ppt

Embed Size (px)

Citation preview

  • 5/17/2018 ABAP Dynpros.ppt

    1/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    1

    Learning Objectives

    As a result of this workshop, you will be able to:

    Appreciate the importance of WD4A

    Describe the eclarative programming approach use to createWeb Dynpro applications

    !nerstan the benefits resulting from the metaata approach

    List the most important elements that are part of a Web Dynproapplication

    "e able to create basic Web Dynpro applications in A"A#

  • 5/17/2018 ABAP Dynpros.ppt

    2/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    2

    Web "ase Applications $ %volution

    &n the past,great efforts went into the architecture an esign of theevelopment of web base applications'"efore even the first line ofbusiness process logic coul be implemente,various characteristics ofinternet communication ha to be consiere such as:

    ())# :*ommunication protocol for the internet'&t is base on

    re+uestresponse moel'

    !ser frienliness :

    ()-L provies static te.t an only limite options for

    presenting user interface elements or receiving user input

  • 5/17/2018 ABAP Dynpros.ppt

    3/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    3

    Web "ase Applications / %volution cont00

    *ost$efficiency:

    )he evelopers of web base applications nee to consier

    such factors as internationali1ation,navigation options an

    interaction that entails often hunres of pages'

    &ntegration an 2ecurity aspects :

    3umerous systems in a heterogeneous system lanscape

    must be smoothly integrate'&n many cases,this involves back

    en systems of an enterprise so that security aspects are

    ahere to in orer to protect the enterprise ata'

  • 5/17/2018 ABAP Dynpros.ppt

    4/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    4

    2A# Developments in the area of !& )echnologies

    1965

    1970

    1975

    1980

    1985

    1990

    1995

    2000

    20052010

    Mainframe

    (SAP R/2)

    Client-

    Server (SAP

    R/3)

    We-!a"e#

    $%S

    We-!a"e#

    !SP

    We &'nr

  • 5/17/2018 ABAP Dynpros.ppt

    5/42

    A technology that is best suited for

    developing ABAP-based webapplications

    High Speedlow cost and standardi!ed"#s

    $he answer is------------------------------------------%

  • 5/17/2018 ABAP Dynpros.ppt

    6/42

    Web Dynpro or A"A#

  • 5/17/2018 ABAP Dynpros.ppt

    7/4208/05/15 2007 Intelligroup, Inc. Confidential and

    &

    What is Web Dynpro 5

    A Programming Model for User Interfaces Defines a stanar structure for user interface applications

    Derive from the -6* 78moel$view$controller9 esign pattern

    A Set of Tools for User Interface Design

    ocus on graphical moelling

    *oe is generate from meta$moel eclarations

    &ntegrate in 2A# 3etWeaver Developer 2tuio an the A"A# Workbench

    A Runtime Environment for Applications

    ramework running on 2A# Web A2 server offers common services

    A Technolog for Soft!are Modulari"ation

    *omponents help structure applications an support pattern$base !&s

  • 5/17/2018 ABAP Dynpros.ppt

    8/4208/05/15 2007 Intelligroup, Inc. Confidential and

    '

    -eta$moel Declarations an *ustom *oing

    Meta#model Declarations

    ;uarantees common app' esign

    ;oo for graphical tool support

    2creen Layout an 3esting

    3avigation an %rror (anling

    Data low

    *omponenti1ation

    '''

    $ustom $oding

    ;uarantees universality

    ;oo for ata$riven, ynamic apps

    &mplementation of business rules

    Dynamic screen moifications

    Access to services 7files etc'

    #ortal eventing

    '''

    We

    &'nr

    %l"

    *enerate#C#e

    *eneratr

    Meta-#ata C)m(iler

    R+naleA((

    C+"tm

    C#e

  • 5/17/2018 ABAP Dynpros.ppt

    9/4208/05/15 2007 Intelligroup, Inc. Confidential and

    (

    Application 2cenarios With Web Dynpro

    ,2

    We &'nr

    R+ntime

    ,2

    We &'nr

    R+ntime

    We &'nr

    A

    We &'nr

    AWe &'nr

    A

    We &'nr

    A

    SAP nterri"e Prtal

    SAP

    .etWeaver

    &eveler

    St+#i

    SAP

    .etWeaver

    &eveler

    St+#i

    A!AP

    We &'nr

    R+ntime

    We &'nr

    A

    We &'nr

    AWe &'nr

    A

    We &'nr

    A

    A!AP

    Wren

    ,2

    Server!aen# Aliatin!aen# Aliatin

    A!AP

    Server

    RMI

    RFC, WS

    !+"ine""

    &ata

    !+"ine""

    &ata

    !+"ine""

    AP$ (!AP$

    We Servie")

    ,! (ea),! (ea)

    We &'nr i4ieWe &'nr i4ie We &'nr i4ieWe &'nr i4ie MS ClientMS Client

  • 5/17/2018 ABAP Dynpros.ppt

    10/4208/05/15 2007 Intelligroup, Inc. Confidential and

    1)

    Web Dynpro -ain "enefits

    Deliver an Enterprise %ualit

    &e' Development Environment %nforce clear separation between !& logic

    an business logic

    Little coing, lots of esign

    Declarative !& evelopment

    Achieve Independence run on multiple platforms

    Improve User E(perience

    through a )*igh +idelit &e' UI)

    browser base, 1ero footprint

    screen upates wo page reloas client$sie ynamics

    performance through caching

    accessibility support

    Web Dynpro

    Metadata

    Web Dynpro

    Tools

    Web Dynpro RuntimeJAVA ABAP

  • 5/17/2018 ABAP Dynpros.ppt

    11/42

    Mtivatin f We &'nr

    %e We &'nr Prrammin M#el

    4ie" an# $ element"

    Cntrller" an# Cntet

    .aviatin an# Pl+"

    S+l' +ntin"

    S+mmar'

  • 5/17/2018 ABAP Dynpros.ppt

    12/4208/05/15 2007 Intelligroup, Inc. Confidential and

    12

    -otivation Web Dynpro

    We &'nr

    Ren#erin

    nine

    Ren#erin

    nine

    Ren#erin

    nine

    We

    !r"er

    Smart

    Client ter:

    &e' Dnpro

    !& efinition inepenent ofclient technology

    as much abstract eclarationas possible

    Different renering engines

    for ifferent 7future !&technologies without aaptingapplication coing

    ::::::

    tt;//%M= ,S

    Meta &ata?ml@

    ?#;@

    ?/ml@

  • 5/17/2018 ABAP Dynpros.ppt

    13/42

    Mtivatin f We &'nr

    %e We &'nr Prrammin M#el

    4ie" an# $ element"

    Cntrller" an# Cntet

    .aviatin an# Pl+"

    S+l' +ntin"

    S+mmar'

  • 5/17/2018 ABAP Dynpros.ppt

    14/4208/05/15 2007 Intelligroup, Inc. Confidential and

    14

    Web Dynpro Development

    Development completel integrated

    into A,AP &or-'ench

    ;raphical 6iew Layout esign

    Declarative !& evelopment

    A"A# eitor with forwarnavigation

    A"A# ictionary ata types irectlyavailable

    2imple remote ebugging

    unctionality an services ofthe A"A# environment irectlyusable

    A,AP lifeccle management

    )ransport

    )ranslation

    %nhancements

  • 5/17/2018 ABAP Dynpros.ppt

    15/4208/05/15 2007 Intelligroup, Inc. Confidential and

    1*

    Original MVC design for decoupling presentation and

    application logic

    Re+e"t

    Re"n"e

    "er $nteratin =a'er

    !+"ine"" $nteratin =a'er

    !in#in =a'er

    Visualizes the application

    data without caring how itwas generated.

    Generates the application

    data without caring how it

    will be displayed.Binds the user and business

    interaction layers together. All

    intermediate processing is

    performed here.

    -oel 6iew *ontroller 7-6*

    Model

    View

    Controller

  • 5/17/2018 ABAP Dynpros.ppt

    16/4208/05/15 2007 Intelligroup, Inc. Confidential and

    1+

    Web Dynpro *omponent Architecture

    !+"ine"" =i

    (M#el")

    Component

    Controller

    Model 1

    Model 2

    Cntain" "ae

    #elaratin"

    sage

    declarations

    W e & ' n r C m n e n t

    Cmnent"

    CustomController

    Component !nterface

    !nterface

    Controller!nterface "iew

    #indow

    #indow

    Controller

    View

    $ayout

    ViewController

    M

    M

    M

    M

    M

    !nterface "iew

    SAP &e' Dnpro uses principles of M.$ paradigm

    Cntrller an#le te

    +"er in+t an# "teer"

    te aliatin

    4ie" #efine te la'+t

    M#el l#" an#

    rvi#e te +"ine""

    li

  • 5/17/2018 ABAP Dynpros.ppt

    17/4208/05/15 2007 Intelligroup, Inc. Confidential and

    1&

    Web Dynpro *omponents

    &e' Dnpro $omponent contains

    Winows

    6iews

    % !& elements

    % Layout

    *ontrollers

    % *onte.t Data

    % %venting

    % -ethos

    % Attributes

    *omponent &nterface% &nterface *ontr'

    % &nterface 6iew

    ComponentController

    Component

    #indow

    View

    ControllerView

    View

    ControllerView

  • 5/17/2018 ABAP Dynpros.ppt

    18/42

    Mtivatin f We &'nr

    %e We &'nr Prrammin M#el

    4ie" an# $ element"

    Cntrller" an# Cntet

    .aviatin an# Pl+"

    S+l' +ntin"

    S+mmar'

  • 5/17/2018 ABAP Dynpros.ppt

    19/4208/05/15 2007 Intelligroup, Inc. Confidential and

    1(

    #indow

    View

    6iew, Winows an !& %lements

    .ie!

    &s embee into winow Defines the visible layout via

    preefine !& elements

    Don?t contain any ()-L orscripting

    UI elements

    Are the smallest !& builing blocks7button, input fiel,0

    Available as provie !& elementlibraries

    (ave properties which steer

    their behavior *an be neste with *ontainer !&

    elements

    Are positione in hierarchicalstructure

  • 5/17/2018 ABAP Dynpros.ppt

    20/4208/05/15 2007 Intelligroup, Inc. Confidential and

    2)

    Defining 6iew Layout

    $

    elementlirarie"

    Prertie"

    f

    "elete#

    $

    element

    $

    elementtree f

    vie

    4ie

    la'+t

  • 5/17/2018 ABAP Dynpros.ppt

    21/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    21

    &ach ! element ob'ect is represented as an abstract class that is independent

    of any client presentation layer.

    !& %lement *ategories

    .arious categories of UI elements are supported

    e.g. Button(

    !nput)ield( $abel

    e.g. *ate+a"igator(

    ,able( ,ree

    e.g.,ransparentContaine

    r( ,ray

    -fficeControl

    Gantt( +etwor

    !nteracti"e)orm

    BusinessGraphics(

    GeoMap

    B! Application )rame

    MessageArea

  • 5/17/2018 ABAP Dynpros.ppt

    22/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    22

    DEM/

  • 5/17/2018 ABAP Dynpros.ppt

    23/42

    Mtivatin f We &'nr

    %e We &'nr Prrammin M#el

    4ie" an# $ element"

    Cntrller" an# Cntet

    .aviatin an# Pl+"

    S+l' +ntin"

    S+mmar'

  • 5/17/2018 ABAP Dynpros.ppt

    24/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    24

    *ontroller an *onte.t

    $ontroller

    *ontains the logic of the !& layer

    &mplements event hanlers

    @eas an writes conte.t noecontent

    %ach view has its own viewcontroller

    $onte(t

    (ierarchy of noes an attributes

    *ontains the ata of the !&

    3oes an attributes can be

    boun to !& elements ramework cares about upating

    the values

    View Controller

    Conte/t

    +ode .1

    +ode .2

    Attribute CARR

    Attribute &PBA$RP

    0oot +ode

    methodWD_DO_INIT

    node = wd_context->get_child_node(N1).

    node->set_atti!"te( na#e = D$%_&I'% al"e = %ais).

    Method on&ction_OTO_N$*T node = wd_context->get_child_node(N1).

    node->get_atti!"te( na#e = +&''

    al"e = caie ).

    =>

    Pari"

  • 5/17/2018 ABAP Dynpros.ppt

    25/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    2*

    #indow

    View View Controller

    6iew *ontroller an 6iew *onte.t

    Conte/t

    +ode .1

    +ode .2

    Attribute CARR

    Attribute &PBA$RP

    0oot +ode

    methodWD_DO_INIT

    node = wd_context->get_child_node(N1).

    node->set_atti!"te( na#e = D$%_&I'%

    al"e = %ais).

    Method on&ction_OTO_N$*T node = wd_context->get_child_node(N1).

    node->get_atti!"te( na#e = +&''

    al"e = caie ).

    =>

    Pari"

    Cntrller

    ntain"

    met#"

    an# event"

    fr +"erinteratin"

  • 5/17/2018 ABAP Dynpros.ppt

    26/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    2+

    View ControllerView

    *onte.t 3oe %lements

    Conte/t

    +ode 2

    0oot +ode+ode 1 Cardinality ...n3

    Airline $&

    Airline .ame

    R=

    +ode 1

    Airline $&

    Airline .ame

    R=

    #ethodWD_DO_INIT

    , caies intenal ta!le

    ...

    node->!ind_ele#ents( caies ).

    AC

    Air C

    A!

    Air !

    AA

    Amer

    lement" f

    a ntet

    n#e

  • 5/17/2018 ABAP Dynpros.ppt

    27/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    2&

    DEM/

  • 5/17/2018 ABAP Dynpros.ppt

    28/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    2'

    *omponent *ontroller an *onte.t -apping$omponent $ontroller

    *ontroller which is thebackbone of the component

    (as its own *onte.t

    *ontains the logic forinteraction with the moel7A"A# class, function moules,

    "A#&s, Web 2ervices

    $onte(t Mapping

    3oes of *omponent*ontroller conte.t can be

    mappe to noes of otherconte.ts

    ramework cares about atatransport 7references

    Component Controller

    Component Controller

    Conte/t

    0oot +ode

    +ode 1

    +ode 4

    +ode 2

    ethod show_/lights/lights = 0O->get

    node1 = wd_context->

    node1->!ind_ele#ents( /lights ).

    M#el

    Cla""

    A!AP

    Det"

    AP$

    !AP$"

    ter W&

    Cm-

    nent

    E

  • 5/17/2018 ABAP Dynpros.ppt

    29/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    2(

    Component Controller Component

    View Controller

    View

    Label

    Pre

    Conte/t

    0oot +ode+ode 1

    +ode 2

    Attribut1

    Attribut2

    #indow View Controller

    Conte/t

    +ode 1

    *onte.t -apping "etween 6iews

    View

    View Controller

    Label

    ViewConte/th

    0oot +ode

    +ode 1

    +ode 2

    Component Controller

    Conte/t

    0oot +ode

    +ode 1

    +ode 4

    +ode 2

    Main f

    ntet #ata

    => =>

    =>

    "er enter"

    #ata

    0oot +ode

    Label

  • 5/17/2018 ABAP Dynpros.ppt

    30/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    3)

    Component Controller Component

    #indow

    View Controller

    Conte/t

    +ode 1

    *omponent *ontroller

    View

    Component Controller

    Conte/t

    0oot +ode

    +ode 1

    +ode 4

    +ode 2

    Main f

    ntet #ata

    0oot +ode

    ethod show_/lights/lights = 0O->get

    node1 = wd_context->

    node1->!ind_ele#ents(

    /lights ).

    Cmnent

    ntrller nnet"

    t +"ine"" li

    an# et"/"et" #ata

    M#el Cla""

    A!AP

    Det" AP$

    !AP$"

    ter W&

    Cmnent

    E

  • 5/17/2018 ABAP Dynpros.ppt

    31/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    31

    DEM/

  • 5/17/2018 ABAP Dynpros.ppt

    32/42

    Mtivatin f We &'nr

    %e We &'nr Prrammin M#el

    4ie" an# $ element"

    Cntrller" an# Cntet

    .aviatin an# Pl+"

    S+l' +ntin"

    S+mmar'

  • 5/17/2018 ABAP Dynpros.ppt

    33/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    33

    Win#

    3avigation "etween 6iews

    To defne the navigation between two views, you need to create exitand entry points or each view using outbound and inbound plugs.

    Only then you can speciy the navigation ow using navigation links

    +t+n# l+

    .aviatin lin

    $n+n# l+

    C+"tmer

    =i"t

    C+"tmer

    Sear

    +t $n

  • 5/17/2018 ABAP Dynpros.ppt

    34/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    34

    #indow

    View ControllerView

    View Controller

    +t+n#

    Pl+

    #lugs an 3avigation

    View

    SARC>B=$*>%S

    $n+n# Pl+

    Create

    Atin

    -,

    $.

    -,

    $.

    $.

    -,

  • 5/17/2018 ABAP Dynpros.ppt

    35/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    3*

    DEM/

  • 5/17/2018 ABAP Dynpros.ppt

    36/42

    Mtivatin f We &'nr

    %e We &'nr Prrammin M#el

    4ie" an# $ element"

    Cntrller" an# Cntet

    .aviatin an# Pl+"

    S+l' +ntin"

    S+mmar'

  • 5/17/2018 ABAP Dynpros.ppt

    37/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    3&

    *onte.t 3oe at Design )ime

    Declaration of $onte(t 0odes

    *reate metaata which efinesthe structure of the conte.t

    )wo imensional hierarchy likefiles an folers

    "ut each noe can be a collection

    -in an ma. number of elementsin a noe issteere by *arinality

    % 7=''

    % 7''

    % 7=''n

    % 7''n

    Conte/t

    =$*>%S (0n)

    Airline !*

    )light +r

    *ate

    Rt .#e

    Booing +r

    Customer

    SF

    203

    051003

    !G$.*S (0En)

    A*.CH (1E1)

  • 5/17/2018 ABAP Dynpros.ppt

    38/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    3'

    *omple. Data in *onte.t 3oe

    E(ample1 +lights !ith 'oo-ings

    "ookings for a selecte flightshoul be isplaye in secon

    table on the same view %ach flight has its own set of

    bookings

    View ControllerConte/t

    =$*>%S (0n)

    Airline !*

    )light +r

    *ate

    Rt .#e

    Booing +r

    Customer

    SF

    203

    051003

    SR

    Si""

    A

    0I07

    052709

    =>

    I030

    051223

    !G$.*S

    $onte(t at runtime

    3oes with carinality 7=''ncan contain several elementsat runtime

    %ach element can have its ownset of sub noes at runtimewhich are again collections of

    elements

  • 5/17/2018 ABAP Dynpros.ppt

    39/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    3(

    2upply unction of *onte.t 3oe

    Suppl +unction

    &s triggere if leaselection of parentelement changes

    &s implemente as methoof controller

    (as access to parentelement

    )ypically use whensubstructure of conte.tnoes with severalelements has to be fille'lights / "ookings,*ustomers / Orers,0

  • 5/17/2018 ABAP Dynpros.ppt

    40/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    4)

    DEM/

  • 5/17/2018 ABAP Dynpros.ppt

    41/42

    08/05/15 2007 Intelligroup, Inc. Confidential and

    41

    2ummary

    Web Dynpro is 2A#?s !& strategy Declarative, -6* base !& programming

    moel

    !& efinition inepenent of reneringtechnology

    Web Dynpro for A"A# available with 2A#

    3etWeaver B==4s #rogramming moel similar to Web

    Dynpro for Cava

    *ompletely &ntegrate into the 2A#3etWeaver Application 2erver A"A#

  • 5/17/2018 ABAP Dynpros.ppt

    42/42

    42

    T*A02 3/U +/R 3/UR ATTE0TI/0 4

    QUESTIOS ! SU""ESTIOS ! #ISCUSSIO