A JCo-based REST to RFC server using BTP destinations. It is a Java based SAP project that allows you to use RFC function modules in web services by invoking a function module in an ABAP system via RFC through BTP RFC destination service.
Check out the 2 blogs that describe the use case and functions in detail:
- Exposes SAP function modules as RESTful API endpoints.
- Handles HTTP GET and POST requests.
- Handles SAP role-based authorization for Display and Modify roles.
- Supports input and output parameters for function modules.
- Supports transactional execution of function modules.
- Handles exceptions and provides informative error messages.
- Clone the repository to your local machine.
- Open the project in your favorite Java IDE.
- Import the required dependencies (See
pom.xml
for the complete list). - Adjust the
btpDestination
variable to point to your SAP system.
- HTTP GET: Used for retrieving data from a function module.
- Example:
/rfc?fm=FUNCTION_MODULE_NAME&query=QUERY_PARAMETERS
- Example:
- HTTP POST: Used for sending data to a function module.
- Example:
/rfc?fm=FUNCTION_MODULE_NAME
- Body: JSON data
- Example:
Exceptions are returned as a JSON response with the exception
and errormessage
fields. For example:
{
"exception": "JCo exception occurred while executing FM in destination DEST.",
"errormessage": "Detailed error message"
}
This project is licensed under the MIT License - see the LICENSE file for details.