Develop a Web Service that sends an Email – in ABAP, Netweaver 04S
A little over a year ago, I wrote Develop a Web Service that sends an Email – in ABAP that detailed the process for creating an ABAP Web Service. This weblog was based upon the Netweaver 04 release.
Prompted by a question about the differences between this process in Netweaver 04 and Netweaver 04S, I thought I would return to the subject and compare the process between the two releases.
I will say up front that the differences between the two releases are not as drastic as the changes that occurred between WebAS 620 and Netweaver 04. What you will see here is that SAP has streamlined and simplified the process in preparation for this technology to be a key part of Enterprise Services Architecture.
In this example we will create a very simple Web Service for the sending of an Email
-Configured Email Setup in the ABAP system – See Sending E-Mail from ABAP – Version 610 and Higher – BCS Interface
Create an ABAP Function Module
The steps for creating the function module have not changed from Netweaver 04 to Netweaver 04S, however I will include them for the sake of completeness.
1. Go to SE80.
2. Create a new RFC enabled Function Module
5. Program Coding
6. Test Function Module
Just to be safe, let’s use the function tester to make sure that the RFC works before wrapping it in a Web Service.
Create a Service Definition
1. From SE80 Choose other Object
2. Go to the Enterprise Services Tab
3. Choose Service Definition – This is where we begin to depart from the processing within the earlier release. Gone are the two separate entries for Web Service Definition and Virtual Interface. Instead you have a single entry called Service Definition. This new single object now contains the functionality of the two separate previous objects.
If we look at the possible values for the endpoint type, we see that we can still use a BAPI, a function group or a single function module. The entry for XI has been renamed ESI Repository Service Interface.
6. Finally we reach the step for choosing a security profile. This step is the same as what used to be the separate Web Service Definition creation. We can choose between two basic profiles. Later we can further tweak the settings contained in either of these profiles.
Notice the checkbox at the bottom of the wizard screen. We used to have to go into WSCONFIG and release the Web Service definition after its creation. However by selecting this checkbox, this step can be done automatically for us.
8. This new object display is a combination of the old Virtual Interface and Web Service Definition screens. We have the Properties, Interface, and Types tabs that have not really changed. However we also have the new Variants tab. A Variant is the replacement for the separate Web Service Definition.
The initial variant has been created for us. The former settings of the Web Service Definition have been set via the profile that we choose in the wizard. It is this screen where they can be further maintained.
11. Although the release of our Service Definition can be triggered by the wizard, we can still go to transaction WSCONFIG and create releases manually. Now the keys for creating a release are a combination of the Service Definition and the Variant.