It still amazes me that not a lot of developers know that you can turn any existing SAP remote enable function module into a Web Service. It may sound like a challenging task, but it is just one of those things that you either know how to do it or you don’t. And to know how to do it only takes 15min to understand.
I have broken this down into 2 blogs
Part 1 will show how to create the simple structured web service
Part 2 will show how to configure and test the web service using SOAMANAGER and WSNAV
For this scenario, I created a really simple function module with one input and one output that will send back a response of “Response successful from test” This will only create one operation for this service. However, if you want to create multiple operations for a Service you can also generate the service from a function group.
You will need to ensure that the attribute is set as Remote-enabled in the function module.
Now go to transaction SE80 and right-click–>Create–>Web Service
Since SAP will be hosting this web service we will want to select “Service Provider”
Select the radio button “Existing ABAP Object(Inside Out)”
Since we are building this web service from a Function Module. The difference between and inside out vs. an outside is approach is where the structure is built. From a design perspective, it is recommended that you use an Outside-in approach whenever possible. This means that you would build out the structure in the ESR and then implement the code behind it in SAP.. However, there will be cases when you will want to turn a Standard SAP remote enable function module into a Web Service, thus using this approach, the Inside out approach..)
Give a name to what you want to call your Enterprise service and specify that the endpoint will be a function module.
Enter the name of the Function module that the web service will call in the backend.
Here you will have to specify which authentication you want this service to have. For this example I have set it to no authentication.
Now you are complete with building this web service. However at this point you have just built the Web Service but you will now need to configure it so that an external application can call this web service.
This will come in my next Blog for configuring the newly created Web Service and as well as testing this service.