Create an API Factory Runtime Class with the Wizard
Here we describe how you can create a runtime class with the API Factory Wizard which is regarded as "easy mode" 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
-
Start Transaction /NEPTUNE/AF_WIZARD in SAP GUI
-
Leave "Easy" selected and and put as classname ZCL_DR_SALESORDER_RUNTIME
-
Don’t define any Tags in the next step, just click "Continue".
-
Create the NEW_SALESORDER Endpoint as a post Operation
-
Define a name for the Interface which will contain all POST endpoints. You can simply use the already proposed name ZIF_DR_SALESORDER_RUNTIME_POST
-
Complete the wizard and assign a Package in the upcoming Popups. If you assign a package <> $TMP you will also need to specify a transport request.
-
After that you will automatically be guided to SE80 with class ZCL_DR_SALESORDER_RUNTIME.
-
Navigate to the method ZIF_DR_SALESORDER_RUNTIME_POST~NEW_SALESORDER and add some Parameters and ABAP Code
-
Activate the class and the Interface afterwards
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 tab of the API (click inside the row of ZCL_DR_SALESORDER_RUNTIME)
Finally, you can test your API with Swagger UI.