Accessing ABAP Functions in Web Dynpro Java

Similar documents
Consuming Web Dynpro components in Visual Composer.

MDM Syndicator Create Flat Syndication File

How to Browse an Enterprise Services Registry in Visual Composer

Web Dynpro Java for Newbies: a Quick Guide to Develop Your First Application

Tutorial: Consuming Web Services in Web Dynpro Java

Visual Composer - Task Management Application

SAP GRC Access Control: Configuring compliant user provisioning (formerly Virsa Access Enforcer) into CUA Systems

A Step-By-Step Guide on File to File Scenario Using Xslt Mapping

How to Use Function Keys in Mobile Applications for Handhelds

How To Set up NWDI for Creating Handheld Applications in SAP NetWeaver Mobile 7.1

How To Customize the SAP User Interface Using Theme Editor

Handling Transactions with BAPIs in Web Dynpro

Simplified Configuration of Single System Update in Maintenance Optimizer

Enterprise Portal Logon Page Branding

Data Validation in Visual Composer for SAP NetWeaver Composition Environment

Do Exception Broadcasting

How to Create a New SAPUI5 Development Component

How To Configure IDoc Adapters

Building a Composite Business Process from Scratch with SAP NetWeaver BPM Guide 2

How To... Reuse Business Objects and Override Operations of a Business Object

How To Configure the Websocket Integration with SAP PCo in SAP MII Self Service Composition Environment Tool

Visual Composer Build Process

Creating Your First Web Dynpro Application

Cache Settings in Web Page Composer

Install TREX for CAF Version 1.00 March 2006

How To Develop a Simple Web Service Application Using SAP NetWeaver Developer Studio & SAP XI 3.0

How to Translate a Visual Composer Model Part I

How to Set Up and Use the SAP OEE Custom UI Feature

How To... Promote Reports and Input Schedules Through Your System Landscape

configure an anonymous access to KM

How to Upgr a d e We b Dynpro Them e s from SP S 9 to SP S 1 0

Quick Reference Guide SAP GRC Access Control Compliant User Provisioning (formerly Virsa Access Enforcer): HR Triggers

Visual Composer for NetWeaver CE: Getting Started with a Typical Workflow

How To Recover Login Module Stack when login to NWA or Visual Administrator is impossible

SAP NetWeaver How-To Guide

What s New / Release Notes SAP Strategy Management 10.1

Working with Select Options in Web Dynpro for ABAP

SAP NetWeaver How-To Guide

Web Page Composer anonymous user access

How to View Dashboards in the Self Service Composition Environment with Additional Metadata

How To... Configure Integrated Configurations in the Advanced Adapter Engine

Value Help in Web Dynpro ABAP - Tutorial.

How To...Configure Integration of CUP with SPM

Building a Tax Calculation Application

Using Business Graphics

Configure UD Connect on the J2EE Server for JDBC Access to External Databases

Integrating a Web Service in a Composite Application. SAP Composite Application Framework

How To Extend User Details

How-To... Add Sensitive Content into an Area

Configure SSO in an SAP NetWeaver 2004s Dual Stack

How to Set Up and Use the SAP OEE Custom KPI Andons Feature

How To...Use a Debugging Script to Easily Create a Test Environment for a SQL-Script Planning Function in PAK

Introducing SAP Enterprise Services Explorer for Microsoft.NET

How to Use Definitions in Rules Composer

link SAP BPC Excel from an enterprise portal Version th of March 2009

Integrate a Forum into a Collaboration Room

Monitoring System Landscapes Using the DBA Cockpit

How To... Master Data Governance for Material: BADI USMD_SSW_SYSTEM_METHOD_CALLER to create successor change request

WDA - Custom themes for Web Dynpro ABAP applications without SAP Enterprise Portal integration

Setting Up an Environment for Testing Applications in a Federated Portal Network

How To Generate XSD Schemas from Existing MDM Repositories

Create Partitions in SSAS of BPC Version 1.00 Feb 2009

Process Control 2.5 Implementation Checklist

Setup an NWDI Track for Composition Environment Developments

How To... Master Data Governance for Material: BADI USMD_SSW_PARA_RESULT_HANDLER to merge result of parallel workflow tasks

View Time Security for crystalreports.com

How To Troubleshoot SSL with BPC Version 1.01 May 2009

