data modeling in sap gateway maximize performance at all ... modelling.pdf · data modeling in sap...

14
Data Modeling in SAP Gateway maximize performance at all levels With SAP Netweaver Gateway becoming the platform to seamlessly connect across several devices, it is imperative that data modelling plays a pivotal role in developing applications. Needless to say, the data model you create consists of the operations you want to perform in runtime, mapped to specific data and attributes. Against this backdrop, this white paper probes into the concepts and functionalities of using Data modelling in SAP Gateway with relevant notes and screen shots, wherever applicable. Innovapptive Thought Leadership - Data modelling in SAP Gateway

Upload: vuliem

Post on 14-Feb-2018

237 views

Category:

Documents


0 download

TRANSCRIPT

Data Modeling in SAP Gateway – maximize performance at all levels

With SAP Netweaver Gateway becoming the platform to seamlessly connect across several devices, it is imperative that data modelling plays a pivotal role in developing applications. Needless to say, the data model you create consists of the operations you want to perform in runtime, mapped to speci�c data and attributes. Against this backdrop, this white paper probes into the concepts and functionalities of using Data modelling in SAP Gateway with relevant notes and screen shots, wherever applicable.

Innovapptive Thought Leadership - Data modelling in SAP Gateway

Innovapptive Thought Leadership - Data modelling in SAP Gateway

2

Abstract

Data modelling is a process that is used to de�ne and analyze the data requirements as required to support the business processes, based on the de�ned scope of an information system within an organization. In order to achieve data compatibility, a data model needs to be consistently used across the systems. In this context, the process of data modelling assumes crucial importance with professional data modelers working consistently with business stakeholders and potential users of the information system to produce the desired results.

Data modelling is the �rst stage in database design and object oriented programming as the designers initially create a conceptual model of how data items relate to each other. Data modelling refer to gradual progression from conceptual model to logical model to physical schema.

This paper starts with an overview of SAP Gateway, appreciating its features and bene�ts and slowly delves into the functionality of Data Modelling including its pre-requisites, role of the service builder, concept of data de�nition and various services that are available like Rede�ne and Include. This paper �nally provides an overview of Data Consumption process.

Overview of SAP Netweaver Gateway

SAP NetWeaver Gateway is a technology that o�ers an easier way to connect devices, environments and platforms with SAP software, as per the market standards. The framework enables development of intuitive and innovative people centric solutions leveraging the power of SAP business software into unique experiences like social and collaboration environments, mobile and tablet devices and rich internet applications.

SAP Netweaver Gateway o�ers easier provisioning and consumption of business logic and content of SAP backend systems for mobile and web applications, irrespective of any type of experience, device or developer. The primary objective is to minimize the complexity and the skill sets required to access SAP data, ensuring that there are no barriers in deployment. When you have simple interfaces, it also helps to minimize development times.

Simply stated, Netweaver Gateway is a set of ABAP add-ons to your existing SAP ERP system, o�ering easy access to your business information. The Gateway provides an API that is designed to act as an easy-to-use and well de�ned, providing access to rich repository of business data and functionality in your SAP systems.

Innovapptive Thought Leadership - Data modelling in SAP Gateway

3

Prerequisites

Developers create content that can be accessible through SAP NetWeaver Gateway on popular devices such as iPhone and Blackberry. You can generate content in two methods such as:

Using the content generator to create content swiftly and automatically without the necessity to write any code Writing your own code and generating content manually.

Before you commence OData service development, ensure that the following pre-requisites are met:

Use valid system alias to identify the remote system that is used as a data source. The system alias used when creating a data model also needs to be con�gured in all the systems for which the data model is being transported. Also note that though it can point to varied physical destinations, it must have the same name. If you do not ensure this pre-requisite, you cannot open the data model from the content generator in those systems. Con�gure a managed RFC connection to the system that you can use to retrieve information from the data source, in case you are using the content generator.

Approach to Data Modelling – Role of Service Builder

SAP Netweaver Gateway Service Builder supports varied development approaches and life cycles to help develop-ers to have optimum �exibility to ensure that they can ful�ll �uctuating development prerequisites and meet diverse requirements. If developers need a service to expose speci�c data, they can opt either of the two methods:

