Start of Content Area

Procedure documentationReusing BAPI Data from SAP Back-End Systems  Locate the document in its SAP Library structure

Use

If you want to reuse existing business functions in the Web Dynpro application, you need to create an Adaptive RFC model using the Web Dynpro model tools. The tools provide a wizard for the automatic generation of RFC adapter classes from Business APIs (BAPIs) and function modules delivered by SAP or developed by yourself. The generated classes are conventional Java classes. The generation itself is triggered and executed by the integrated tool SAP Enterprise Connector.

For the controller context, you must define model nodes and model attributes. The mapping – that is, data transfer by copy – then takes place between the proxy classes and the nodes or attributes. A Web Dynpro tool is available that provides graphical support when defining the data to be mapped.

Prerequisites

●     You have all the authorizations required for accessing an SAP back-end system, including single sign-on.

●     To be able to log on to the SAP System, this system must be entered in the logon group.

●     Before starting the model import process, you must have already created a Web Dynpro project.

●     You have started the Model Import Wizard via the context menu entry Create Model on the Model node in the relevant Web Dynpro component.

Procedure

Importing an RFC Model with the Wizard

       1.      In the model wizard, choose Import Adaptive RFC Model, followed by Next.

       2.      Make the required entries – for example, specify where the generated RFC model instances and RFC metadata are to be stored. You do not have to use an existing model package, as you can create a new one in the wizard. For the logical dictionary, you should normally enter a new name for each model. The default package name for the dictionary types is <myModelPackage>.types.

       3.      In the next wizard window, enter your user data for the SAP System that contains the BAPIs from which you want to generate the proxies. By doing this, you log on to the SAP System online.

       4.      Select the BAPIs for which you want to create Java proxies in a generation process. Choose Next to proceed to the next wizard window.

       5.      The import log provides information about the generated model classes, model properties and model relations. Choose Finish to start the generation process.

Result

The RFC model is displayed at logical level in the Web Dynpro Explorer view, together with the model’s classes and properties. You can display the generated classes in the Navigator view. In the next step, you can use the proxies for data retrieval in your Web Dynpro application. To do this, create a context structure in the Controller/Context Editor.

Example

The following table shows the naming conventions for the model files and their properties: The example is based on the SAP function module BAPI_FLIGHT_GETLIST, which is available in your SAP System.

SAP Back End

Web Dynpro Model

Context

Reference type/BAPI structure

BAPISFLDAT

Model adapter class (Java)

Bapisfldat.java

+

Web Dynpro metamodel data for this model class (XML)

Bapisfldat.modelclass

Model node

<myModelNodeName>

(references model class Bapisfldat)

Components

AIRLINE

AIRLINEID

...

Properties

AIRLINE

AIRLINEID

...

Attributes

AIRLINE

AIRLINEID

...

See also:

Controller Editor/Context-Editor

Context Structure

 

End of Content Area