SlideShare a Scribd company logo
SAP NetWeaver Gateway – Service Development
How to develop a Gateway Service using code based
implementation
Applies to:
SAP NetWeaver Gateway 2.0 SP6 and
SAP NetWeaver 7.40 SP2
Author:
Andre Fischer, SAP AG, http://scn.sap.com/people/andre.fischer
SAP NetWeaver Gateway – Service Development
2
TABLE OF CONTENTS
HOW TO GUIDE OBJECTIVES........................................................................................................................ 3
BUSINESS EXAMPLE...................................................................................................................................... 3
OVERVIEW OF TASKS .................................................................................................................................... 4
Task 1: Creating a Data Model with entity type Product and the entity set Products.............................. 4
Task 2: Generate runtime objects and register and activate the service .................................................. 4
Task 3: Perform Service Implementation for GET_ENTITYSET.................................................................. 4
Task 4: Perform Service Implementation for GET_ENTITY......................................................................... 4
HOW TO SECTION........................................................................................................................................... 5
Task 1: Creating a Data Model with entity Product and the entity set ProductCollection ....................... 5
Step: Create a new project in the Service Builder (transaction SEGW)............................................................ 5
Step: Import DDIC Structure to create the entity - Product ............................................................................... 5
Step: Create an entity set for the previously created entity............................................................................... 8
Task 2: Generate runtime objects and register and activate the service .................................................. 9
Step: Generate runtime objects......................................................................................................................... 9
Step: Test the new OData service (metadata only)......................................................................................... 12
Task 3: Service Implementation for GET_ENTITYSET............................................................................... 15
Step: Implement the data provider class ......................................................................................................... 15
Task 4 Service Implementation for GET_ENTITY....................................................................................... 18
Step: Implement the method GET_ENTITY operation of the entityset Products ............................................ 19
Step: Test GET_ENTITY method .................................................................................................................... 21
SAP NetWeaver Gateway – Service Development
3
HOW TO GUIDE OBJECTIVES
In this How to Guide, you will learn how to quickly create an OData service with SAP NetWeaver
Gateway. Unlike the usual “Hello World” sample we will leverage demo data from the Enterprise
Procurement Model which is part of every SAP NetWeaver ABAP server as of 7.02.
In this How to Guide we will introduce the central development tool the Service Builder and will
explain the basics of implementing services using the OData channel programming model.
In this How to Guide, you will learn how to create a data model based on a DDIC structure and
implement the appropriate methods in the data provider extension class.
After completing this lesson, you will be able to:
 Create a data model with one entity set and one entity type where the entity type is based
on a DDIC structure
 Implement the GET_ENTITYSET method in the data provider extension class
 Implement the GET_ENTITY method in the data provider extension class
