exercise unit object value help

Upload: apurva2009

Post on 04-Jun-2018

227 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Exercise Unit Object Value Help

    1/17

    Web Dynpro for ABAP

    Exercise Unit: Using Object Value Help. Estimated Time: 35 minutes

    NOTES:

    If you wish to find out more about any field, first select that field and then hit F1.

    Logon to the !" system and start !#!" $or%bench &E'(). Logon data is *ro+ided by your

    instructor. a+e all your obects as local obects &*ac%age name -T").

    PURPOSE:

    !t the end of this Tutorial you will be able to

    /nderstand how larger $eb 0yn*ro *roects can be structured with se+eral $eb 0yn*rocom*onents

    #e able to include a reusable $eb 0yn*ro com*onent into another $eb 0yn*ro com*onent

    now how methods of an used $eb 0yn*ro2s Interface ontroller is called

    PREREQUISITES:

    Logon to the !" system and start !#!" $or%bench &E'(). Logon data is *ro+ided by your instructor.

    PROCEDURE:

    Page 1 janvier 31, 2014

  • 8/13/2019 Exercise Unit Object Value Help

    2/17

    Web Dynpro for ABAP

    Create the Web Dynpro Component !""!#$%U&!HE'%

    STEPS:

    1. tart the !#!" $or%bench &se80) and create the new $eb 0yn*ro com*onent 44((I6"/T7EL"

    (. De)ine a Component Usage o) the *tan+ar+ Web Dynpro Component

    WD!OV*

    0efine the com*onent usage of the tandard $089 $eb 0yn*ro com*onent.

    Page ( janvier 31, 2014

  • 8/13/2019 Exercise Unit Object Value Help

    3/17

    Web Dynpro for ABAP

    ,. De)ine an -ssistance Class )or the Component an+ maintain text element

    reate an !ssistance lass for maintaining the te;t symboles for the a**lication.

    0ouble lic% on the !ssistance lass name and from the enu Te;t Elements to created or edit te;telements.

    reate the following Te;t Elements in the assistance class created.

    Page , janvier 31, 2014

  • 8/13/2019 Exercise Unit Object Value Help

    4/17

    Web Dynpro for ABAP

    . Create /-#$ Vie0

    reate a iew in the $eb 0yn*ro com*onent with the name !I6.

    Page janvier 31, 2014

  • 8/13/2019 Exercise Unit Object Value Help

    5/17

    Web Dynpro for ABAP

    . Create context *2'#3H& o) the /-#$ Vie0

    reate a node with the FLI

  • 8/13/2019 Exercise Unit Object Value Help

    6/17

    Web Dynpro for ABAP

    4. #nstatiate the Usage o) the component WD5!OV* in the Vie0 Controller

    an+ the Win+o0 Controller

  • 8/13/2019 Exercise Unit Object Value Help

    7/17

    Web Dynpro for ABAP

    1. Create /-#$ Vie0 'ayout

    In the layout of +iew !I6 IEW create a T8!? called T8!?7EL". Enter @elect the FlightsA in the !"TI96*ro*erty of CAPTION1 of T8!? T8!?7EL".

    Inside TRAY_HELP create labels and in*ut fields for the two attributes CARRID and CONNID of conte;t nodeNODE_FLIGHT.

    7int: /se function Create Container Form out of the conte;t menu of T8!?7EL".

    (. Create metho+ O$!OV* on e6ent OV*

  • 8/13/2019 Exercise Unit Object Value Help

    8/17

    Web Dynpro for ABAP

    Ta%e FB hel* on the e+ent colmn and e+ent O!" needs to be selected.

  • 8/13/2019 Exercise Unit Object Value Help

    9/17

    Web Dynpro for ABAP

    data: lsearchin*ut ty*e tstruin*ut,

    lselectlist ty*e table of tstrulist,

    lte;t ty*e wdrname+alue,

    llabelte;ts ty*e wdrname+aluelist,

    lcolumnte;ts ty*e wdrname+aluelist,

    lwindowtitle ty*e string,

    lgrou*header ty*e string,

    ltableheader ty*e string,

    lselo*t ty*e ba*isfldra,

    lselo*ttab ty*e table of ba*isfldra,

    lflightlist ty*e table of ba*isfldat,

    lba*ireturn ty*e table of ba*iretD,

    waselectlist ty*e tstrulist,

    waflightlist ty*e ba*isfldat,

    la*i ty*e ref to ifwd+iewcontroller,

    lmsgmanager ty*e ref to ifwdmessagemanager,

    waba*ireturn ty*e ba*iretD,

    lmsgte;t ty*e string,

    lflights ty*e table of sflight.

    field>symbols: uery*arams= ty*e tstruin*ut,

    selection= ty*e tstrulist.

    case o+scallbac%obect>=*haseindicator.

    Page 9 janvier 31, 2014

  • 8/13/2019 Exercise Unit Object Value Help

    10/17

    Web Dynpro for ABAP

    when ifwdo+sG=co*hase(. Hconfiguration *hase, may be omitted

    C in this *hase you ha+e the *ossibility to define the te;ts,

    C if you do not want to use the defaults &00I>te;ts)

    lte;t>name G E!8L?. Hmust match a field name of search

    lte;t>+alue G wdassist>=ifwdcom*onentassistanceJgette;t& %ey G ((1 ).

    insert lte;t into table llabelte;ts.

    lte;t>name G L!TE. Hmust match a field name of search

    lte;t>+alue G wdassist>=ifwdcom*onentassistanceJgette;t& %ey G ((D ).

    insert lte;t into table llabelte;ts.

    C lte;t>name G K9L/61K. Hmust match a field in list structure

    C lte;t>+alue G K?TETDK. Hwdassist>=gette;t& K((DK ).

    C insert lte;t into table lcolumnte;ts.

    lwindowtitle G wdassist>=ifwdcom*onentassistanceJgette;t& %ey G ((3 ).

    lgrou*header G wdassist>=ifwdcom*onentassistanceJgette;t& %ey G ((B ).

    ltableheader G wdassist>=ifwdcom*onentassistanceJgette;t& %ey G ((5 ).

    C lwindowtitle G wdassist>=gette;t& K((3K ).

    C lgrou*header G wdassist>=gette;t& K((BK ).

    C ltableheader G wdassist>=gette;t& K((5K ).

    o+scallbac%obect>=setconfiguration&

    Page 1" janvier 31, 2014

  • 8/13/2019 Exercise Unit Object Value Help

    11/17

    Web Dynpro for ABAP

    labelte;ts G llabelte;ts

    columnte;ts G lcolumnte;ts

    grou*header G lgrou*header

    windowtitle G lwindowtitle

    tableheader G ltableheader

    colcount G D

    rowcount G D( ).

    when ifwdo+sG=co*hase1. Hset search structure and defaults

    C In this *hase you can set the structure and default +alues

    C of the search structure. If this *hase is omitted, the search

    C fields will not be dis*layed, but the selection table is

    C dis*layed directly.

    C 8ead +alues of the original conte;t &not necessary, but you

    C may set these as the defaults). ! reference to the conte;t

    C element is a+ailable in the callbac% obect.

    o+scallbac%obect>=conte;telement>=getstaticattributes&

    im*orting staticattributes G lsearchin*ut ).

    C *ass the +alues to the 9 com*onent

    o+scallbac%obect>=setin*utstructure&

    in*ut G lsearchin*ut ).

    when ifwdo+sG=co*haseD.

    C If *hase 1 is im*lemented, use the field in*ut for the

    C selection of the table.

    C If *hase 1 is omitted, use +alues from your own conte;t.

    Page 11 janvier 31, 2014

  • 8/13/2019 Exercise Unit Object Value Help

    12/17

    Web Dynpro for ABAP

    if o+scallbac%obect>=uery*arameters is not bound.

    CCCCCCCC T909 e;ce*tion handling

    endif.

    assign o+scallbac%obect>=uery*arameters>=C

    to uery*arams=.

    if not uery*arams= is assigned.

    CCCCCCCC T909 e;ce*tion handling

    endif.

    C call business logic for a table of *ossible +alues

    C lselectlist G MMM

    lselo*t>low G uery*arams=>early.

    lselo*t>high G uery*arams=>late.

    lselo*t>o*tion G #T.

    lselo*t>sign G I.

    insert lselo*t into table lselo*ttab.

    call function #!"IFLI=getmessagemanager& ).

    Page 1( janvier 31, 2014

  • 8/13/2019 Exercise Unit Object Value Help

    13/17

    Web Dynpro for ABAP

    loo* at lba*ireturn into waba*ireturn where ty*e G E or ty*e G !.

    lmsgte;t G waba*ireturn>message.

    lmsgmanager>=re*orterrormessage& messagete;t G lmsgte;t ).

    endloo*.

    loo* at lflightlist into waflightlist.

    waselectlist>carrid G waflightlist>airlineid.

    waselectlist>connid G waflightlist>connectid.

    waselectlist>fldate G waflightlist>flightdate.

    insert waselectlist into table lselectlist.

    endloo*.

    o+scallbac%obect>=setout*uttable& out*ut G lselectlist ).

    when ifwdo+sG=co*hase3.

    C a**ly result

    if o+scallbac%obect>=selection is not bound.

    CCCCCCCC T909 e;ce*tion handling

    endif.

    assign o+scallbac%obect>=selection>=C to selection=.

    if selection= is assigned.

    C o+scallbac%obect>=conte;telement>=setattribute&

    C name G K9L/61K

    C +alue G selection=>column1 ).

    o+scallbac%obect>=conte;telement>=setstaticattributes&

    staticattributes G selection= ).

    endif.

    endcase.

    Page 1, janvier 31, 2014

  • 8/13/2019 Exercise Unit Object Value Help

    14/17

    Web Dynpro for ABAP

    ,. -ttach the create+ OV* help to CO$$#D )iel+ in the Vie0 Context.

    7ere we will try acti+ating the standard searchel* for !88I0 field in the IE$ conte;t and will learn to attachthe created 9 to the 966I0 field of the IE$ onte;t.

    Page 1 janvier 31, 2014

  • 8/13/2019 Exercise Unit Object Value Help

    15/17

    Web Dynpro for ABAP

    . Embe+ the /-#$ 6ie0 in the Win+o0

  • 8/13/2019 Exercise Unit Object Value Help

    16/17

    Web Dynpro for ABAP

    9n *ressing FB hel* for CARRID , following hel* should be *ro+ided.

    9n *ressing FB hel* on Flight 0ate, followinh should be the screen seuence.

    Page 14 janvier 31, 2014

  • 8/13/2019 Exercise Unit Object Value Help

    17/17

    Web Dynpro for ABAP

    Page 17 janvier 31,2014