1. De�ne a completely new data model for the new service and integrate their own source code 2. Reuse and rede�ne existing services

In case you have a project that you can apply to a similar case, you can create a copy of an entire project and then execute minimal changes as required. The Service Builder o�ers numerous ways of reusing existing data sources from an SAP Business Suite system, thus quickening the development process considerably.

To put it succinctly, the Service Builder caters to all levels of development experience and o�ers development approaches that are custom made to help you save time and enhance e�ciency, without compromising on quality. Whichever development approaches you undertake, the appropriate ABAP classes are generated, thus driving home the point that developers can retain maximum �exibility, when optimizing or extending OData services. The following phases for OData services are supported by the Service Builder:

1. Data Model De�nition (Model Provider Class (MPC)) 2. Service Implementation (Data Provider Class (DPC)) 3. Service Maintenance

Innovapptive Thought Leadership - Data modelling in SAP Gateway

4

Whichever method you adopt, a data model is generated that you can view from transaction SE80 in the ABAP Workbench. To build your service, you then create a consumption model and incorporate data models to it. The created data model consist of the operations you want to accomplish at runtime, mapped to a speci�ed data and attributes. The data model is exposed to SAP NetWeaver Gateway services that trigger the operations that you de�ned at design time and also returns data and �elds to the end user. For instance, you can generate a data model that reads customers’ names, addresses and contact details for a sales director to have them readily available on his/her mobile phone.

OData Model Definition

Before you understand how data modelling works in SAP Gateway, let’s �rst understand what data model de�nition is all about.

OData services require a data model de�nition, referred as model provider class. For client development projects, the development process mandatorily commences with a previously-de�ned data model, which is outside-in approach. Based on your speci�c requirements, you can de�ne a data model in the following formats: De�ne new data model Import Rede�ne Service Include Service

Let’s have a brief overview of each format:

Define a new data model

This model o�ers optimum �exibility, wherein it requires manual de�nition of individual data model elements and their properties.

What are data model elements?

Within the tree view of the Service Builder, you can use the data model folder structure to create and edit the individu-al data model elements. The data model consists of various sub-folders for each of the element types as listed below:

Entity Types Complex Types Associations Entity Sets Association Sets Function Imports

You can create and de�ne any of the above data elements, directly in the data model folder of your project. Once you create a new model element, it is inserted in the relevant prede�ned sub-folder within the data model folder.

Innovapptive Thought Leadership - Data modelling in SAP Gateway

5

Double click the speci�c data model element in the data model folder and enter the relevant informa-tion.Right click the data model folder, click Create and then click the data model element you want to create. Expand the data model folder, right click the data model element you want to create and then click Create.

Import

The following procedure illustrates how you can import the Search Help DDIC structure:

There are three types of methods for creating a new data model:

Figure 1: SAP Netweaver Gateway Service Builder showing the Create function

DDIC structure (ABAP Data Dictionary)Data source (RFC/BOR interface)Data ModelApply conditional formatting

You can use any of the 3 methods to accomplish the import process:

Figure 2: Import Process

Innovapptive Thought Leadership - Data modelling in SAP Gateway

6

DDIC structure (ABAP Data Dictionary)

This structure minimizes the time required to create entity and complex types in your data model. In order to minimize the time required to create complex types and entity types in your data model, SAP NetWeaver Gateway Service Builder provides the Import DDIC structure function that lets you import an existing ABAP (DDIC) structure and later reuse this data to create new complex types and entity types with minimal e�ort.

You can import the following DDIC structures into the Service Builder:

Search Help Views Database tables Structures

1. In the SAP NetWeaver Gateway Service Builder, click Data Model -> Import -> Search Help

The following procedure illustrates how you can import the Search Help DDIC structure:

Figure 3: SAP NetWeaver Gateway Service Builder screen

2. In the Wizard Step 1 of 3: Import from Search Help screen, type Mac in the Entity Type Name box and click Next.

Figure 4: Wizard Step 1 of 3: Import from Search Help screen

Innovapptive Thought Leadership - Data modelling in SAP Gateway

77

Figure 5: Wizard Step 2 of 3: Import from Search Help screen

