Friday, September 3, 2010

Web Service creation in SAP

How to create Web Services from Function Modules in SAP ??

1. Open SAP GUI and type in the transaction code SE37. This transaction code takes you to the Function Modules(FM) Page.
2. In SE37 type in the name of the FM for which you want to create the Web Service and click on Display.
3. Once the FM is displayed, goto Utilities --> More Utilities --> Create Webservice --> from Function Module.
4. A wizard will open and in the 1st page, type in the name of the Web Service you want to create and give a short description for the same. In page 2, the endpoint is the name of the FM itself.In page 3, provide the Function Group and the Request #.Click on the Complete button.
    The Webservice is thus created.

Next open SoaManager from SAP GUI. Click on the business administration tab--> web service administration. Search first for the Web Service you have created and from there select the WSDL link shown in the box.Copy the WSDL link and save it on notepad.

Next navigate to SE80 in SAP GUI. Here you will be creating the proxy for the Web Service you have just created. Once in SE80, click on the Edit Object button--> Open the Enterprise tab -- > Click on radio button saying "CLIENT PROXY" and here give a name for the client proxy.Click on Create button below. Here you must select the HTTP/URL service and provide the WSDL url you have stored in notepad.
Once the client proxy is created, save it and activate the proxy. Now go back to SoaManager.


Here you must search for the client proxy you  have created. Click on the Apply selection button.
Once the client proxy is shown, navigate to the Configure tab. Click on the "Create Logical Port" button.
In the wizard that opens, you will be asked for the Client Proxy name, WSDL url , username and password. Once all the entries are done, the logical port is created and your Web Service is ready for use.

Test the webservice using wsnavigator or any other web service testing tool.

No comments: