Create an API Factory Runtime Class manually
Here we describe how you can manually create a runtime class which is regarded as "easy mode" inside our API Factory wizard since you don’t need to care about the technical aspects (no individual metadata class needed).
Scenario
You want to create a POST Endpoint named newSalesorder
-
Create an Interface eg.* ZIF_DR_SALESORDER_POST*
-
Implement /NEPTUNE/IF_DR_OPER_POST inside *ZIF_DR_SALESORDER_POST *(by doing this you mark all methods inside ZIF_DR_SALESORDER_POST as HTTP POST Request)
-
Create a method NEW_SALESORDER inside ZIF_DR_SALESORDER_POST and add some Parameters and Exceptions if you want. Those will be represented as HTTP 500 responses
-
Create a new class ZCL_DR_SALESORDER_RUNTIME
-
Implement interface ZIF_DR_SALESORDER_POST and /NEPTUNE/IF_DR_RUNTIME in this class
-
Put some ABAP coding in ZIF_DR_SALESORDER_POST~NEW_SALESORDER
After activating the class and the interface you should see it in the API Factory Cockpit Application in our Cockpit:
You then need to assign policies which fit to your user or enable the API globally with the "Unrestricted API Engine" Switch set to "YES" in the detail section of the API (click inside the row of ZCL_DR_SALESORDER_RUNTIME)
Finally you can test your API with Swagger UI.