accessing abap functions in web dynpro java ?· accessing abap functions in web dynpro java...

Download Accessing ABAP Functions in Web Dynpro Java ?· Accessing ABAP Functions in Web Dynpro Java Applies…

Post on 16-Sep-2018

212 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • Accessing ABAP Functions in Web Dynpro Java

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com 2007 SAP AG 1

    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

  • Accessing ABAP Functions in Web Dynpro Java

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com 2007 SAP AG 2

    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

  • Accessing ABAP Functions in Web Dynpro Java

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com 2007 SAP AG 3

    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

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/80965d70-5389-2a10-069c-8b5939995ba8https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/90debaf9-5089-2a10-d1b8-de62e65ec9e2

  • Accessing ABAP Functions in Web Dynpro Java

    SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com 2007 SAP AG 4

    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 servic