cancel
Showing results for 
Search instead for 
Did you mean: 

OData Service Implementation approach

former_member190010
Contributor
0 Kudos

Hi Gurus,

I am developing an OData Web Service, and I have a doubt I would like to clarify with you.

I am working with a Hub Deployment, where the IW_BEP component is installed in the SAP NW GW. This means, I will have to work with RFC functions to implement the CRUD operations in the SAP Backend.

My question is:

Which is the best way to create the operations in the SAP NW GW:

Use the "code-based implementation", and write in the class the code to call the RFC?

Or to use the "mapping operations to a data source" approach, and just do the mapping?

Below you can find some information I've found in the helpsap site.

https://help.sap.com/saphelp_gateway20sp08/helpdata/en/92/56b605d2b94477a4bab2b3d574cc67/content.htm...


Service Implementation

In the service implementation phase, you define the runtime artifacts (operations and methods) for the data provider class. You can define the runtime artifacts in the following ways:

  • Code-based implementation: The Service Builder generates the required ABAP classes based on the data model you define. Subsequently you can navigate directly from the Service Builder to ABAP Workbench where you can access the appropriate methods and write the source code for the various different service operations. SAP provides some code patterns for data provision and metadata definition.
  • Mapping operations to a data source: You define manual relations between the parameters of a data source object and the properties of an entity. You can map data sources of type Remote Function Call (RFC) and Business Object Repository (BOR). This function is designed for use in conjunction with the Import data source function (RFC/BOR interface) and enables you to map the RFC/BOR function to the service operations. Where possible, the Service Builder proposes an operation mapping for imported RFC/BOR interfaces.


Thanks in advance.

Best Regards,

Emanuel

Accepted Solutions (1)

Accepted Solutions (1)

AshwinDutt
Active Contributor
0 Kudos

Hello Emanuel,

May be u can quickly refer the below which will give u more info on development & deployment options. Regarding Hub and Embedded Architecture.

So that u can decide what kind of development & deployment u need to follow based on ur requirements.

Deployment Options - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library


Use of SEGW will help to model ur service and generate them faster.


Everything cannot be accomplished by just performing mapping in SEGW ( GW Service Builder Tool )

Only straight forward case/ happy scenarios can be easily modeled in SEGW and perform mapping and generate ur runtime artifacts so that u create ur services faster with less time.


Some scenarios requires coding in the respective methods based on ur business use case.

U can use SEGW to model ur service and manually implement the respective methods in DPC_EXT class based on ur use case.

Some Blogs for ur reference shows how u can use SEGW to model and create services ->

Regards,

Ashwin

former_member190010
Contributor
0 Kudos

Thank you for your reply Ashwin.

I've been reading some posts, and saw that some people didn't recommend the "Mapping operations to a data source" approach.

But I've been doing som test´using both approaches (based code and map to data source), and both worked fine for me.

So, I wanted to know if there is a best practice that recommends one between both existing approaches.

Best regards,

Emanuel

AshwinDutt
Active Contributor
0 Kudos

Hello Emanuel,

U can do both as they are standard ways of implementing ur GW services.

Regards,

Ashwin

Answers (0)