Search code examples
requestgetodataabap

Custom GET request in OData Service?


How can I implement a custom method to check if the user is exists by the given parameter in the url? So I want to make a GET request.


Solution

  • Assumption: you are talking about ABAP implementation of OData v2 with SEGW approach.

    You are looking for a so-called Function Import. This allows you to define custom functions next to the predefined CRUDQ (Create, Read, Update, Delete, Query) functions. This custom function can have custom input parameters and return values as simple types or Complex Types (=Structures/Entities)

    As stated also in SAP Help this should be only used if it does not fit into the CRUDQ methods for your entities.

    Find an example implementation in this SAP Blog

    For other approaches, e.g. RESTful ABAP Programming Model (RAP), it would be Actions and Validations but cannot generally be answered without details of the scenario.