BUSINESS EXAMPLE
You want to build an application that shows a list of products.
SAP NetWeaver Gateway – Service Development
4
OVERVIEW OF TASKS
Task 1: Creating a Data Model with entity type Product and the entity set Products
1. Create a new project ZGW_PRODUCT.
2. Import DDIC Structure BAPI_EPM_PRODUCT_HEADER to create the entity type – Product
3. Create an entity set Products which is based on the entity type Product you have created before.
Task 2: Generate runtime objects and register and activate the service
1. Generate the runtime objects of your project
2. Register the service in the Gateway hub system (which is in this case the local system since we are
using Gateway in an embedded deployment scenario)
3. Test the service using the Gateway Client.
Task 3: Perform Service Implementation for GET_ENTITYSET
1. Implement the method PRODUCTS_GET_ENTITYSET in the extension class of the data provider
class
2. We will use the function module 'BAPI_EPM_PRODUCT_GET_LIST' to retrieve the product data
3. Please note that the parameter ET_ENTITYSET that contains the data returned by the
GET_ENTITYSET method has the same structure as the structure
BAPI_EPM_PRODUCT_HEADER that has been used to generate the entity type Product.
Task 4: Perform Service Implementation for GET_ENTITY
1. Implement the method PRODUCTS_GET_ENTITY in the extension class of the data provider class
2. We will use the function module 'BAPI_EPM_PRODUCT_GET_DETAIL' to retrieve the product
details
3. Please note that the parameter ER_ENTITY that contains the data returned by the GET_ENTITY
method has the same structure as the structure BAPI_EPM_PRODUCT_HEADER that has been
used to generate the entity type Product
SAP NetWeaver Gateway – Service Development
5
HOW TO SECTION
Task 1: Creating a Data Model with entity Product and the entity set Products
Step: Create a new project in the Service Builder (transaction SEGW)
1. Create a new project ZGW_PRODUCT
Step: Import DDIC Structure to create the entity - Product
1. Right-click Data Model and choose Import  DDIC Structure
SAP NetWeaver Gateway – Service Development
6
2. Enter the following value in the wizard and then press Enter:
ABAP Structure: BAPI_EPM_PRODUCT_HEADER
and press ENTER.
Result:
The wizard will automatically fill the field ObjectName with the value BapiEpmProductHeader and
create an entity set based on the DDIC structure.
3. Change the default values such that
a. the property PRODUCT_ID becomes a key field
b. the name of the entity type is Product rather than BapiEpmProductHeader
SAP NetWeaver Gateway – Service Development
7
4. As a result the values should like follows.
5. Press continue .
6. Press Save.
SAP NetWeaver Gateway – Service Development
8
Step: Create an entity set for the previously created entity
1. Expand the node Data Model and double-click Entity Sets:
2. Click the Create button to a new line to the table:
3. Enter the following values:
Name Entity Type Name Adressable
Products Product X
4. Choose Save:
Caution:
Please make sure that the Addressable flag is marked because otherwise GWPA will refuse to
generate a consumer application.
SAP NetWeaver Gateway – Service Development
9
Task 2: Generate runtime objects and register and activate the service
Step: Generate runtime objects
1. Choose the Generate pushbutton:
2. Leave the default values and choose Enter:
Please note the Technical Service Name ZGW_PRODUCT_SRV is equal to the External Service
SAP NetWeaver Gateway – Service Development
10
Name required to consume this service later on.
3. Choose Local Object:
4. Verify that the runtime objects have been generated successfully:
The following objects have been generated:
Step: Register and activate the service
1. Double-click Service Maintenance:
SAP NetWeaver Gateway – Service Development
11
2. Select system GW_HUB and choose the Register button:
Alternatively you can click on the entry GW_HUB on the left hand side, right click and select Register
from the context menu.
3. Confirm the warning message displayed in the popup:
4. (Optional) If you have defined multiple system alias entries in the Gateway hub system that point
back to your backend press F4 to select a system alias and confirm the Select System Alias popup:
SAP NetWeaver Gateway – Service Development
12
5. In the Add Service dialogue leave the default values and enter $tmp as the package and choose
Enter or press the button Local Object:
The External Service Name ZGW_PRODUCT_SRV is defaulted with the Technical Service Name
from the previous step.
6. Verify that the service has been registered and activated successfully:
Step: Test the new OData service (metadata only)
1. Right click the system in which you have registered the service and select Maintain. Alternatively you
can select the system in the mass maintenance view and select the Maintain button.
SAP NetWeaver Gateway – Service Development
13
2. This will start the Activate and Maintain Services transcation /IWFND_MAINT_SERVICE where the
service you have just registered is selected.
3. Press the button Gateway Client. This will open in a new window start transaction
/IWFND/GW_CLIENT using the the URI
/sap/opu/odata/sap/ZGW_PRODUCT_SRV/?$format=xml and choose Execute. This will show the
service document of the newly created service.
SAP NetWeaver Gateway – Service Development
14
Please note that ZGW_PRODUCT_SRV is the External Service Name that was registered before.
SAP NetWeaver Gateway – Service Development
15
Task 3: Service Implementation for GET_ENTITYSET
Step: Implement the data provider class
1. In the Service Builder go back using the green arrow and expand the node Service Implementation,
then the Entity Set Products and right click on the entry GetEntitySet (Query).
2. Confirm the warning that the method PRODUCTS_GET_ENTITYSET has not yet been
implemented.
This will open the Class Builder.
Alternatively expand the node Runtime Artifacts and double-click on
ZCL_ZGW_PRODUCT_DPC_EXT
3. Activate the Change mode
4. Redefine method PRODUCTS_GET_ENTITYSET.
SAP NetWeaver Gateway – Service Development
16
5. Implement Method PRODUCTCOLLECTIO_GET_ENTITYSET
a. You may copy the code from
ZCL_ZGW_PRODUCT_DPC_EXT-> PRODUCTS_GET_ENTITYSET or
b. Perform the following steps:
i. Choose Pattern
ii. Select Call Function and enter the value BAPI_EPM_PRODUCT_GET_LIST
iii. Assign et_entityset to headerdata
c. Or take the code from here using Cut & Paste
SAP NetWeaver Gateway – Service Development
17
d. Activate the coding
method PRODUCTS_GET_ENTITYSET.
CALL FUNCTION 'BAPI_EPM_PRODUCT_GET_LIST'
* EXPORTING
* MAX_ROWS =
TABLES
HEADERDATA = et_entityset
* SELPARAMPRODUCTID =
* SELPARAMSUPPLIERNAMES =
* SELPARAMCATEGORIES =
* RETURN =
.
endmethod.
Start the Gateway Client (Transaction /IWFND/GW_CLIENT) in a separate window to run the service.
Provide the following URI to get the Product Collection:
/sap/opu/odata/sap/ZGW_PRODUCT_SRV/Products
SAP NetWeaver Gateway – Service Development
18
Task 4 Service Implementation for GET_ENTITY
Prerequisites
- You have performed Task 1 to 3 and you have performed the following steps
o Project creation
o You have created a model with the entity set Products which is based on an entity type
Product that has been created using import of the DDIC structure
BAPI_EPM_PRODUCT_HEADER
o Implementation of the GET_ENTITYSET method
Objectives
In the following you will learn how to implement the GET_ENTITY method. For this we have to learn how to
retrieve the key(s )
If in the Gateway Client following GET statement is issued
/sap/opu/odata/sap/ZGW_PRODUCT_SRV/Products('AD-1000')
the framework takes care that the method PRODUCTS_GET_ENTITY of the data provider extension class
ZCL_ZGW_PRODUCT_DPC_EXT is called.
In order to provide the caller with the requested content the key value 'AD-1000' shall be retrieved using the
import parameter IO_TECH_REQUEST_CONTEXT.
SAP NetWeaver Gateway – Service Development
19
This import parameter “speaks” the technical (internal) names and hence is not influenced by any redefine
function which could result that the external name of the key field can potentially be changed. The internal
names - unless explicitly set by the model provider - are derived from the "original" name.
We can set an external breakpoint in the PRODUCTS_GET_ENTITY method to check that the key value
‘AD-1000’ can be retrieved in the ABAP code as a key-value pair from the internal table. This table would
contain several entries in case the entity set has more than one key field.
The parameter ER_ENTITY which is used to return the data has the same type as the data dictionary object
that has been imported namely BAPI_EPM_PRODUCT_HEADER.
Step: Implement the method GET_ENTITY operation of the entityset Products
1. Open the Service Builder project ZGW_PRODUCT that you have created in the previous exercise.
2. Expand the node Service Implementation, drill down to the entity set Products and expand the same.
Right click on the GetEntity method and select Go to ABAP Workbench
3. Confirm the message “Operation PRODUCTS_GET_ENTITY has not yet been implemented”
4. Scroll down to the method PRODUCTS_GET_ENTITY (1), switch to the edit mode (2) and choose
redefine (3)
SAP NetWeaver Gateway – Service Development
20
5. You can retrieve the sample code from the following code snippet.
method PRODUCTS_GET_ENTITY.
DATA: lt_keys TYPE /IWBEP/T_MGW_TECH_PAIRS,
ls_key TYPE /IWBEP/S_MGW_TECH_PAIR,
ls_product_id type BAPI_EPM_PRODUCT_ID.
lt_keys = IO_TECH_REQUEST_CONTEXT->GET_KEYS( ).
READ TABLE lt_keys with key name = 'PRODUCT_ID'
INTO ls_key.
ls_product_id-PRODUCT_ID = ls_key-value.
CALL FUNCTION 'BAPI_EPM_PRODUCT_GET_DETAIL'
EXPORTING
PRODUCT_ID = ls_product_id
IMPORTING
HEADERDATA = ER_ENTITY
* TABLES
* RETURN = lt_return
.
endmethod.
6. (Optional) You can check how the data is retrieved in the ABAP code if you set an external breakpoint
SAP NetWeaver Gateway – Service Development
21
Step: Test GET_ENTITY method
1. Check the implementation by using the following request URI in the Gateway Client
/sap/opu/odata/sap/ZGW_PRODUCT_SRV/Products('AD-1000')
SAP NetWeaver Gateway – Service Development
22
You are done 
© 2013 SAP AG. All rights reserved.
SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP
BusinessObjects Explorer, StreamWork, SAP HANA, and other SAP
products and services mentioned herein as well as their respective
logos are trademarks or registered trademarks of SAP AG in Germany
and other countries.
Business Objects and the Business Objects logo, BusinessObjects,
Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and
other Business Objects products and services mentioned herein as
well as their respective logos are trademarks or registered trademarks
of Business Objects Software Ltd. Business Objects is an SAP
company.
Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL
Anywhere, and other Sybase products and services mentioned herein
as well as their respective logos are trademarks or registered
trademarks of Sybase Inc. Sybase is an SAP company.
Crossgate, m@gic EDDY, B2B 360°, and B2B 360° Services are
registered trademarks of Crossgate AG in Germany and other
countries. Crossgate is an SAP company.
All other product and service names mentioned are the trademarks of
their respective companies. Data contained in this document serves
informational purposes only. National product specifications may vary.
These materials are subject to change without notice. These materials
are provided by SAP AG and its affiliated companies ("SAP Group")
for informational purposes only, without representation or warranty of
any kind, and SAP Group shall not be liable for errors or omissions
with respect to the materials. The only warranties for SAP Group
products and services are those that are set forth in the express
warranty statements accompanying such products and services, if
any. Nothing herein should be construed as constituting an additional
warranty.
www.sap.com