3. In the Wizard Step 2 of 3: Import from Search Help screen, click to select MATNR and then click Next.

3. In the Wizard Step 3 of 3: Import from Search Help screen, select Is K checkbox and then click Finish. The Search Help DDIC structure gets imported successfully.

Figure 6: Wizard Step 3 of 3: Import from Search Help screen

Mobile Quality Management for SAP® ERP

8

Figure 7: Search Help DDIC structure

Innovapptive Thought Leadership - Data modelling in SAP Gateway

This lets you to reuse existing remote function calls (RFC)/business object repository (BOR) parameters to create entity types with minimal e�ort. Hence, you can tap into a multitude of RFCs and business application interfaces (BAPIs) from the BOR. Once you have imported an existing interface de�nition, you can map the operations from the same RFC or BAPI to get the service operations you require, eliminating the need to write additional ABAP source code.

The following procedure illustrates how you can reuse existing RFC/BOR parameters:

1. In the SAP NetWeaver Gateway Service Builder screen, click Import and then click RFC/BOR Interface.

Data source (RFC/BOR interface)

Figure 8: SAP NetWeaver Gateway Service Builder screen

9

Innovapptive Thought Leadership - Data modelling in SAP Gateway

Figure 9: Wizard Step 1 of 3: Create Entity Type from Data Source

Figure 10: Wizard Step 2 of 3: Create Entity Type from Data Source

2. In the Wizard Step 1 of 3: Create Entity Type from Data Source screen, type BAPI_CURRENCY_GET LIST in the Name box and then click Next.

3. In the Wizard Step 2 of 3: Create Entity Type from Data Source screen, type CURRENCY_GETLIST in the Name box and then click Next.

Innovapptive Thought Leadership - Data modelling in SAP Gateway

10

Figure 11: Wizard Step 3 of 3: Create Entity Type from Data Source

It enables you to reuse an existing data model for more than one service. The �le import function is incorporated to enable import of data model �les, as de�ned by external model editors such as Visual Studio (edmx �les) and metadata �le types (xml) into the Service Builder to create a data model. You can import such �les into the Service Builder for 2 types of projects, such as:

Service with SAP Annotations Service with Vocabulary-Based Annotations

Data model

4. In the Wizard Step 3 of 3: Create Entity Type from Data Source screen, select Create Default Entity Set check box and click Finish. The (RFC)/ (BOR) parameters gets imported.

Figure 12: Import of RFC/BOR parameters

Innovapptive Thought Leadership - Data modelling in SAP Gateway

11