SAP NetWeaver How-To Guide How to use Process Execution Manager Using SAP Test Data Migration Server

Use Business Objects Planning and Consolidation (version for the Microsoft platform) BPF services in Xcelsius

Transport in GP. How-to Guide Beginning with SAP NetWeaver 2004s SPS06. Version 2.00 January 2006

How-to Guide SAP NetWeaver 04. Web Dynpro Themes. Version Applicable Releases: SAP NetWeaver 7.0

Setting up Single Sign On Between xmii and Enterprise Portal

Consuming Directory API in ABAP

How To... Master Data Governance for Material: File Down- and Upload

How to Use Other Conditions in Decision Tables in Rules Composer

SAP Composite Application Framework. Creating a Content Package Object

SAP MII: Leveraging the Data Buffering Feature for Connection Error Handling.

SDN Contribution HOW TO CONFIGURE XMII BUILD 63 AND IIS 6.0 FOR HTTPS

Advanced Input Help - The Object Value Selector (OVS)

Authentication of a WS Client Using a SAP Logon Ticket

Work with Variables in SAP NetWeaver Visual Composer Version 1.00 May 2006

SAP NetWeaver How-To Guide. SAP NetWeaver Gateway Virtualization Guide

SAP Composite Application Framework. Creating an External Service type Callable Object in Guided Procedures

Extract Archived data from R3

SAP NetWeaver 04. Unification Terminology

Extracting Product Attributes in XML using Web Service

Preview of Web Services Reliable Messaging in SAP NetWeaver Process Integration 7.1

xmii UDS Overview and Troubleshooting

How To... Configure Drill Through Functionality

How To Integrate the TinyMCE JavaScript Content Editor in Web Page Composer

Using Tools to Represent Appraisal Status Flow (HR module Objectives Settings and Appraisals ) as Diagram

How To...Custom BADI for rounding off values in SAP BUSINESSOBJECTS Planning and Consolidation, version for SAP NetWeaver.

Business Rules Framework plus Workbench

Web Dynpro for ABAP: Tutorial 4 - Display Bookings of Selected Flight

WDJ: Adaptive Web Service Model Controller Coding Explained

Use the BI Java SDK in a Web Dynpro Application Version 1.01 July 2005

Access Control 5.3 Implementation Considerations for Superuser Privilege Management ID-Based Firefighting versus Role-Based Firefighting Applies to:

Create Monitor Entries from a Transformation routine

What's New in the DBA Cockpit with SAP NetWeaver 7.0

Configure TREX 6.1 for Efficient Indexing. Document Version 1.00 January Applicable Releases: SAP NetWeaver 04

Transcription:

Accessing ABAP Functions in Web Dynpro Java Applies to: Web Dynpro Java in SAP NetWeaver 7.0 (2004s) Summary This tutorial shows how to use the Adaptive RFC model to connect to a SAP backend. Level of complexity: Intermediate Time required for completion: 60 min. Author: SAP NetWeaver Product Management Company: SAP AG Created on: 08 December 2007 2007 SAP AG 1

Table of Contents Sample Projects... 3 Creating a Web Dynpro Application Accessing ABAP Functions... 3 Objectives... 3 Prerequisites... 4 Systems and Authorizations... 4 Setting Up the SLD Connection... 4 Maintaining the JCO Destinations in the Web Dynpro Content Administrator... 5 Importing the Project Template into the SAP NetWeaver Developer Studio... 5 Developing the Application Steps... 5 Developing the Application Steps... 6 Creating a Model... 6 Creating the Context and Binding it to the Model... 9 Creating a Context for the Custom Controller... 9 Mapping Custom Context Elements to View Context Elements... 10 Mapping Custom Context Elements to View Context Elements... 11 Adding Dependencies to the Views... 11 Creating a Context for the SearchView... 11 Creating a Context for the ResultView... 12 Creating Actions and Declaring Methods... 13 Creating Actions and Declaring Methods... 14 Creating the Search Action... 14 Declaring the executebapi_flight_getlist_input() method... 15 Editing the UI Elements... 15 Editing the UI Elements... 16 Editing UI Elements for the Search view... 16 Editing UI Elements for the ResultView... 17 Adding the Implementation of the Backend Connection...18 Implementing the Action Event Handler... 18 Adding the Implementation for the Custom Controller FlightListCust... 18 Building, Deploying, Configuring and Running Your Application... 19 Building, Deploying, Configuring and Running Your Application... 20 Prerequisites... 20 Building the Project... 20 Deploying the Project... 20 Creating the JCO Connections in the Content Administrator... 20 Launching the Application... 21 Result... 22 Related Content... 23 Copyright... 24 2007 SAP AG 2

