You are on page 1of 15

SAP Gateway Basic Overview

Service Development
1. Data model definition
2. Service Implementation
3. Service Registration

EDMX- Entity Data Model Xml

Service Builder
Used to centrally display and create definition of OData services
Runtime artefacts
1.
2.
3.
4.

Model Provider Class MCP


Data Provider Class DCP
Model
Service

OData artefacts
1. Entity Set
2. Entity type
3. Properties
Used data sources and models
Models can be created based on EDMX- Modelling

Data Model can be defined in three ways - MPC


1. Declarative Model Definition Here we create the model from scratch
2. Model Import as EDMX Here we import the model as an edmx file
3. Import DDIC structure or BOR or RFC interface

DPC Service implementation is done using these classes, you could write the
code or extend the extensions. Usually we do the mapping and use the generator
to generate this class.

Building a Service using BOR SEGW

1. Project creation

2. On project creation Data Model will be created. Project structure will be


created as seen below

It will have
1.
2.
3.
4.

Data Mode
Service Implementation
Runtime Artifacts
Service Maintenance

The Data Model folder will contain


1. Entity Type
2. Entity Set
3. Association

We could create these items under Data Model manually using the context menu
or do an import which will automatically create them for you.

What can you import?


1. Data Model from File such as an edmx file
2. DDIC structure
3. RFC/BOR Interface

Importing an RFC BOR interface


1. Using the context menu of Data Model folder choose Import RFC/BOR
Interface option

2. A wizard will be displayed as below, enter a name for the Entity and select
the Type as Business Object Repository under Data Source Attributes.
Note that you could import from a remote system too, in which case you
will have to specify the RFC Destination.

Search for a BOR object, select it and click on next.

The interface of the BAPI will be displayed on clicking next, choose some fields
and click Next

You will be given a chance to provide meaningful named to the selected fields,
Also if amongst the chose fields there are no Key fields we will have to choose
one as the key.

After this clock on done, this will create the Entity type

Now, we create the Entity Set using the Entity Type. For this double click on
the Entity Set Folder and click on Create

The moment we save the Entity Set the Service Implementation will show the
CRUD operations which was previously not available.
Next, we click on the generate button from the Menu and the Service Builder will
create the MPC and DCP classes and its extensions, also the Technical Model
Name and Technical Service Name is created.
The Technical Service Name is the external name visible in the service url and
registered on the Gateway Hub.

If the Model is based on an RFC you cannot change the DPC and MPC
classes. But, you can redefine the extension classes.

Naming conventions
1.
2.
3.
4.
5.
6.

Model Provider class ends with MPC


Data Provider class ends with DPC
Extension for MPC ends with MPC_EXT
Extension for DPC ends with DPC_EXT
Technical Model name class ends with MDL
Technical Service name class ends with SRV

Once the code is generated by service builder the Runtime Artifacts folder will be
filled with all the classes

To view the class use the Context menus and choose Go to ABAP Workbench

The MCP class has a super class CL_MGW_PUSH_ABS_MODEL. It will contain a


redefinition called DEFINE which in turn calls another method which will have all
the code related to the model.

Next, we do service registration, we can see all the systems connected to


Gateway under the Service Maintenance folder.

Registration status grey indicates that the service is not registered yet. Click on
Register button, you will get a warning that you are leaving the system.
Next, we have to provide the system alias

Specify the package and finish, now the service is registered

Click on maintain and click on Call Browser to open a browser to test the service,
basic authentication will be required.