Search code examples
odatasapui5abapsap-fiori

How to differentiate whether a call to SAP is from OData API or Fiori app


I have a requirement to find whether the call to the specific application is from Odata API call ( Third-party ) or Fiori app

Third-party applications will use our OData API to call those transactions.

I'm using the FM GUI_GET_DESKTOP_INFO to identify whether it's from GUI or Fiori app.

Now I have conflict in finding whether it's from Third-party app or Fiori app


Solution

  • Basically your Fiori app consumes the same OData service as your oData API , and at Gateway you cannot tell the consumer.

    Of course for your Fiori app , you can put some indicator in the HTTP call(Header) or similar approach to let Gateway knows that those requests are sent from your Fiori App. but cusumer of OData API can do the same to trick your backend logic.

    If you have strong business reason to differentiate the consumer, please consider to have a separate oData API( new OData service and reuse your backend logic as much as possible).