Sample Projects To follow the tutorial step by step, download the initial project here: WDJ_Tut_AdaptiveRFC_70_Init.zip To check the ready-to-use tutorial, download this project: WDJ_Tut_AdaptiveRFC_70.zip (some configuration steps have to be performed nevertheless) Creating a Web Dynpro Application Accessing ABAP Functions The following tutorial shows you how to design, implement, deploy, and run a basic Web Dynpro application that accesses persistent data from a remote SAP system. In the Web Dynpro application, you will connect to the remote SAP system, the backend, using the Adaptive RFC model. To access database tables, you can make use of existing functions in the form of RFC function modules. For each function module that you need, the system generates a corresponding Java proxy class. All the generated proxy classes and interface are bundled together in the RFC model and treated as part of your Web Dynpro project. For the purposes of this tutorial, you design a simple, structured Web application, which will display flight connections between a given departure and destination airport. The user interface for this Web application will consist of two views. In the first view, the user should be able to enter the departure and destination airports in the appropriate input fields and trigger display of the flight data using a Search button. As a result of this query, all the available flight data will be displayed as a table in the next view. Objectives By the end of this tutorial, you will be able to: Create a model that is used to connect to the SAP backend from the Web Dynpro project Implement access to remote function modules in an SAP system Implement custom controllers for specific tasks that cannot be assigned to a single view Create contexts for the custom controller and bind them to the model Create view contexts and map them to the custom controller context Bind UI controls to view context elements 2007 SAP AG 3

Prerequisites Systems and Authorizations The SAP NetWeaver Developer Studio is installed on your computer. You have access to the SAP Web Application Server You have access to a remote SAP back-end system. To test this example application successfully, you must also make sure that this SAP system contains the function module BAPI_FLIGHT_GETLIST and the appropriate data from the flight data model. To access functions within a SAP system, a user must provide this system with valid credentials by means of the logon process. Since you are using the Web Dynpro Adaptive RFC Layer, the user ID defined in the Web Dynpro Content Administrator of your SAP NetWeaver Application Server will take care of the connection automatically. The SAP System Landscape Directory (SLD) and the SLD bridge are configured and running. The SLD contains component information about all SAP software modules, the system landscape description and the name reservation service. The SLD bridge is used to transform the system data to the SLD server compliant format. For more information, see also the Post-Installation Guide for the System Landscape Directory of SAP NetWeaver 7.0 or have a look at the documentation regarding SAP System Landscape Directory (requires SMP Login). In order to connect the logical systems defined in the Adaptive RFC model with a physical SAP system you need to perform two configuration tasks. Setting Up the SLD Connection To establish a connection to the SLD server you have to specify the HTTP connection parameters. You will carry out this task in the Visual Administrator while the SAP NetWeaver Application Server is running. Proceed as follows: 1. Start the SAP NetWeaver Application Server if you have not already done so. 2. Start the Visual Administrator using the path <Drive>:\usr\sap\<System ID>\JC00\j2ee\admin\go.bat. 3. Choose Connect and log on to the SAP NetWeaver Application Server. You need administrator rights for the login process. 4. After login, choose the Cluster tab on the left, expand the node Server, Services, and choose SLD Data Supplier. 5. Choose CIM Client Generation Settings and specify the necessary HTTP connection parameters to establish a connection to the SLD. 6. Save the data by pressing the Save button 7. Choose the CIM Client Test button to check the CIM client connectivity. 8. If the test was successful, you can close the Visual Administrator console. Otherwise correct your connection parameters. Now you have defined the connection parameters for SLD server has to be used to run your application. 2007 SAP AG 4

