Skip to Content
Author's profile photo Andre Fischer

To code or not to code …

… that is the question.


After having read several posts in this area where people were struggling with using our generators I realized that we have plenty of How-To-Guides out that show how to generate OData services for SAP NetWeaver Gateway based on BW Easy Queries, RFC Function Modules, SPI objects but that there is no How-To-Guide out that simply shows how to actually develop a Gateway service.

While the generators are great for a lot of scenarios there will be scenarios that can be better tackled with plain ABAP code.

Knowing what is going on behind the scenes is also beneficial if it comes to troubleshoot generated code as well.

The first document of this series you can find here:

How to Develop a Gateway Service using Code based Implementation

The second document that explains how to handle $filter, $skip and $top can be found here:

How to develop query options for a Gateway Service using code based implementation

When developing it is always useful to test your services. Learn about the sample test cases delivered by SAP as of SP6

Sample test cases

Best Regards,



  • 20.06.2013 added link to second document
  • 21.06.2013 added link to document describing the sample test cases delivered by SAP as of SP6

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Paul Aschmann
      Paul Aschmann

      Thanks for sharing Andre, this is helpful!

      Author's profile photo Steve Oldner
      Steve Oldner

      Well, well, well!  Well written, well illustrated, and well done!  This is real easy to follow and very easy to expand with other themes.

      Thanks for your effort! 

      Author's profile photo Paul Abrahamson
      Paul Abrahamson

      Great to see this sort of content appearing now, exactly what we've been asking for 🙂

      Author's profile photo Arun Chembra
      Arun Chembra


      Author's profile photo Shakul Jugran
      Shakul Jugran

      Thanks for taking out the time and putting up a very helpful post Andre 🙂

      Author's profile photo Vivek Singh Bhoj
      Vivek Singh Bhoj

      Thanks a lot for sharing this Andre



      Author's profile photo Hemendra Sabharwal
      Hemendra Sabharwal

      Thanks Andre, nice stuff.

      Warm Regards


      Author's profile photo Former Member
      Former Member

      Thanks a lot for sharing. 🙂

      Author's profile photo Rahul Keshav
      Rahul Keshav

      Hi Andre, thanks for the putting all stuffs at one place... 🙂

      Author's profile photo Former Member
      Former Member

      Hi, are there any references for implementing models in code (MPS)? Not only the service implementation (DPC).

      Author's profile photo Andre Fischer
      Andre Fischer
      Blog Post Author

      Hi Daniel,

      models you would rather create using the Service Builder or the OData Modeler in Web IDE.

      Or are you looking for a special use case that cannot be modelled in SEGW?.



      Author's profile photo Former Member
      Former Member

      Hi Andre,

      Asume you have a proprietary "modeler tool" with a number of complex models. The model definitions and data retrieval is accessible by ABAP code.

      The goal is to OData-enable these services. So you have many models in a (proprietary) format that could not be imported by Service Builder itself. And due to the complexity it is not an option to re-implement these models in Service Builder and maintaining them in both tools.

      So I thought you could create an empty Service Builder project, let it create the classes and redefine methods in MPC_EXT and DPC_EXT classes. My problem is how the MPC-API works to create a kind of reader for my proprietary modeler tool.

      How to retrieve data in DPC_EXT classes is documented. But how to add e.g. entities in MPC_EXT is not documented.

      Could you help?