SAP Netweaver Gateway had three add-ons/components namely GW_CORE(gateway core), IW_FND
(foundation server) and IW_BEP(Business Enablement provisioning), SAP_gwfn740. The GW_CORE and
IW_FND components were required for Gateway Server functionalities, whereas IW_BEP was used for
Gateway Backend functionalities.
After 7.4 release, all the three components are bundled into a single component SAP_GWFND called
Gateway Foundation.
Tcode: SEGW-- Gateway Service Builder.
Provide a project name ex: ZGW_BILLPAID.
Project Type: Service with SAP Annotation.
Different project Types:Odata4.0 services, service with Vocabulary-based annotations,
Annotation-Model for referenced service.
Four Folder are created:
1. Data Model:
this will have three sub folders i.e.
a. Entity Type : It is a structure and will have the below folders
-properties: will have field details of the entitype type.
- navigation properties
b. Associations:
c. Entity Set: It is a internal table.
2. Service Implementation: Contains operation or methods for the Entityset created
-Create, Delete, GetEntity(Read), GetEntitySet(Query), Update.
3. Runtime Artifiacts:
4. Service Maintenance:
QQQ. what is a complex type.
Right click on Entity Type and create Entity Type and Entity Set.
example:InstalHeader and InstallHeaderSet.(select checkbox for creating related
internal table.).
click on properties folder and in right panle click on the create to add the fields and then save.
Click on Generate Icon in the menubar to register the Odata service.
Two classes (base and extended)for each i.e. Model provide class and data provider class.
Technical service name is the OData service name.
Model Provider Class inherits from class: /IWBEP/CL_MGW_ABS_MODEL and Data Provider Class inherits
from class:/IWBEP/CL_MGW_ABS_DATA.
Go to your Gateway Hub (Front-end system) and execute t-code /n/IWFND/MAINT_SERVICE. Save this t-
code in your favorite list or remember it by heart. 🙂 You will need it for all your OData services.
Our service is still not added to the Service Catalog. After we add the service to the Service Catalog, only
then is our service available for the outer world to access.
Hit the Add Service button, provide your backend system alias and external service name (our case
ZGW_PO_SRV). You will get the service you created in the backend. Click on it and it would show the
Service (technical/external) name along with the Technical name of the Model (ZGW_PO_MDL) and hit
save. Go back to the Service Catalog screen.
Use Tcode :/IWFND/GW_CLIENT and click on execute to test it.
Tcode: T-code /n/IWFND/ERROR_LOG for error analysis.
if any implementation error::
go to Tcode; SEGW and go to the z**dpc_ext class and serach for inherited method with name as
entityset_get_entityset. click on redefine method in the right hand panel.
sva e& activate.
check in the inherited methods ==>redefination==>entityset_get_entityset is available or not. write your
logic in the method.
==================
FAQ:
4 Different ways to create OData Services ??
Dear SAPLearners, in this blog post i will discuss about different ways to create and model an OData
service in SEGW(Gateway Builder) and Eclipse ABAP Development Tools.
SEGW(Gateway Builder) Tool
There are 3 different approaches to create and model an OData service in gateway builder(SEGW). They
are
1. ABAP code-based implementation
This is most used approach in creating OData services. In this approach we define the model and write
the business data retrieval logic in run-time generated artifact DPC_EXT class.
Also Read: How to create OData Service using code-based implementation.
Before discussing the other approaches i would like to introduce you to the SADL (Service Adaptation
Description Language), as the other 2 approaches depend on this framework.
Service Adaptation Description Language(SADL)
SADL is an ABAP technology that enables the consumption of entity relationship-like ABAP data models in
various scenarios with a common development experience based on a model-driven approach. – SAP
definition
SADL model is a data model like CDS views, DDIC tables (or) views and BOPF.
In short, SADL framework allows us to create OData service based on a model-driven approach using
ABAP CDS Views.
Now, lets continue with other approaches
2. Mapping Editor
In SEGW gateway builder, you can map an ABAP CDS Views as a data source to the entity type properties.
Also Read: How to create OData Service in SEGW Using the Mapping Editor
With this approach, the business logic is available in ABAP CDS View. The SADL framework provides a
standard, optimized implementation of the OData service to retrieve data.
You can map as many as ABAP CDS views in a single SEGW OData service.
3. Referenced Data Source
In SEGW gateway builder, you can reference an ABAP CDS Views as a data source. Each entity type in
OData service model corresponds to 1 ABAP CDS view.
Also Read: How to create OData Service based on Referenced Data Sources
Along with these 3 approaches we have another approach, that is using annotation in ABAP CDS views.
ABAP Development Tools(Eclipse-based IDE)
4. Using Annotation
In this approach we can create OData service directly on ABAP CDS View in Eclipse ABAP Development
Tools using annotation @OData.publish: true
Also Read: How to create OData service on ABAP CDS view using Annotation
Now we know 4 different ways to create OData service and different tools cover different use cases.
Below is the table which compares different approaches.
============
Structure of Odata Service have mainly two parts
- Service document
- Service metadata document.
Service document:
Service documents consists of all list of resources URI’s that can be accessible. ZSL_EPM_DEMO is the
OData service which we will be going to build in future tutorials. Basically this service will retrieve sales
order data.
Lets look at what information does this service documents holds.Service document is accessible through
the URI.
Service metadata document:
Service metadata documents contains meta data of all elements in the service. You can see the metadata
of a service by simple adding “$metadata” to the service URI.
=============
What is OData and REST in SAP Netweaver Gateway?
Q. You can group multiple operations into a single HTTP request by using?
A1. OData Grouping
A2. OData Batching
A3. OData Collection
A4. OData Clustering
transaction is used to check the error logs in SAP Gateway hub system: /IWFND/ERROR_LOG
Q. Which of the following tasks can be performed using transaction /IWFND/MAINT_SERVICE?
A1. Assign/remove additional system alias
A2. Define the data model of an OData service
A3. Add/remove services from the hub
A4. Implement the data provider extension class
13. When generating a service by using redefinition, which of the following options are available?
A1. Redefine a BW query service
A2. Redefine an RFC function module
A3. Redefine an existing SAP Gateway service
A4. Redefine a search help
Q14. What are different ways to create a Gateway service based on a CDS view?
A1. Code mapping
A2. Project redefinition
A3. Data reference
A4. @OData.publish
Q16. In routing scenario, the SAP system alias that points to specific back-end system is selected by
using following as a filter?
A1. User role
A2. User profile parameter
A3. Modify the SAP standard implementation
A4. Implementing a BAdI
Q17. $expand is used to retrieve multiple entities that are connected through?
A1. Identical property names
A2. Function Imports
A3. Navigation properties
A4. Connectors