... Accessing ABAP Functions in Web Dynpro Java Maintaining the JCO Destinations in the Web Dynpro Content Administrator The logical system names used in the model declaration need to be associated with an actual SAP system defined in the SLD before this application can be executed. You will carry out this task after deploying your example application in the Web Dynpro Content Administrator. If you do not perform this step, then you will only be able to build and deploy the application, but you will be unable to run it. Importing the Project Template into the SAP NetWeaver Developer Studio 1. Download the ZIP file WDJ_Tut_AdaptiveRFC_70_Init.zip, which contains the initial Web Dynpro project TutWD_FlightList_Init and save it in a local directory or directly in the workspace of the SAP NetWeaver Developer Studio. 2. Unzip the contents of the ZIP file WDJ_Tut_AdaptiveRFC_70_Init.zip into the workspace of the SAP NetWeaver Developer Studio or in local directory. 3. Call the SAP NetWeaver Developer Studio. 4. Import the Web Dynpro project TutWD_FlightList_Init. The Web Dynpro project TutWD_FlightList_Init then appears in the Web Dynpro Explorer for further processing and editing in the context of this tutorial. The warnings triggered by the Web Dynpro project TutWD_FlightList_Init can be ignored at this time, since we will extend the Web Dynpro project during the remainder of this tutorial and will thus remove the displayed warnings. Without the additions we will make, the initial Web Dynpro project template TutWD_FlightList_Init cannot be executed. In the Navigation Modeler, the initial Web Dynpro project looks as follows: The FlightListWindow contains a SearchView, which inherits a ViewContainerUIElement embedding the ResultView. 2007 SAP AG 5

......... Accessing ABAP Functions in Web Dynpro Java Developing the Application Steps The following description of how to extend the example application with access to ABAP functions is split into two sections: 1. Creating a model and context elements and bind them: a. Add a new FlightModel that is based on the Adaptive RFC. b. In the custom controller FlightListCust, create an appropriate context structure and bind it to the model FlightModel. c. Create appropriate context structures in the views SearchView and ResultView and map them to the context structures of the custom controller FlightListCust. 2. Creating an action, declaring a method, and adding the implementation of the back-end connection: a. Define an action Search in the SearchView that will trigger the query to the back-end system. By declaring a method in the custom controller FlightListCust the query is sent to the back-end system. b. You bind the UI elements to the context structures or the action. c. As a last step before building, deploying, and executing, you must implement the back-end call. Creating a Model You use a model to specify where the data for your Web Dynpro application is to come from. Since you are using a remote SAP system to retrieve the flight data, you can make use of an existing model. You will import an adaptive RFC model into your project for this purpose. This step also includes in particular generating Java proxies, which represent the corresponding RFC function modules in your Web Dynpro project. 1. In the project structure, expand the node Web Dynpro Models. 2. From the context menu, choose Create Model. The appropriate wizard appears. 3. Choose the Import Adaptive RFC Model option, followed by Next. 4. Enter the model name FlightModel and the package name com.sap.tut.wd.flightlist.model. When importing an adaptive RFC Model you have to specify the logical system names for model instances and RFC metadata: Change the default logical system name for model instances WD_MODELDATA_DEST to WD_FLIGHTLIST_MODELDATA_DEST Change the default logical system name for RFC metadata WD_RFC_METADATA_DEST to WD_FLIGHTLIST_RFC_METADATA_DEST The logical systems will later be separately configured using the JCO Connections screen of the Web Dynpro Content Administrator (see section Building, Deploying, Configuring, and Running Your Application). 2007 SAP AG 6

5. Accept the suggested values and choose Next. 6. Enter the appropriate data for logging on to the SAP system and choose Next. 7. Enter either the complete name of the function module BAPI_FLIGHT_GETLIST in the appropriate field or enter the start of the name followed by an asterisk (*). Then choose Search. 8. Select the function module BAPI_FLIGHT_GETLIST from the list that appears. 2007 SAP AG 7

9. Choose Next. By doing so, you automatically trigger the generation process. The import process is logged by a detailed description, which you can see in the next dialogue. To confirm choose Finish. 10. Now the java proxies are generated and a new model node FlightModel is inserted into project structure. 2007 SAP AG 8

