21
SAP Web Dynpro for ABAP SAP’s WebDynpro for ABAP is a revolutionary step in the development of Web based user interfaces. It is completely unlike any design paradigm previously used by SAP and represents a quantum leap in the development of Web based enterprise resource planning (ERP) applications. 1

SAP WEB DYNOPRO FOR ABAP

  • Upload
    itplant

  • View
    80

  • Download
    1

Embed Size (px)

DESCRIPTION

SAP WEB DYNOPRO FOR ABAP

Citation preview

Page 1: SAP WEB DYNOPRO FOR ABAP

SAP Web Dynpro for ABAP

SAP’s WebDynpro for ABAP is a revolutionary step in the development of Web based user interfaces. It is completely unlike any design paradigm previously used by SAP and represents a quantum leap in the development of Web based enterprise resource planning (ERP) applications.

1

Page 2: SAP WEB DYNOPRO FOR ABAP

Web Dynpro applications are built using declarative programming techniques based on the Model view Controller (MVC) paradigm. That is, you specify which user interface elements you wish to have on the client, and where those elements will get their data from.

You also define the possible navigation paths declaratively in your application. All the code to create the user interface is then generated automatically within a standard run time framework. This relieves you from the repetitive coding tasks involved in writing HTML and making it interactive with JavaScript.

Ship-to-Party list Button

2

Page 3: SAP WEB DYNOPRO FOR ABAP

SAP ABAP WebDynpro has been available since SAP Netweaver 7.0 (SAP NetWeaver Application Server 7.0). For developing the entities of Web Dynpro Application, the Object Navigator (transacti0on code SE80) has been enhanced. SAP WebDynpro is designed to support structured development. The software modularization units are Web Dynpro components, which can be combined to build up complex applications in SAP.

Meta Model Declaration vs. Custom Codding

Meta Model Declarations Custom Coding

Guarantees Common app.Design Good for data-driven, dynamic apps

@ Screen layout and nesting @ Implementation of business rules

@ Navigation and error handling @ Dynamic screen modifications

@ Data flow @ Access to services ( files, etc )

@ Componentization @ Portal eventing

3

Page 4: SAP WEB DYNOPRO FOR ABAP

The Web Dynpro framework allows you to place the custom source code at predefined positions within the generated code.

All SAP ABAP WebDynpro application are constructed from the same basic units. However, throught the use of custom codding, the standard framework can be extended to supply any required business functionality. Not all implementation decisions need to be made at design time. It is possible to implement a Web Dynpro application in which the appearance of the user interface is decided at run time. This allows a hightly flexible application to be written without the need to directly write any HTML .

4

Page 5: SAP WEB DYNOPRO FOR ABAP

APPLICATION SCENARIOS WITH WEB DYNPRO

Internet Browser, Mobile, Tablet

5

Page 6: SAP WEB DYNOPRO FOR ABAP

Web Dynpro applications can access different kinds of data sources:

~ From an SAP ABAP WebDynpro application, all kinds of reuse components can be addressed directly (for example, function modules or methods). It is even possible to access the database via an ABAP SELECT, However, this leads to a maxing between flow logic and business logic and should therefore be omitted.

~ Web Services can be used after having generated a Web Service client object. ~ Model objects are not yet supported int SAP ABAP Web Dynpro. The best way to have reusable entites encapsulating business logic is to create ABAP classes containing the source code.

It is also possible to develop UI-Free (Faceless) Web Dynpro components, which only offer reusable functionality. These components can then be accessed by other Web Dynpro components by means of component reuse.

6

Page 7: SAP WEB DYNOPRO FOR ABAP

BENEFITS OF SAP WEB DYNPRO ABAPWeb Dynpro’s main goal is to enable application developers to create powerful Web applications with minimum effort using descriptive tools in a structured design process.

One guiding principle in the Web Dynpro philosophy is : The fewer lines offhand written code, the better. Web Dynpro pursues this goal in two ways.

7

Page 8: SAP WEB DYNOPRO FOR ABAP

Example:How to use an input box, a button and ALV table to query SAP database and display data on a Web Dynpro view.

Dynpro ViewINPUT BOX

Button

8

Page 9: SAP WEB DYNOPRO FOR ABAP

Step 1: Call SAP transaction SE80 Object Navigator and start developing your first Web Dynpro component.

Step 2: In Transport Organizer tab, choose Web Dynpro Comp. / Intf. menu option to display, view or edit existing SAP Web Dynpro components or to create new Web Dynpro component.If you want to create a new WebDynpro application, type the name you want to assign in the input text area just below the Web Dynpro Comp. / Intf. selection. Then press Enter.

