This can be done using an OData service that accepts POST request from your UI5 application and writes data to a database table. While implementing OData service, you have to call ABAP Backend Class method.
You have to remember that all application and classes are instantiated for processing and will end as soon as the request is completed. An OData service can be created using SAP Gateway Service Builder (SEGW).
Following steps has to be performed for creating an OData service:
Once you create a project in Gateway Service Builder, you have to create Entity and EntitySet using Import option:
To know more about the creation of OData service and UI5 application, you can refer this link:https://blogs.sap.com/2015/02/05/simple-exercise-on-odata-and-sap-ui5-application-for-the-basic-crud-operation/