Creating the Context and Binding it to the Model The custom controller FlightListCust is responsible for retrieving flight data from an SAP system, so it needs to be able to map the corresponding input and output for the flight model. To establish this correspondence between the custom controller and the model, you will create an appropriate controller context and then bind the context nodes to the model structure. In this way, you can ensure that the model data is stored and manipulated in a central location. Adding a model to the Web Dynpro component 1. In the project structure, expand the tree up to the node Web Dynpro Web Dynpro Components FlightListComp. 2. Select the node Used Models, open the context menu and choose Add. 3. In the list that appears, select the model FlightModel and confirm by choosing OK. By doing so, you specify that all views and controllers of FlightListComp have a dependency relationship with the FlightModel. Creating a Context for the Custom Controller 1. In the project structure, double-click the name of the custom controller (in this case, FlightListCust). 2. Choose the Context tab if necessary. 3. Open the context menu for the root node Context and choose the option New Model Node. 4. Enter the name Bapi_Flight_Getlist_Input for the model node and choose Finish. 5. From the context menu for the model node that you have just created, choose Edit Model Binding 6. Choose the model class Bapi_Flight_Getlist_Input, followed by Next. 7. Activate the following entries: Destination_From and Destination_To. Expand Output and activate Flight_List. Choose Finish. The Developer Studio refreshes the context tree appropriately. 2007 SAP AG 9

In this way, you have completed specification of all the context nodes for the input and output data. You will need this context later for the SearchView and the ResultView. 8. Save your work by choosing the icon (Save All Metadata) from the toolbar. 2007 SAP AG 10

............ Accessing ABAP Functions in Web Dynpro Java Mapping Custom Context Elements to View Context Elements In this step you will learn how to map context elements of the custom controller FlightListCust to the appropriate context elements of the views SearchView and ResultView. Adding Dependencies to the Views 1. Navigate to SearchView (Web Dynpro Web Dynpro Components FlightListComp Views SearchView) and open the ViewDesigner with secondary mouse button. 2. Choose the Properties tab. 3. Under Required Controllers, choose Add. 4. In the list that appears, choose the FlightListCust component. 5. Confirm by choosing OK. 6. Repeat steps 1-5 as appropriate for the ResultView view. You have now entered the appropriate dependency on the custom controller FlightListCust for each view. Creating a Context for the SearchView 1. Open the View Designer for the SearchView again and choose the Context tab. 2. Open the context menu for the root node Context and choose the option New Model Node. 3. Enter the name Bapi_Flight_Getlist_Input for the model node and choose Finish. 4. From the context menu of the model node that you have created, choose Edit Context Mapping 5. Choose the custom context node Bapi_Flight_Getlist_Input, followed by Next. 6. Activate only Destination_From and Destination_To. Choose Finish. 2007 SAP AG 11

The Developer Studio refreshes the context tree appropriately. Creating a Context for the ResultView 1. Open the View Designer for the ResultView again. 2. Choose the Context tab. 3. Open the context menu for the root node Context and choose the option New Model Node. 4. Enter the name FlightList for the model node and choose Finish. 5. From the context menu of the model node that you have created, choose Edit Context Mapping 6. Expand the custom context structure Bapi_Flight_Getlist_Input Output, then choose Next. 2007 SAP AG 12

7. Choose the node Flight_List, then choose Finish. The Developer Studio refreshes the view context tree appropriately. 8. Save your work by choosing the icon (Save All Metadata) from the toolbar 2007 SAP AG 13

... Accessing ABAP Functions in Web Dynpro Java Creating Actions and Declaring Methods To trigger display of the flight data from the SAP system, in the SearchView, you need to create an action that can be bound to a UI element, such as a button. You can then implement the event handler, which reacts to this action. Creating the Search Action 1. Open the View Designer for the SearchView. 2. Choose the Actions tab. 3. Choose the New pushbutton. You can create a new action in the wizard that appears. 4. Enter the name Search for this new action, leave the other settings unchanged, and choose Finish. An event handler, onactionsearch, is automatically created for this new action. 2007 SAP AG 14

Declaring the executebapi_flight_getlist_input() method 1. Open the editor for the custom controller FlightListCust again. 2. Choose the Methods tab. 3. Choose New. 4. Select the Method option and choose Next. 5. In the wizard screen that appears, enter the name executebapi_flight_getlist_input for this new method and assign it the return type void. Choose Finish. The method executebapi_flight_getlist_input is added to the custom controller. 6. Save the new metadata by choosing the icon (Save All Metadata) from the toolbar. 2007 SAP AG 15

