Creating and Configuring and Testing A Web Service Based On A Function Modulein SAP
Creating and Configuring and Testing A Web Service Based On A Function Modulein SAP
Applies to:
SAP EC6 6.0/7.0. For more information, visit the Web Services homepage.
Summary
The article describes how to create a web service from function module.
Author:
Ajantha Ratnakumar
Author Bio
Ajantha Ratnakumar is a Software Consultant in Larsen & Toubro Infotech Limited. She
has three years of SAP experience. She has worked extensively in ABAP, in APO
modules such TPVS and SNP and in SD module.
Table of Contents
Concepts ............................................................................................................................................................. 3
Web Service .................................................................................................................................................... 3
Creating Function Group .................................................................................................................................... 3
Transaction SE80............................................................................................................................................ 3
Creating Function module................................................................................................................................... 5
Transaction SE37............................................................................................................................................ 5
Code ................................................................................................................................................................ 8
Create Web Service of Function Module ............................................................................................................ 9
Executing Web Service from Web Service Navigator ...................................................................................... 14
Transaction SOAMANAGER ........................................................................................................................ 14
Summary........................................................................................................................................................... 24
Related Content ................................................................................................................................................ 24
Disclaimer and Liability Notice .......................................................................................................................... 25
Concepts
Web Service
A Web service is a software system designed to support interoperable machine-to-machine interaction over
a network. Web services are frequently just Web APIs that can be accessed over a network, such as the
Internet, and executed on a remote system hosting the requested services.
Or
Web service can be defined as any service/functionality available over the internet and related transport
protocols which uses a standardized XML messaging system (i.e. SOAP) is not tied to any operating system
or programming language.
You will get pop up asking for entering short text for Function group, provide a meaningful short text and then
SAVE.
While saving it will ask the package under you want to save, you can provide $TMP (for Local Object) or the
any package name as per your requirement. Then click on SAVE.
You will get a message saying Function Group has been created as per below screen shot
Enter the Function group name and Short text for function module in the pop up window as per below
screen and click on SAVE, then you will get a pop up saying Function module name is reserved for
SAP, click on Continue.
Then it will take you to Function Builder screen as in below screen shot and enter meaningful values And
a very important thing is to make the function module Remote-Enabled Module.
One of the important things to be done is commenting and maintaining header information for the
function module which gives information about the function module
Code
For the example mentioned in document (.i.e. creating a sales order ) you can use this code or else the code
will change as per your requirement
Enter Name and Short text for Service definition and the click on Continue
Check the Check box for Mapping so that the import and export parameters of Function Module are mapped
with that of the Web Service to be created.
Check the Deploment check box for the service to be avaliable in SOAMANAGER for further processing
Here you can select where you want to save the object , In this case I am saving it as local object- $TMP
Then you will a message that web service has been created.
Then click on Single Service Administration you will get the below screen where you can enter the
service definition name in the Search Pattern. In our case the name will be ZV_ARK_CREATE_SO_NEW
You will get the service in the search Results column. Select the service and then click on Apply Selection
You can see as per the below screen shots, the service = 0/ Endpoints = 0 for the web service definition
selected by us
You will get a pop up asking for service name, description and binding name for it. Enter the values and
click on Apply Settings
Then you return to the below mentioned screen where you need to save
Then you can see a entry in Configurations tab. The state of service should be Active.
Now click on Overview tab you can see the service =1/ Endpoint=1
If you click on the Open WSDL document for selected binding you can see the WSDL of the Web
service in XML format
In order to execute the web service through web service navigator click on Open Web Service navigator
for selected binding it will take you to above screen
Then click on Display selected Binding's WSDL URL link to get the WSDL URL. You will get a URL
displayed on the right and side of the screen
Copy paste the link in the Web service Navigator screen in the input box below Enter the WSDL URL
of the Web service: and click on Next.
It will take u to login screen you need to use the same login as used for SAP logon
After entering the mandatory values for creating sales order, click on Send .
Summary
Web Service can be used in Adobe Flex or any other web-based application to access / communicate with
SAP data. ABAP web services can be created when you have custom requirements. There are also standard
web services provided by SAP which comes as a part of Enhancement Packages. These standard web
service represent standard SAP functionalities like APO ATP check, SO create/change/delete, PO
create/change/delete and many more. When more than one web service combined to meet new
requirements encapsulating enterprise functionality and exposing it as a reusable business service then that
is called as an Enterprise Service.
Related Content
https://wiki.sdn.sap.com/wiki/display/ESpackages/Home
http://www.sdn.sap.com/irj/sdn/explore-es?rid=/webcontent/uuid/f272e75d-0501-0010-1786-ab6ed3496bb1
http://www.sdn.sap.com/irj/sdn/soa
http://www.sdn.sap.com/irj/sdn/enterprisesoa;jsessionid=(J2EE3417400)ID1961175350DB10082480365165
855639End?rid=/webcontent/uuid/f07d8153-7edd-2910-aeac-fb940ff1ff71
http://www.sdn.sap.com/irj/sdn/enterprisesoa;jsessionid=(J2EE3417400)ID1961175350DB10082480365165
855639End?rid=/webcontent/uuid/e044d87c-ebab-2a10-6482-cd4ff5fa4828