It lets you rede�ne existing SAP NetWeaver Gateway services or services created from a framework within your SAP system landscape (Ex: Service Provider Interface (SPI), SAP Business Information Warehouse (BW Query), Generic Interaction Layer (GenIL).

Using the Rede�ne OData Service (GW) function, you can perform the following activities:

Redefine a service: Select this option if you want to rede�ne a service for the �rst time in the Service Builder. Extend the existing model: Select this option if you intend to incorporate more artifacts into your model from an existing model. In case your model already has artifacts from a refer ence model, you can include more artifacts from this model only. Overwrite existing model: Select this option to overwrite the existing model in the Service Builder with a new model from a diverse service.

Redefine service

Once you choose one of the rede�nition options, you are provided with various options to choose the appropriate service you want to rede�ne (note that you can select only those services that are registered in the current SAP Business Suite backend system). Once you have selected the service, the model is displayed in a tree view, enabling you to select the required artifacts (entity types, associations, function imports) for the new model. This Modi�cation Generator lets you make certain restricted modi�cations in the services that are created with the help of external framework like SAP Business Information Warehouse (BW), Service Provider Interface (SPI), and Generic Interaction Layer (GenIL). For instance, these service might not have a proper label or might not require all the artifacts. In these cases, the Modi�cation Generator lets you make cosmetic changes without changing the underlying data provider class and accordingly reuses the existing model.

Two new DPC classes get generated during the generation process. The new DPC inherits from the existing (original) service, resulting in the availability of the logic for the existing (original) service. The new DPC extension class inherits from the new DPC base class, letting you to edit the logic for your service.

Using the Rede�ne service, you can reuse the diverse business objects and services, existing in your SAP system landscape. Apart from that, it connects existing service operations, eliminating the need to create an individual service implementation. Accordingly, you can skip the service implementation phase. The Service Builder enables you to rede�ne both OData services created in NetWeaver Gateway and external services like SPI, BW Query, GenIL that have been created with the help of varied backend frameworks.

You can use this feature in the following scenarios:

To import a metadata/edmx �le for a new project in certain instances where you create a project and import a �le. To import a metadata/edmx �le for an existing project that already has a data model created (re-import).

12

Innovapptive Thought Leadership - Data modelling in SAP Gateway

Include service

You can use this service to incorporate an existing SAP NetWeaver Gateway service without the need to recreate its data model. For enhanced usage, it lets you integrate one or more existing services in a new service. You can even skip the service implementation phase, if you choose to include one or more existing services

Including an OData service

At the time of creating an association, there may be instances when you wish to link to an existing model without the necessity to recreating it. In such scenarios, you can use the Including OData Service function to include models in the Service Builder and then create associations using the included models.

Let’s take an example of a purchase order. To create a purchase order, we require list of vendors and products. For the purchase order service, two types of master data are required such as vendor and product. You can utilize the Include Model function, since the vendor and product services already exist, enabling you to reuse them.

However, there are certain prerequisites for using this service, which are as follows:

The service of the external data model should be present on the SAP NetWeaver Gateway hub system and be up and running.

In order to incorporate a model from an external system, you need to have a system with NetWeaver Gateway SP05 (Software Component IW_BEP 200 SP05)

Figure 13: SAP NetWeaver Gateway Service Builder screen showing Import function

Figure 14: SAP NetWeaver Gateway Service Builder screen showing Import function

13

Innovapptive Thought Leadership - Data modelling in SAP Gateway

Create a Consumption Model

A consumption model denotes an OData service by bundling a set of SAP NetWeaver Gateway data models for a speci�c consumption use case. Each data model is represented by one or more corresponding entity types or collections in the resulting service.

You can create a consumption model using the ABAP Workbench design time in transaction SE80 and consequently add data models to it. Apart from that, you can also create a consumption model and assign it to a particular data model in the tree view.

Please note that you need to create the consumption model and the data models within it on the same channel, which means, you cannot add a data model that was created on the OData Channel to a consumption model that was created on the Generic channel and vice versa. Apart from that, you cannot incorporate data models that were created on both channels in the same consumption model.

Conclusion

This white paper provided an overview of SAP NetWeaver Gateway and threw light on the Data Modelling functionality that is widely used in developing applications using SAP NetWeaver Gateway. Apart from providing a brief snapshot of how SAP Gateway works and its core functions, this white paper covered the concepts of Data Modelling in a conceptual manner starting from de�ning the data de�nition, various services like Rede�ne and Include that can be leveraged to make your job simpler, saving your considerable time and at the same time providing a robust data model.

14

For more information

To learn more about Innovapptive’s mPower™ App Suite, Enterprise Mobility Strategy and Consulting, Rapid Deployment Solutions and Custom Development Services, contact your Innovapptive sales representative, visit us at www.innovapptive.com or you can email Innovapptive directly at [email protected]

Innovapptive is among the fastest-growing enterprise mobile and user experience (UX) solution companies and is an industry leader among rapid mobile application development (RMAD) solution providers. Innovapptive's Rapid App Configurator Engine (RACE) technology redefines traditional approaches to digitize the enterprise and is empowering organizations to rapidly deliver ready-to-run mobile apps across the enterprise. Innovapptive's portfolio of 100+ mobile solutions that run across a wide array of devices and systems is creating a connected enterprise across employees, customers, and suppliers. Innovapptive was named a 2016 SAP Pinnacle Award winner and has won these recognition three years in a row.

© Copyright Innovapptive Inc. 2014

Innovapptive Inc.7322 Southwest Freeway, Suite 1816Houston, TX 77074USA

Produced in the United States of AmericaNovember 2014All Rights Reserved

About Innovapptive

Innovapptive Thought Leadership - Data modelling in SAP Gateway