More Related Content

What's hot

Introduction to SAP Gateway and OData
Introduction to SAP Gateway and ODataIntroduction to SAP Gateway and OData
Introduction to SAP Gateway and ODataChris Whealy
 
Beginner's Guide: Programming with ABAP on HANA
Beginner's Guide: Programming with ABAP on HANABeginner's Guide: Programming with ABAP on HANA
Beginner's Guide: Programming with ABAP on HANAAshish Saxena
 
Assigning the personal numbers in the maintenance work centers
Assigning the personal numbers in the maintenance work centersAssigning the personal numbers in the maintenance work centers
Assigning the personal numbers in the maintenance work centersVenkatesh Babu
 
Sap abap ale idoc
Sap abap ale idocSap abap ale idoc
Sap abap ale idocBunty Jain
 
Azure Data Factory | Moving On-Premise Data to Azure Cloud | Microsoft Azure ...
Azure Data Factory | Moving On-Premise Data to Azure Cloud | Microsoft Azure ...Azure Data Factory | Moving On-Premise Data to Azure Cloud | Microsoft Azure ...
Azure Data Factory | Moving On-Premise Data to Azure Cloud | Microsoft Azure ...Edureka!
 
Zebra sap-smartforms-solution
Zebra sap-smartforms-solutionZebra sap-smartforms-solution
Zebra sap-smartforms-solutionmartin_josep
 
Presentation on Crystal Reports and Business Objects Enterprise Features
Presentation on Crystal Reports and Business Objects Enterprise FeaturesPresentation on Crystal Reports and Business Objects Enterprise Features
Presentation on Crystal Reports and Business Objects Enterprise FeaturesInfoDev
 
Technical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part IITechnical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part IIAshish Saxena
 
SAP Technical Consultant CV
SAP Technical Consultant CVSAP Technical Consultant CV
SAP Technical Consultant CVBhavesh Panchal
 
LSMW - Multiple Line of Material Master Long Text
LSMW - Multiple Line of Material Master Long TextLSMW - Multiple Line of Material Master Long Text
LSMW - Multiple Line of Material Master Long TextRidzuan
 
SAP Systems Integration by SAP PI (XI)
SAP Systems Integration by SAP PI (XI)SAP Systems Integration by SAP PI (XI)
SAP Systems Integration by SAP PI (XI)alpercelk
 
SAP Quickviewer
SAP QuickviewerSAP Quickviewer
SAP Quickviewerotchmarz
 
Simple exercise on o data and sap ui5 application for the basic crud operatio...
Simple exercise on o data and sap ui5 application for the basic crud operatio...Simple exercise on o data and sap ui5 application for the basic crud operatio...
Simple exercise on o data and sap ui5 application for the basic crud operatio...Nagendra Babu
 
Microsoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxMicrosoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxsamtakke1
 

What's hot (20)

CDS Views.pptx
CDS Views.pptxCDS Views.pptx
CDS Views.pptx
 
Introduction to SAP Gateway and OData
Introduction to SAP Gateway and ODataIntroduction to SAP Gateway and OData
Introduction to SAP Gateway and OData
 
Beginner's Guide: Programming with ABAP on HANA
Beginner's Guide: Programming with ABAP on HANABeginner's Guide: Programming with ABAP on HANA
Beginner's Guide: Programming with ABAP on HANA
 
SAP BRF+ Kılavuzu
SAP BRF+ KılavuzuSAP BRF+ Kılavuzu
SAP BRF+ Kılavuzu
 
Badi document
Badi documentBadi document
Badi document
 
Assigning the personal numbers in the maintenance work centers
Assigning the personal numbers in the maintenance work centersAssigning the personal numbers in the maintenance work centers
Assigning the personal numbers in the maintenance work centers
 
Sap abap ale idoc
Sap abap ale idocSap abap ale idoc
Sap abap ale idoc
 
Azure Data Factory | Moving On-Premise Data to Azure Cloud | Microsoft Azure ...
Azure Data Factory | Moving On-Premise Data to Azure Cloud | Microsoft Azure ...Azure Data Factory | Moving On-Premise Data to Azure Cloud | Microsoft Azure ...
Azure Data Factory | Moving On-Premise Data to Azure Cloud | Microsoft Azure ...
 
Ragavendiran's Resume
Ragavendiran's ResumeRagavendiran's Resume
Ragavendiran's Resume
 
Zebra sap-smartforms-solution
Zebra sap-smartforms-solutionZebra sap-smartforms-solution
Zebra sap-smartforms-solution
 
Presentation on Crystal Reports and Business Objects Enterprise Features
Presentation on Crystal Reports and Business Objects Enterprise FeaturesPresentation on Crystal Reports and Business Objects Enterprise Features
Presentation on Crystal Reports and Business Objects Enterprise Features
 
Technical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part IITechnical Overview of CDS View - SAP HANA Part II
Technical Overview of CDS View - SAP HANA Part II
 
Dip profiles-documentation
Dip profiles-documentationDip profiles-documentation
Dip profiles-documentation
 
Sapui5 & Fiori
Sapui5 & FioriSapui5 & Fiori
Sapui5 & Fiori
 
SAP Technical Consultant CV
SAP Technical Consultant CVSAP Technical Consultant CV
SAP Technical Consultant CV
 
LSMW - Multiple Line of Material Master Long Text
LSMW - Multiple Line of Material Master Long TextLSMW - Multiple Line of Material Master Long Text
LSMW - Multiple Line of Material Master Long Text
 
SAP Systems Integration by SAP PI (XI)
SAP Systems Integration by SAP PI (XI)SAP Systems Integration by SAP PI (XI)
SAP Systems Integration by SAP PI (XI)
 
SAP Quickviewer
SAP QuickviewerSAP Quickviewer
SAP Quickviewer
 
Simple exercise on o data and sap ui5 application for the basic crud operatio...
Simple exercise on o data and sap ui5 application for the basic crud operatio...Simple exercise on o data and sap ui5 application for the basic crud operatio...
Simple exercise on o data and sap ui5 application for the basic crud operatio...
 
Microsoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxMicrosoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptx
 

Viewers also liked (6)

NetWeaver Gateway- Introduction to REST
NetWeaver Gateway- Introduction to RESTNetWeaver Gateway- Introduction to REST
NetWeaver Gateway- Introduction to REST
 
SAP Draft Solution for GST India
SAP Draft Solution for GST IndiaSAP Draft Solution for GST India
SAP Draft Solution for GST India
 
SAP services – India GST
SAP services – India GST SAP services – India GST
SAP services – India GST
 
SAP GST INDIA
SAP GST INDIA SAP GST INDIA
SAP GST INDIA
 
GST Power Point Presentation
GST Power Point PresentationGST Power Point Presentation
GST Power Point Presentation
 
itelligence GST implementation - SAP
itelligence GST implementation - SAPitelligence GST implementation - SAP
itelligence GST implementation - SAP
 

Similar to How to develop a gateway service using code based implementation

294151805 end-to-end-o data-service-sapui5-application
294151805 end-to-end-o data-service-sapui5-application294151805 end-to-end-o data-service-sapui5-application
294151805 end-to-end-o data-service-sapui5-applicationFaina Fridman
 
Bpc 10.0 NW Mass User Management tool
Bpc 10.0 NW Mass User Management toolBpc 10.0 NW Mass User Management tool
Bpc 10.0 NW Mass User Management toolShanmugam Veerichetty
 
( 5 ) Office 2007 Create A Business Data Catolog
( 5 ) Office 2007   Create A Business Data Catolog( 5 ) Office 2007   Create A Business Data Catolog
( 5 ) Office 2007 Create A Business Data CatologLiquidHub
 
Sap query creation & transcation code creation for sap query
Sap query creation & transcation code creation for sap querySap query creation & transcation code creation for sap query
Sap query creation & transcation code creation for sap querySURESH BABU MUCHINTHALA
 
Nintex attachment workflow
Nintex attachment workflowNintex attachment workflow
Nintex attachment workflowAlan Richards
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLAkhil Mittal
 
Different architecture topology for dynamics 365 retail
Different architecture topology for dynamics 365 retailDifferent architecture topology for dynamics 365 retail
Different architecture topology for dynamics 365 retailSonny56
 
Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)Mohamed Saleh
 
Server side programming bt0083
Server side programming bt0083Server side programming bt0083
Server side programming bt0083Divyam Pateriya
 
SetFocus SQL Portfolio
SetFocus SQL PortfolioSetFocus SQL Portfolio
SetFocus SQL Portfoliogeometro17
 
Java spring mysql without hibernate(2) (1)
Java spring mysql without hibernate(2) (1)Java spring mysql without hibernate(2) (1)
Java spring mysql without hibernate(2) (1)AmedJacobReza
 
Assignment 2-2013 Final (5).docx8745 Software Systems Archit.docx
Assignment 2-2013 Final (5).docx8745 Software Systems Archit.docxAssignment 2-2013 Final (5).docx8745 Software Systems Archit.docx
Assignment 2-2013 Final (5).docx8745 Software Systems Archit.docxsherni1
 
Introduction to the .NET Access Control Service
Introduction to the .NET Access Control ServiceIntroduction to the .NET Access Control Service
Introduction to the .NET Access Control Servicebutest
 
Introduction to the .NET Access Control Service
Introduction to the .NET Access Control ServiceIntroduction to the .NET Access Control Service
Introduction to the .NET Access Control Servicebutest
 
Aspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAlfa Gama Omega
 

Similar to How to develop a gateway service using code based implementation (20)

294151805 end-to-end-o data-service-sapui5-application
294151805 end-to-end-o data-service-sapui5-application294151805 end-to-end-o data-service-sapui5-application
294151805 end-to-end-o data-service-sapui5-application
 
ASP.NET Identity
ASP.NET IdentityASP.NET Identity
ASP.NET Identity
 
Bpc 10.0 NW Mass User Management tool
Bpc 10.0 NW Mass User Management toolBpc 10.0 NW Mass User Management tool
Bpc 10.0 NW Mass User Management tool
 
SAP TAO 2.0
SAP TAO 2.0SAP TAO 2.0
SAP TAO 2.0
 
Data Modeling in SAP Gateway – maximize performance at all levels
Data Modeling in SAP Gateway – maximize performance at all levelsData Modeling in SAP Gateway – maximize performance at all levels
Data Modeling in SAP Gateway – maximize performance at all levels
 
( 5 ) Office 2007 Create A Business Data Catolog
( 5 ) Office 2007   Create A Business Data Catolog( 5 ) Office 2007   Create A Business Data Catolog
( 5 ) Office 2007 Create A Business Data Catolog
 
Building richwebapplicationsusingasp
Building richwebapplicationsusingaspBuilding richwebapplicationsusingasp
Building richwebapplicationsusingasp
 
Sap query creation & transcation code creation for sap query
Sap query creation & transcation code creation for sap querySap query creation & transcation code creation for sap query
Sap query creation & transcation code creation for sap query
 
Nintex attachment workflow
Nintex attachment workflowNintex attachment workflow
Nintex attachment workflow
 
LearningMVCWithLINQToSQL
LearningMVCWithLINQToSQLLearningMVCWithLINQToSQL
LearningMVCWithLINQToSQL
 
Different architecture topology for dynamics 365 retail
Different architecture topology for dynamics 365 retailDifferent architecture topology for dynamics 365 retail
Different architecture topology for dynamics 365 retail
 
Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)Module 4: Introduction to ASP.NET 3.5 (Material)
Module 4: Introduction to ASP.NET 3.5 (Material)
 
Server side programming bt0083
Server side programming bt0083Server side programming bt0083
Server side programming bt0083
 
SetFocus SQL Portfolio
SetFocus SQL PortfolioSetFocus SQL Portfolio
SetFocus SQL Portfolio
 
Java spring mysql without hibernate(2) (1)
Java spring mysql without hibernate(2) (1)Java spring mysql without hibernate(2) (1)
Java spring mysql without hibernate(2) (1)
 
Assignment 2-2013 Final (5).docx8745 Software Systems Archit.docx
Assignment 2-2013 Final (5).docx8745 Software Systems Archit.docxAssignment 2-2013 Final (5).docx8745 Software Systems Archit.docx
Assignment 2-2013 Final (5).docx8745 Software Systems Archit.docx
 
Introduction to the .NET Access Control Service
Introduction to the .NET Access Control ServiceIntroduction to the .NET Access Control Service
Introduction to the .NET Access Control Service
 
Introduction to the .NET Access Control Service
Introduction to the .NET Access Control ServiceIntroduction to the .NET Access Control Service
Introduction to the .NET Access Control Service
 
Aspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_csAspnet mvc tutorial_01_cs
Aspnet mvc tutorial_01_cs
 
E-Bazaar
E-BazaarE-Bazaar
E-Bazaar
 

Recently uploaded

Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportAvinash Rai
 
How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17Celine George
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfbu07226
 
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...Abhinav Gaur Kaptaan
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryEugene Lysak
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePedroFerreira53928
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptxmansk2
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasiemaillard
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTechSoup
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfjoachimlavalley1
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resourcesdimpy50
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXMIRIAMSALINAS13
 
The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...sanghavirahi2
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfQucHHunhnh
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxCapitolTechU
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxbennyroshan06
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersPedroFerreira53928
 

Recently uploaded (20)

Industrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training ReportIndustrial Training Report- AKTU Industrial Training Report
Industrial Training Report- AKTU Industrial Training Report
 
How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17How to Manage Notification Preferences in the Odoo 17
How to Manage Notification Preferences in the Odoo 17
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
 
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
Research Methods in Psychology | Cambridge AS Level | Cambridge Assessment In...
 
The Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. HenryThe Last Leaf, a short story by O. Henry
The Last Leaf, a short story by O. Henry
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
Introduction to Quality Improvement Essentials
Introduction to Quality Improvement EssentialsIntroduction to Quality Improvement Essentials
Introduction to Quality Improvement Essentials
 
2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx2024_Student Session 2_ Set Plan Preparation.pptx
2024_Student Session 2_ Set Plan Preparation.pptx
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdfTelling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
Telling Your Story_ Simple Steps to Build Your Nonprofit's Brand Webinar.pdf
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
NCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdfNCERT Solutions Power Sharing Class 10 Notes pdf
NCERT Solutions Power Sharing Class 10 Notes pdf
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
Mattingly "AI & Prompt Design: Limitations and Solutions with LLMs"
 
The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...The impact of social media on mental health and well-being has been a topic o...
The impact of social media on mental health and well-being has been a topic o...
 
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdfDanh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
Danh sách HSG Bộ môn cấp trường - Cấp THPT.pdf
 
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptxslides CapTechTalks Webinar May 2024 Alexander Perry.pptx
slides CapTechTalks Webinar May 2024 Alexander Perry.pptx
 
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptxMARUTI SUZUKI- A Successful Joint Venture in India.pptx
MARUTI SUZUKI- A Successful Joint Venture in India.pptx
 
Basic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumersBasic phrases for greeting and assisting costumers
Basic phrases for greeting and assisting costumers
 

How to develop a gateway service using code based implementation

  • 1. SAP NetWeaver Gateway – Service Development How to develop a Gateway Service using code based implementation Applies to: SAP NetWeaver Gateway 2.0 SP6 and SAP NetWeaver 7.40 SP2 Author: Andre Fischer, SAP AG, http://scn.sap.com/people/andre.fischer
  • 2. SAP NetWeaver Gateway – Service Development 2 TABLE OF CONTENTS HOW TO GUIDE OBJECTIVES........................................................................................................................ 3 BUSINESS EXAMPLE...................................................................................................................................... 3 OVERVIEW OF TASKS .................................................................................................................................... 4 Task 1: Creating a Data Model with entity type Product and the entity set Products.............................. 4 Task 2: Generate runtime objects and register and activate the service .................................................. 4 Task 3: Perform Service Implementation for GET_ENTITYSET.................................................................. 4 Task 4: Perform Service Implementation for GET_ENTITY......................................................................... 4 HOW TO SECTION........................................................................................................................................... 5 Task 1: Creating a Data Model with entity Product and the entity set ProductCollection ....................... 5 Step: Create a new project in the Service Builder (transaction SEGW)............................................................ 5 Step: Import DDIC Structure to create the entity - Product ............................................................................... 5 Step: Create an entity set for the previously created entity............................................................................... 8 Task 2: Generate runtime objects and register and activate the service .................................................. 9 Step: Generate runtime objects......................................................................................................................... 9 Step: Test the new OData service (metadata only)......................................................................................... 12 Task 3: Service Implementation for GET_ENTITYSET............................................................................... 15 Step: Implement the data provider class ......................................................................................................... 15 Task 4 Service Implementation for GET_ENTITY....................................................................................... 18 Step: Implement the method GET_ENTITY operation of the entityset Products ............................................ 19 Step: Test GET_ENTITY method .................................................................................................................... 21
  • 3. SAP NetWeaver Gateway – Service Development 3 HOW TO GUIDE OBJECTIVES In this How to Guide, you will learn how to quickly create an OData service with SAP NetWeaver Gateway. Unlike the usual “Hello World” sample we will leverage demo data from the Enterprise Procurement Model which is part of every SAP NetWeaver ABAP server as of 7.02. In this How to Guide we will introduce the central development tool the Service Builder and will explain the basics of implementing services using the OData channel programming model. In this How to Guide, you will learn how to create a data model based on a DDIC structure and implement the appropriate methods in the data provider extension class. After completing this lesson, you will be able to:  Create a data model with one entity set and one entity type where the entity type is based on a DDIC structure  Implement the GET_ENTITYSET method in the data provider extension class  Implement the GET_ENTITY method in the data provider extension class BUSINESS EXAMPLE You want to build an application that shows a list of products.
  • 4. SAP NetWeaver Gateway – Service Development 4 OVERVIEW OF TASKS Task 1: Creating a Data Model with entity type Product and the entity set Products 1. Create a new project ZGW_PRODUCT. 2. Import DDIC Structure BAPI_EPM_PRODUCT_HEADER to create the entity type – Product 3. Create an entity set Products which is based on the entity type Product you have created before. Task 2: Generate runtime objects and register and activate the service 1. Generate the runtime objects of your project 2. Register the service in the Gateway hub system (which is in this case the local system since we are using Gateway in an embedded deployment scenario) 3. Test the service using the Gateway Client. Task 3: Perform Service Implementation for GET_ENTITYSET 1. Implement the method PRODUCTS_GET_ENTITYSET in the extension class of the data provider class 2. We will use the function module 'BAPI_EPM_PRODUCT_GET_LIST' to retrieve the product data 3. Please note that the parameter ET_ENTITYSET that contains the data returned by the GET_ENTITYSET method has the same structure as the structure BAPI_EPM_PRODUCT_HEADER that has been used to generate the entity type Product. Task 4: Perform Service Implementation for GET_ENTITY 1. Implement the method PRODUCTS_GET_ENTITY in the extension class of the data provider class 2. We will use the function module 'BAPI_EPM_PRODUCT_GET_DETAIL' to retrieve the product details 3. Please note that the parameter ER_ENTITY that contains the data returned by the GET_ENTITY method has the same structure as the structure BAPI_EPM_PRODUCT_HEADER that has been used to generate the entity type Product
  • 5. SAP NetWeaver Gateway – Service Development 5 HOW TO SECTION Task 1: Creating a Data Model with entity Product and the entity set Products Step: Create a new project in the Service Builder (transaction SEGW) 1. Create a new project ZGW_PRODUCT Step: Import DDIC Structure to create the entity - Product 1. Right-click Data Model and choose Import  DDIC Structure
  • 6. SAP NetWeaver Gateway – Service Development 6 2. Enter the following value in the wizard and then press Enter: ABAP Structure: BAPI_EPM_PRODUCT_HEADER and press ENTER. Result: The wizard will automatically fill the field ObjectName with the value BapiEpmProductHeader and create an entity set based on the DDIC structure. 3. Change the default values such that a. the property PRODUCT_ID becomes a key field b. the name of the entity type is Product rather than BapiEpmProductHeader
  • 7. SAP NetWeaver Gateway – Service Development 7 4. As a result the values should like follows. 5. Press continue . 6. Press Save.
  • 8. SAP NetWeaver Gateway – Service Development 8 Step: Create an entity set for the previously created entity 1. Expand the node Data Model and double-click Entity Sets: 2. Click the Create button to a new line to the table: 3. Enter the following values: Name Entity Type Name Adressable Products Product X 4. Choose Save: Caution: Please make sure that the Addressable flag is marked because otherwise GWPA will refuse to generate a consumer application.
  • 9. SAP NetWeaver Gateway – Service Development 9 Task 2: Generate runtime objects and register and activate the service Step: Generate runtime objects 1. Choose the Generate pushbutton: 2. Leave the default values and choose Enter: Please note the Technical Service Name ZGW_PRODUCT_SRV is equal to the External Service
  • 10. SAP NetWeaver Gateway – Service Development 10 Name required to consume this service later on. 3. Choose Local Object: 4. Verify that the runtime objects have been generated successfully: The following objects have been generated: Step: Register and activate the service 1. Double-click Service Maintenance:
  • 11. SAP NetWeaver Gateway – Service Development 11 2. Select system GW_HUB and choose the Register button: Alternatively you can click on the entry GW_HUB on the left hand side, right click and select Register from the context menu. 3. Confirm the warning message displayed in the popup: 4. (Optional) If you have defined multiple system alias entries in the Gateway hub system that point back to your backend press F4 to select a system alias and confirm the Select System Alias popup:
  • 12. SAP NetWeaver Gateway – Service Development 12 5. In the Add Service dialogue leave the default values and enter $tmp as the package and choose Enter or press the button Local Object: The External Service Name ZGW_PRODUCT_SRV is defaulted with the Technical Service Name from the previous step. 6. Verify that the service has been registered and activated successfully: Step: Test the new OData service (metadata only) 1. Right click the system in which you have registered the service and select Maintain. Alternatively you can select the system in the mass maintenance view and select the Maintain button.
  • 13. SAP NetWeaver Gateway – Service Development 13 2. This will start the Activate and Maintain Services transcation /IWFND_MAINT_SERVICE where the service you have just registered is selected. 3. Press the button Gateway Client. This will open in a new window start transaction /IWFND/GW_CLIENT using the the URI /sap/opu/odata/sap/ZGW_PRODUCT_SRV/?$format=xml and choose Execute. This will show the service document of the newly created service.
  • 14. SAP NetWeaver Gateway – Service Development 14 Please note that ZGW_PRODUCT_SRV is the External Service Name that was registered before.
  • 15. SAP NetWeaver Gateway – Service Development 15 Task 3: Service Implementation for GET_ENTITYSET Step: Implement the data provider class 1. In the Service Builder go back using the green arrow and expand the node Service Implementation, then the Entity Set Products and right click on the entry GetEntitySet (Query). 2. Confirm the warning that the method PRODUCTS_GET_ENTITYSET has not yet been implemented. This will open the Class Builder. Alternatively expand the node Runtime Artifacts and double-click on ZCL_ZGW_PRODUCT_DPC_EXT 3. Activate the Change mode 4. Redefine method PRODUCTS_GET_ENTITYSET.
  • 16. SAP NetWeaver Gateway – Service Development 16 5. Implement Method PRODUCTCOLLECTIO_GET_ENTITYSET a. You may copy the code from ZCL_ZGW_PRODUCT_DPC_EXT-> PRODUCTS_GET_ENTITYSET or b. Perform the following steps: i. Choose Pattern ii. Select Call Function and enter the value BAPI_EPM_PRODUCT_GET_LIST iii. Assign et_entityset to headerdata c. Or take the code from here using Cut & Paste
  • 17. SAP NetWeaver Gateway – Service Development 17 d. Activate the coding method PRODUCTS_GET_ENTITYSET. CALL FUNCTION 'BAPI_EPM_PRODUCT_GET_LIST' * EXPORTING * MAX_ROWS = TABLES HEADERDATA = et_entityset * SELPARAMPRODUCTID = * SELPARAMSUPPLIERNAMES = * SELPARAMCATEGORIES = * RETURN = . endmethod. Start the Gateway Client (Transaction /IWFND/GW_CLIENT) in a separate window to run the service. Provide the following URI to get the Product Collection: /sap/opu/odata/sap/ZGW_PRODUCT_SRV/Products
  • 18. SAP NetWeaver Gateway – Service Development 18 Task 4 Service Implementation for GET_ENTITY Prerequisites - You have performed Task 1 to 3 and you have performed the following steps o Project creation o You have created a model with the entity set Products which is based on an entity type Product that has been created using import of the DDIC structure BAPI_EPM_PRODUCT_HEADER o Implementation of the GET_ENTITYSET method Objectives In the following you will learn how to implement the GET_ENTITY method. For this we have to learn how to retrieve the key(s ) If in the Gateway Client following GET statement is issued /sap/opu/odata/sap/ZGW_PRODUCT_SRV/Products('AD-1000') the framework takes care that the method PRODUCTS_GET_ENTITY of the data provider extension class ZCL_ZGW_PRODUCT_DPC_EXT is called. In order to provide the caller with the requested content the key value 'AD-1000' shall be retrieved using the import parameter IO_TECH_REQUEST_CONTEXT.
  • 19. SAP NetWeaver Gateway – Service Development 19 This import parameter “speaks” the technical (internal) names and hence is not influenced by any redefine function which could result that the external name of the key field can potentially be changed. The internal names - unless explicitly set by the model provider - are derived from the "original" name. We can set an external breakpoint in the PRODUCTS_GET_ENTITY method to check that the key value ‘AD-1000’ can be retrieved in the ABAP code as a key-value pair from the internal table. This table would contain several entries in case the entity set has more than one key field. The parameter ER_ENTITY which is used to return the data has the same type as the data dictionary object that has been imported namely BAPI_EPM_PRODUCT_HEADER. Step: Implement the method GET_ENTITY operation of the entityset Products 1. Open the Service Builder project ZGW_PRODUCT that you have created in the previous exercise. 2. Expand the node Service Implementation, drill down to the entity set Products and expand the same. Right click on the GetEntity method and select Go to ABAP Workbench 3. Confirm the message “Operation PRODUCTS_GET_ENTITY has not yet been implemented” 4. Scroll down to the method PRODUCTS_GET_ENTITY (1), switch to the edit mode (2) and choose redefine (3)
  • 20. SAP NetWeaver Gateway – Service Development 20 5. You can retrieve the sample code from the following code snippet. method PRODUCTS_GET_ENTITY. DATA: lt_keys TYPE /IWBEP/T_MGW_TECH_PAIRS, ls_key TYPE /IWBEP/S_MGW_TECH_PAIR, ls_product_id type BAPI_EPM_PRODUCT_ID. lt_keys = IO_TECH_REQUEST_CONTEXT->GET_KEYS( ). READ TABLE lt_keys with key name = 'PRODUCT_ID' INTO ls_key. ls_product_id-PRODUCT_ID = ls_key-value. CALL FUNCTION 'BAPI_EPM_PRODUCT_GET_DETAIL' EXPORTING PRODUCT_ID = ls_product_id IMPORTING HEADERDATA = ER_ENTITY * TABLES * RETURN = lt_return . endmethod. 6. (Optional) You can check how the data is retrieved in the ABAP code if you set an external breakpoint
  • 21. SAP NetWeaver Gateway – Service Development 21 Step: Test GET_ENTITY method 1. Check the implementation by using the following request URI in the Gateway Client /sap/opu/odata/sap/ZGW_PRODUCT_SRV/Products('AD-1000')
  • 22. SAP NetWeaver Gateway – Service Development 22 You are done 
  • 23. © 2013 SAP AG. All rights reserved. SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP BusinessObjects Explorer, StreamWork, SAP HANA, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries. Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects Software Ltd. Business Objects is an SAP company. Sybase and Adaptive Server, iAnywhere, Sybase 365, SQL Anywhere, and other Sybase products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Sybase Inc. Sybase is an SAP company. Crossgate, m@gic EDDY, B2B 360°, and B2B 360° Services are registered trademarks of Crossgate AG in Germany and other countries. Crossgate is an SAP company. All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary. These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty. www.sap.com