4

When developing SAP Gateway projects using the SEGW t-code, I always try to import entity sets from function modules / BAPIs.

Besides being very fast and useful, I am - mostly - also able to map the data sources to the CRUD-Q operation methods of the data provider class. This mapping works very well with many FM / BAPI provided by SAP.

Sadly, I don't know how to write function groups / function modules on my own that are also very well 'mappable'. Usually, I get GetEntitySet mapped, but none of the others (create, delete, etc.). I don't know what importing / exporting parameters, or what else, is required to write well 'mappable' function modules.

Boghyon Hoffmann
  • 17,103
  • 12
  • 72
  • 170
SDD64
  • 706
  • 13
  • 28

2 Answers2

1

An OData 'Create' operation expects created entity to be returned. So your FM should export a structure of the Entity type itself. 'Read' also returns one entity record, so this is similar to the 'Create' FM. 'Update' and 'Delete' do not have any return parameters. So they can just return a business exception ( /IWBEP/CX_MGW_BUSI_EXCEPTION) whenever there is an error.

This is very well explained here. https://blogs.sap.com/2014/06/04/how-to-design-rfcs-for-odata-service-generation/

However, keep in mind that this (Top-Down approach) usually is not a preferred approach in production scenarios. I have found that creating code based implementation worked great for Gateway services in production scenarios. Check the comments in the above-mentioned blog.

krisho
  • 1,004
  • 7
  • 26
0

There is a option to import function module as well, you might wanna try that also.

Or you can create of your own, check sample implementation provided by gateway for TEA_APPLICATION.

As read, query mapping are default for other mapping like Create, delete mapping => You have to do it manually, just right click on the service entity set and select mapping for create operation.

Bhavesh
  • 882
  • 2
  • 9
  • 18