When the pop-up to confirm new SAP Web Dynpro component creation, press Yes.

9

Page 10: SAP WEB DYNOPRO FOR ABAP

Provide Web Dynpro component description

SAVE in local object & Look like in SE80

10

Page 11: SAP WEB DYNOPRO FOR ABAP

Component in Web Dynpro:SALV_WD_TABLE ALVSALV_WD_TABLEWDR_SELECT_OPTIONS

11

Page 12: SAP WEB DYNOPRO FOR ABAP

Web Dynpro ComponentController and Data Context:

Right click, create Node

Add Attributes From Structure

11

Page 13: SAP WEB DYNOPRO FOR ABAP

Map ALV Table Data to Context:

Click Controller Usage button.

13

Page 14: SAP WEB DYNOPRO FOR ABAP

Dobule Click

14

Page 15: SAP WEB DYNOPRO FOR ABAP

Design User Interface using MAIN View

Layout & Right Click

15

Page 16: SAP WEB DYNOPRO FOR ABAP

On Layout tab, right click on ROOTUIELEMENTCONTAINER and choose Create Container Form

16

Page 17: SAP WEB DYNOPRO FOR ABAP

SAVE

Now click on button and on button properties window on the bottom right of the SE80 screen, add a text which will be visible to your SAP users. And to define an action for the button, on Events section at onAction line press the Create icon as shown below.

17

Page 18: SAP WEB DYNOPRO FOR ABAP

double click on onAction value "ACTION_FILTER_SHIPTO"

Web Dynpro Component Windows:- Embedded view .......add and save .... view in page view

18

Page 19: SAP WEB DYNOPRO FOR ABAP

SAP Web Dynpro Programming using ABAPDouble Click and open method Press Wizard button

19

Page 20: SAP WEB DYNOPRO FOR ABAP

data LO_ND_FILTER_SHIPTO type ref to IF_WD_CONTEXT_NODE.

data LO_EL_FILTER_SHIPTO type ref to IF_WD_CONTEXT_ELEMENT.data LS_FILTER_SHIPTO type WD_THIS->ELEMENT_FILTER_SHIPTO.

* navigate from <CONTEXT> to <FILTER_SHIPTO> via lead selectionLO_ND_FILTER_SHIPTO = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_FILTER_SHIPTO ).

* @TODO handle non existant child* IF lo_nd_filter_shipto IS INITIAL.* ENDIF.

* get element via lead selectionLO_EL_FILTER_SHIPTO = LO_ND_FILTER_SHIPTO->GET_ELEMENT( ).* @TODO handle not set lead selectionif LO_EL_FILTER_SHIPTO is initial.endif.

* get all declared attributesLO_EL_FILTER_SHIPTO->GET_STATIC_ATTRIBUTES(importingSTATIC_ATTRIBUTES = LS_FILTER_SHIPTO ).

check LS_FILTER_SHIPTO-SHIPTO is not initial.data LV_KUNNR type KUNNR.LV_KUNNR = LS_FILTER_SHIPTO-SHIPTO.

data: LT_PROFORMA_ITEMS type /BSHS/SOM_TR_CSC_PROFOR_T_VBAP.call function '/BSHS/SOM_TR_CSC_OPENORDERITEM'exportingP_KUNNR = LV_KUNNRimportingT_PROFORMA_ITEMS = LT_PROFORMA_ITEMS.

20

Page 21: SAP WEB DYNOPRO FOR ABAP

data LO_ND_OPENITEMS type ref to IF_WD_CONTEXT_NODE.data LT_OPENITEMS type WD_THIS->ELEMENTS_OPENITEMS.

* navigate from <CONTEXT> to <OPENITEMS> via lead selectionLO_ND_OPENITEMS = WD_CONTEXT->GET_CHILD_NODE( NAME = WD_THIS->WDCTX_OPENITEMS ).

* @TODO handle non existant child* IF lo_nd_openitems IS INITIAL.* ENDIF.

** @TODO compute values** e.g. call a model functionLO_ND_OPENITEMS->BIND_TABLE( NEW_ITEMS = LT_OPENITEMS SET_INITIAL_ELEMENTS = ABAP_TRUE ).

LT_OPENITEMS[] = LT_PROFORMA_ITEMS[].

OUTPUT:Double Click on Web Dynpro Application -> F8

Thanks......

21