Hi Robert,
The question is if you want to pass data between two abap programs or if what you want is to build a web service for exposing data outside sap system?
If you want to pass data between two abap programs, you can do the following:
Passing Data Between Programs - ABAP Programming (BC-ABA) - SAP Library
In case you want to expose data, you can build an odata web service which is the standard that sap is using for fiori:
Step-by-step guide to build an OData Service based on RFCs – Part 1
Regards,
Emanuel