. Accessing ABAP Functions in Web Dynpro Java Editing the UI Elements Editing UI Elements for the Search view 1. Open the SearchView in the View Designer by clicking the Layout tab of the View Editor. The View Designer displays a predefined default text. Simultaneously, the Outline view displays a list of the UI elements included. If you select an element in the Outline view or on the Layout tab, its associated element properties are shown in the Properties view. 2. Choose following UI elements that have been included in the project template and give them following properties: Property Value For FromCityInputField Value Bapi_Flight_Getlist_Input.Destination_From.City For ToCityInputField Value Bapi_Flight_Getlist_Input.Destination_To.City For SearchButton Event > onaction Search The View Designer displays the following layout for the SearchView: 3. Save the new metadata by choosing the icon (Save All Metadata) from the toolbar. 2007 SAP AG 16

Editing UI Elements for the ResultView 1. Open the ResultsView in the View Designer by clicking the Layout tab. 2. Select the Table on the Outline tab and choose Create Binding from the context menu. 3. In the wizard that appears, you can specify table columns that will be displayed in the TableView. Select the FlightList model node and press Next. 4. On the next screen leave all the other values unchanged and choose Finish. The value FlightList is automatically assigned to the datasource property of the table UI element and all selected table columns are created for the TableView. The View Designer displays the following layout for the ResultView. 5. Save the new metadata by choosing the icon (Save All Metadata) from the toolbar. 2007 SAP AG 17

...... Accessing ABAP Functions in Web Dynpro Java Adding the Implementation of the Backend Connection Implementing the Action Event Handler 1. In the View Designer, choose the Implementation tab for the SearchView. The Developer Studio runs several generation routines, and then displays the updated source code for the implementation of the view controller. 2. Insert the following line of code in the onactionsearch() method: /** declared validating event handler */ public void onactionsearch(com.sap.tc.webdynpro.progmodel.api.iwdcustomevent wdevent ) { //@@begin onactionsearch(serverevent) // The event handler onactionsearch triggers the remote function call wdthis.wdgetflightlistcustcontroller().executebapi_flight_getlist_input(); //@@end } Adding the Implementation for the Custom Controller FlightListCust 1. Open the Controller Editor for the custom controller FlightListCust again. 2. Choose the Implementation tab. 3. In the standard method wddoinit(), between //@@begin wddoinit() and //@@end, add the following lines of code: /** Hook method called to initialize controller. */ public void wddoinit() { //@@begin wddoinit() // Create a new element in the Bapi_Flight_Getlist_Input node Bapi_Flight_Getlist_Input input = new Bapi_Flight_Getlist_Input(); wdcontext.nodebapi_flight_getlist_input().bind(input); // Create new elements in the Destination_From and Destination_To nodes input.setdestination_from(new Bapisfldst()); input.setdestination_to(new Bapisfldst()); //@@end } 4. In the method executebapi_flight_getlist_input(), between //@@begin executebapi_flight_getlist_input() and //@@end, add the following lines of code: /** declared method */ public void executebapi_flight_getlist_input( ) { //@@begin executebapi_getlist_input() try { // Calls remote function module BAPI_FLIGHT_GETLIST wdcontext.currentbapi_flight_getlist_inputelement().modelobject().execut e(); // Synchronise the data in the context with the data in the model wdcontext.nodeoutput().invalidate(); } catch (Exception ex) { // If an exception is thrown, then the stack trace will be printed ex.printstacktrace(); } //@@end } 5. To add the import statements, position the cursor anywhere in the Java Editor and choose Source Organize Imports from the context menu. 2007 SAP AG 18

The following import statements are added to the source code, without your having to do anything more: //@@begin imports import com.sap.tut.wd.flightlist.model.bapi_flight_getlist_input; import com.sap.tut.wd.flightlist.model.bapisfldst; import com.sap.tut.wd.flightlist.wdp.iprivateflightlistcust; //@@end 6. Save the new metadata by choosing the icon (Save All Metadata) from the toolbar. 2007 SAP AG 19

...... Accessing ABAP Functions in Web Dynpro Java Building, Deploying, Configuring and Running Your Application You have now reached the last stage in the development of you example application. However, some preparation is still essential before you can deploy and run the application successfully on the SAP NetWeaver Application Server. Go through each of the following prerequisites carefully. Prerequisites You have made sure that the relevant ABAP system, which you will be accessing remotely to retrieve the flight data, is currently available and contains flight data. You have made sure that the SAP NetWeaver Application Server has been launched. You have checked that the configuration settings for the SAP NetWeaver Application Server and for the SDM server are entered correctly in the Developer Studio. To check the server settings, choose the menu path Window Preferences SAP J2EE Engine. The connection parameters for the used SLD are defined in the Visual Administrator. Building the Project 1. If you have not already done so, save the metadata for your project in its current state. 2. In the Web Dynpro Explorer, from the context menu of the project node TutWD_FlightList_Init, choose Rebuild Project. Deploying the Project 3. In the Web Dynpro Explorer, select the project node TutWD_FlightList_Init and choose Create Archive from the context menu. 4. Choose Deploy Project from the context menu of the project node. Creating the JCO Connections in the Content Administrator The logical system names used in the model declaration must be associated with an actual SAP system defined in the SLD before this application can be executed. For this reason you need to create JCO connections in the Web Dynpro Content Administrator. To use an adaptive RFC model in your Web Dynpro application you will define two connections: A connection to get the needed (dictionary) meta data information A connection to get the read the application data To create the new JCO connections proceed as follows: 1. Open the Web Dynpro Content Administrator on your SAP NetWeaver Application Server using the URL: http://<host>:<port>/webdynpro/welcome. 2. If you are using the Content Administrator for the first time, you need to perform the self registration. 3. Select the Browse tab and navigate to the application node local TutWD_FlightList_Init Applications FlightListApp. 4. Choose the JCO Connections tab. Two destinations named WD_FLIGHTLIST_MODELDATA_DEST and WD_FLIGHTLIST_RFC_METADATA_DEST are shown in this view and both of them have the status red. This means that the JCO connection is not yet maintained in assigned SLD. 2007 SAP AG 20

5. Select WD_FLIGHTLIST_MODELDATA_DEST and choose Create to configure a new JCO connection. a. Go though the steps of the JCO connection creation wizard and specify the connection data. b. After making the required entries, press Finish. c. Test your configuration data by pressing the Test button. 6. Do the same for WD_FLIGHTLIST_RFC_METADATA_DEST. The both destinations are ready to use. 7. If the tests were successful, you can close the Content Administrator. Otherwise correct your connection entries. Launching the Application 8. In the Web Dynpro Explorer, open the context menu for the application object FlightListApp. 9. Choose Run. 2007 SAP AG 21

Result The Developer Studio performs the deployment process and then automatically launches your application in the Web browser. Test your Web Dynpro application by entering a valid city name for the Departure City and Arrival City and then clicking the Search button. Provided the system contains the appropriate flight data, it will display it in a table. 2007 SAP AG 22

Related Content Tutorials & Samples for Web Dynpro Java Web Dynpro Models: Backend Access Importing an Adaptive RFC Model 2007 SAP AG 23

Copyright Copyright 2007 SAP AG. All rights reserved. No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice. Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. Microsoft, Windows, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation. IBM, DB2, DB2 Universal Database, OS/2, Parallel Sysplex, MVS/ESA, AIX, S/390, AS/400, OS/390, OS/400, iseries, pseries, xseries, zseries, z/os, AFP, Intelligent Miner, WebSphere, Netfinity, Tivoli, Informix, i5/os, POWER, POWER5, OpenPower and PowerPC are trademarks or registered trademarks of IBM Corporation. Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries. Oracle is a registered trademark of Oracle Corporation. UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group. Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc. HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C, World Wide Web Consortium, Massachusetts Institute of Technology. Java is a registered trademark of Sun Microsystems, Inc. JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape. MaxDB is a trademark of MySQL AB, Sweden. SAP, R/3, mysap, mysap.com, xapps, xapp, SAP NetWeaver, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and in several other countries all over the world. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. These materials are provided as is without a warranty of any kind, either express or implied, including but not limited to, the implied warranties of merchantability, fitness for a particular purpose, or non-infringement. SAP shall not be liable for damages of any kind including without limitation direct, special, indirect, or consequential damages that may result from the use of these materials. SAP does not warrant the accuracy or completeness of the information, text, graphics, links or other items contained within these materials. SAP has no control over the information that you may access through the use of hot links contained in these materials and does not endorse your use of third party web pages nor provide any warranty whatsoever relating to third party web pages. Any software coding and/or code lines/strings ( Code ) included in this documentation are only examples and are not intended to be used in a productive system environment. The Code is only intended better explain and visualize the syntax and phrasing rules of certain coding. SAP does not warrant the correctness and completeness of the Code given herein, and SAP shall not be liable for errors or damages caused by the usage of the Code, except if such damages were caused by SAP intentionally or grossly negligent. 2007 SAP AG 24