8/10/2019 How to Create Web Services ABAP Based
1/61
How to Create Web Services ABAP basedPosted byJuan ManuelinProcess Integration (PI) & SOA Middlewareon Oct 24, 2012 3:38:19 PM
Tweet
Using SAP XI/PI middleware we can create and expose WebServices, in this blog we are
going to try to explain how an ABAP WebService can be created, exposed and tested only
using ABAP.
First, we have to expose a Function Groupas an Enterprise Service which is going to beready to be called.Well use Function GroupZ_WEBSERVICE_TESTwhich has Function
ModuleZ_CALCULOand we are going to expose it as an Enterprise Service.
We are using the wizard for Web Service creation.Right click on the Function Group, then selectCreate -> Web Service
Write the Service Definition Name, a brief description and set the EndPoint as Function
Group
http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/how-to-create-web-services-abap-basedhttp://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/how-to-create-web-services-abap-basedhttp://scn.sap.com/people/juan.manuel3http://scn.sap.com/people/juan.manuel3http://scn.sap.com/people/juan.manuel3http://scn.sap.com/community/pi-and-soa-middleware/bloghttp://scn.sap.com/community/pi-and-soa-middleware/bloghttp://scn.sap.com/community/pi-and-soa-middleware/bloghttps://twitter.com/sharehttps://twitter.com/sharehttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149715/Imagen1.pnghttps://twitter.com/sharehttp://scn.sap.com/community/pi-and-soa-middleware/bloghttp://scn.sap.com/people/juan.manuel3http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/how-to-create-web-services-abap-based8/10/2019 How to Create Web Services ABAP Based
2/61
We have to specify the Function Group name that is going to implement this ServiceDefinition.
Select the Function Module.
http://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149846/Imagen3.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149716/Imagen2.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149846/Imagen3.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149716/Imagen2.png8/10/2019 How to Create Web Services ABAP Based
3/61
Use the default profile called PRF_DT_IF_SEC_LOW to establish the lowest security
profile in this Service Definition.Make sure to check the field Deploy Service. If you dont check the field, you can
complete this step later manually from transaction code SOAMANAGER using the option
for creating an EndPoint in 'Configurations' tab.
http://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149848/Imagen5.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149847/Imagen4.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149848/Imagen5.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149847/Imagen4.png8/10/2019 How to Create Web Services ABAP Based
4/61
Check LocalObjectfield to save the object locally (not transport)
In the final step choose the Completeoption
http://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149850/Imagen7.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149849/Imagen6.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149850/Imagen7.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149849/Imagen6.png8/10/2019 How to Create Web Services ABAP Based
5/61
Now that we have completed the previous step we can see the next screen where we can
explore the service definition.
We have to enter to the trx. SOAMANAGER and choose the tabApplication and Scenario
Communication -> Single Service Administration.
We have to search the WS Definition that we created.
http://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149852/Imagen9.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149851/Imagen8.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149852/Imagen9.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149851/Imagen8.png8/10/2019 How to Create Web Services ABAP Based
6/61
When we click on Open WSDL Document for selected bindinga new windows popsup with the WSDL document:
The final WSDL file in now available.
http://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149854/Imagen11.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149853/Imagen10.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149854/Imagen11.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149853/Imagen10.png8/10/2019 How to Create Web Services ABAP Based
7/61
With this, we have finished the creation of the WebService and it's ready to be used
for any external application.
Note: If you change some parameters in you function, you need to update it in the service
definition. To do this go to trx. SE80 and select your previously created Service Definitionand do a syntax check, then it will ask you if you want to correct the new parameters in the
definition.
In the next chapter we are going to find how can we consume this WS using an ABAPproxy class.
Creating a Service Consumer ProxyPosted byJuan ManuelinProcess Integration (PI) & SOA Middlewareon Oct 24, 2012 10:37:11 PM
Tweet
In this part, wellsee the process to create Proxy consumer service.
Previously, we have seen how to create an ABAP based web service
First, we have to start the wizard to create a new service using trx. SE80. Right click and
then Create->Enterprise Service.
http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/creating-a-service-consumer-proxyhttp://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/creating-a-service-consumer-proxyhttp://scn.sap.com/people/juan.manuel3http://scn.sap.com/people/juan.manuel3http://scn.sap.com/people/juan.manuel3http://scn.sap.com/community/pi-and-soa-middleware/bloghttp://scn.sap.com/community/pi-and-soa-middleware/bloghttp://scn.sap.com/community/pi-and-soa-middleware/bloghttps://twitter.com/sharehttps://twitter.com/sharehttp://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/how-to-create-web-services-abap-basedhttp://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/how-to-create-web-services-abap-basedhttp://scn.sap.com/servlet/JiveServlet/showImage/38-74103-149856/Imagen12.1.pnghttp://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/how-to-create-web-services-abap-basedhttps://twitter.com/sharehttp://scn.sap.com/community/pi-and-soa-middleware/bloghttp://scn.sap.com/people/juan.manuel3http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/creating-a-service-consumer-proxy8/10/2019 How to Create Web Services ABAP Based
8/61
This time, in Object Type field we choose Service Consumer:
For the Service Consumer source, we can choose amongst Enterprise Service Repository,
URL or the path of WSDL a local file, UDDI, and the Service Registry.
Please select URL/HTTP Destination.
http://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149994/Imagen2.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149993/Imagen1.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149994/Imagen2.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149993/Imagen1.png8/10/2019 How to Create Web Services ABAP Based
9/61
Fill with the URL of the WSDL previously created.
Before continue, we enter to SOAMANAGER transaction code and choose:Application
and Scenario Communication ->Single Service Administration.
http://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149996/Imagen4.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149995/Imagen3.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149996/Imagen4.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149995/Imagen3.png8/10/2019 How to Create Web Services ABAP Based
10/61
Search the Service previously created and choose ApplySelection. Now we can see the
Service Definition details.
You have to click on the Open Web Service navigator for Selected Bindinglink. The
combo button shows the Endpoint defined for the Service. Itllpop up the WSDL where wehave to take the URL to create the proxy.
http://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149999/Imagen7.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149998/Imagen6.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149997/Imagen5.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149999/Imagen7.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149998/Imagen6.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149997/Imagen5.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149999/Imagen7.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149998/Imagen6.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-149997/Imagen5.png8/10/2019 How to Create Web Services ABAP Based
11/61
Use the URL in the wizard:
Fullfil the necesary data in the wizard.
http://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150001/Imagen9.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150000/Imagen8.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150001/Imagen9.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150000/Imagen8.png8/10/2019 How to Create Web Services ABAP Based
12/61
In final step, you can click on Completeto start the creation of the Proxy object.
Enter your login data:
http://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150003/Imagen11.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150002/Imagen10.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150003/Imagen11.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150002/Imagen10.png8/10/2019 How to Create Web Services ABAP Based
13/61
The proxy class is shown. Click on Saveand Activate.
Go back to the SOAMANAGERtrx. to configurate a logical port for our service provider.Logical ports are made to configurate the time features of a WS execution. We can create a
logical port from LPCONFIG(obsolete) or SOAMANAGERas we are showing next.A consumer proxy never stores details about a server URL (which is system specific).
These details have to be configured through logical ports and EndPoints.
For example: when we transport a proxy class from a Development system to QA system.
The proxy class doesnt contain any information about which server the WS has to becalled, this is handled by a logical port-.Go back to the SOAMANAGER trx. This time, when you search in Web Service
Administration choose ConsumerProxy.Dont forget to click on ApplySelectiona
after highlighting the proxy.
http://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150006/Imagen13.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150005/Imagen12.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150006/Imagen13.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150005/Imagen12.png8/10/2019 How to Create Web Services ABAP Based
14/61
In the Configuration tab, select Create Logical Port.
In the pop-up shown, you have to fill several parameters. First, give a name for the logical
port and set it as the default logical port.
Next we have to select Config.Typebased on WSDL.
The application reads all the security parameters needed to call this service directly from
WSDL definition.
Finally, we have to fill the WSDL URL for the called Web Services. Also, you have to givethe system user name and password to access the WSDL
http://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150008/Imagen15.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150007/Imagen14.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150008/Imagen15.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150007/Imagen14.png8/10/2019 How to Create Web Services ABAP Based
15/61
If the creation was success, the system will take us back to the Config. Screen, where we
can continue with the logical port configuration. Once more, introduce the user name andpassword (they are going to be used as a credentials to call this service and to save the
logical port).
http://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150010/Imagen17.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150009/Imagen16.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150010/Imagen17.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150009/Imagen16.png8/10/2019 How to Create Web Services ABAP Based
16/61
The next and final section is: Testing a Service Consumer Proxy:
Testing a Service Consumer ProxyPosted byJuan ManuelinProcess Integration (PI) & SOA Middlewareon Oct 25, 2012 5:04:32 PM
Tweet
In the previous chapter we have created a Service consumer proxy:
http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/creating-a-service-consumer-proxy
In this section we will see how to test a proxy. To do this we can press the icon highlightedin the picture below (or pressing F8):
In the Test Service Consumerwindow, we choose the Logical Port that we previously
created from SOAMANAGER transaction code:
http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/25/testing-a-service-consumer-proxyhttp://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/25/testing-a-service-consumer-proxyhttp://scn.sap.com/people/juan.manuel3http://scn.sap.com/people/juan.manuel3http://scn.sap.com/people/juan.manuel3http://scn.sap.com/community/pi-and-soa-middleware/bloghttp://scn.sap.com/community/pi-and-soa-middleware/bloghttp://scn.sap.com/community/pi-and-soa-middleware/bloghttps://twitter.com/sharehttps://twitter.com/sharehttp://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/creating-a-service-consumer-proxyhttp://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/creating-a-service-consumer-proxyhttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150384/Imagen1.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150011/Imagen18.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150384/Imagen1.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74133-150011/Imagen18.pnghttp://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/24/creating-a-service-consumer-proxyhttps://twitter.com/sharehttp://scn.sap.com/community/pi-and-soa-middleware/bloghttp://scn.sap.com/people/juan.manuel3http://scn.sap.com/community/pi-and-soa-middleware/blog/2012/10/25/testing-a-service-consumer-proxy8/10/2019 How to Create Web Services ABAP Based
17/61
Change to the XML editor, and modify the default values. You can also skip this andexecute the request.
The response must display the calculation in XML mode.
Now if we want to consume the WS using ABAP, we have to enter to trx. SE80 and create
a new report:
http://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150402/Imagen4.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150401/Imagen3.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150385/Imagen2.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150402/Imagen4.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150401/Imagen3.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150385/Imagen2.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150402/Imagen4.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150401/Imagen3.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150385/Imagen2.png8/10/2019 How to Create Web Services ABAP Based
18/61
Drag and drop the proxy classZTESTCO_ZWS_CALCULOand youll get a template to
consume it as shown below:
http://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150403/Imagen5.png8/10/2019 How to Create Web Services ABAP Based
19/61
Modify the template to call the WS.
http://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150404/Imagen6.png8/10/2019 How to Create Web Services ABAP Based
20/61
Note: setting the logical port in EXPORTINGparameters itsnot mandatory because when
we created it from SOAMANAGER trx. we checked the Logical Port is defaultoption.Now we can execute it:
This is just a dummy report, but itsenough to understand the basis about how to consume
a WS.
http://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150406/Imagen8.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150405/Imagen7.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150406/Imagen8.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150405/Imagen7.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150406/Imagen8.pnghttp://scn.sap.com/servlet/JiveServlet/showImage/38-74197-150405/Imagen7.png8/10/2019 How to Create Web Services ABAP Based
21/61
Creation and consuming of a WebService in SAPABAP without the obsolete transaction LPCONFIG
24 December 2012 | Avinash Palavai| 1 Comment| SAP ABAP
Introduction:
This article demonstrates the entire process of creation and consuming of a WebService
inSAPABAP.
There are few changes made bySAPin the screens of transactions like SOAMANAGER, that we
see in the process of configuring the WebService definition and the transaction LPCONFIG, which
is used to create the logical port in the process of consuming the WebService is obsolete.
Now we come across this information message, when we run the transaction LPCONFIG,
So, this article helps out in following the new SAP screens and an alternative process of creating
the logical port, rather than using the transaction LPCONFIG.
The entire article is divided into two parts,
1. Creation of WebService and
2. Consuming a WebService in ABAP.
http://sapuniversity.eu/profile/avi480gmail-com/http://sapuniversity.eu/profile/avi480gmail-com/http://sapuniversity.eu/creation-and-consuming-of-a-webservice-in-sap-abap-without-the-obsolete-transaction-lpconfig/#commentshttp://sapuniversity.eu/creation-and-consuming-of-a-webservice-in-sap-abap-without-the-obsolete-transaction-lpconfig/#commentshttp://sapuniversity.eu/category/sap-abap/http://sapuniversity.eu/category/sap-abap/http://sapuniversity.eu/peeping-into-the-sap-r3-system/http://sapuniversity.eu/peeping-into-the-sap-r3-system/http://sapuniversity.eu/abap-dictionary/http://sapuniversity.eu/abap-dictionary/http://sapuniversity.eu/abap-dictionary/http://sapuniversity.eu/wp-content/uploads/2012/12/image0013.pnghttp://www.printfriendly.com/print?url=http://sapuniversity.eu/creation-and-consuming-of-a-webservice-in-sap-abap-without-the-obsolete-transaction-lpconfig/http://sapuniversity.eu/wp-content/uploads/2012/12/image0013.pnghttp://www.printfriendly.com/print?url=http://sapuniversity.eu/creation-and-consuming-of-a-webservice-in-sap-abap-without-the-obsolete-transaction-lpconfig/http://sapuniversity.eu/wp-content/uploads/2012/12/image0013.pnghttp://www.printfriendly.com/print?url=http://sapuniversity.eu/creation-and-consuming-of-a-webservice-in-sap-abap-without-the-obsolete-transaction-lpconfig/http://sapuniversity.eu/wp-content/uploads/2012/12/image0013.pnghttp://www.printfriendly.com/print?url=http://sapuniversity.eu/creation-and-consuming-of-a-webservice-in-sap-abap-without-the-obsolete-transaction-lpconfig/http://sapuniversity.eu/wp-content/uploads/2012/12/image0013.pnghttp://www.printfriendly.com/print?url=http://sapuniversity.eu/creation-and-consuming-of-a-webservice-in-sap-abap-without-the-obsolete-transaction-lpconfig/http://sapuniversity.eu/wp-content/uploads/2012/12/image0013.pnghttp://www.printfriendly.com/print?url=http://sapuniversity.eu/creation-and-consuming-of-a-webservice-in-sap-abap-without-the-obsolete-transaction-lpconfig/http://sapuniversity.eu/abap-dictionary/http://sapuniversity.eu/peeping-into-the-sap-r3-system/http://sapuniversity.eu/category/sap-abap/http://sapuniversity.eu/creation-and-consuming-of-a-webservice-in-sap-abap-without-the-obsolete-transaction-lpconfig/#commentshttp://sapuniversity.eu/profile/avi480gmail-com/8/10/2019 How to Create Web Services ABAP Based
22/61
PART1 :- Creation of WebService in SAP
1. Create an RFC. (Here I took an example of simple addition logic in the RFC).
2. Create a WebService from the above RFC.
http://sapuniversity.eu/wp-content/uploads/2012/12/image0053.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0033.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0053.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0033.png8/10/2019 How to Create Web Services ABAP Based
23/61
3. It opens the following WebService creation wizard; enter the Service Definition name
description.
http://sapuniversity.eu/wp-content/uploads/2012/12/image0073.png8/10/2019 How to Create Web Services ABAP Based
24/61
4. Check the check box Map Name.
http://sapuniversity.eu/wp-content/uploads/2012/12/image0091.png8/10/2019 How to Create Web Services ABAP Based
25/61
8/10/2019 How to Create Web Services ABAP Based
26/61
6. Save
http://sapuniversity.eu/wp-content/uploads/2012/12/image0132.png8/10/2019 How to Create Web Services ABAP Based
27/61
7. Click on complete. Now your WebService will be created.
http://sapuniversity.eu/wp-content/uploads/2012/12/image0152.png8/10/2019 How to Create Web Services ABAP Based
28/61
8. Below is the service definition created and remember to activate it immediately.
9. Now this WebService has to be configured in SOA Management, to publish it.Run the
transaction SOAMANAGER, which would launch a Web Dynpro ABAP based SOA
Management application in your Internet Browser.
10.Below is the SOA Management window. This screen has been modified by SAP. Now click on
the WebService configuration link highlighted in orange color under the Service
http://sapuniversity.eu/wp-content/uploads/2012/12/image0192.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0172.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0192.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0172.png8/10/2019 How to Create Web Services ABAP Based
29/61
Administration tab.
11.Select your webservice and click on apply selection button.
http://sapuniversity.eu/wp-content/uploads/2012/12/image0231.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0212.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0231.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0212.png8/10/2019 How to Create Web Services ABAP Based
30/61
12.Now the screen will be expanded with the part where the service has to be configured. Click
on create under configurations tab.
13.A pop up will be opened. Enter the following details and click on apply settings,
14.Now the screen will be extended with the part, where the authentication method has to be
selected. Select User ID/Password under transport channel authentication and click on save.
15.The service definition has been configured.
http://sapuniversity.eu/wp-content/uploads/2012/12/image0291.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0271.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0251.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0291.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0271.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0251.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0291.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0271.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0251.png8/10/2019 How to Create Web Services ABAP Based
31/61
16.Under the overview tab, click on Show/ hide selected bindings or services WSDLURL,
which would generate the WSDL link. Copy it locally.
PART2 :- Consuming a WebService in ABAP
1. First create a consumer proxy as shown,
http://sapuniversity.eu/wp-content/uploads/2012/12/image033.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0311.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image033.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image0311.png8/10/2019 How to Create Web Services ABAP Based
32/61
2. A consumer proxy creation wizard will be opened, select the Service Consumer.
http://sapuniversity.eu/wp-content/uploads/2012/12/image035.png8/10/2019 How to Create Web Services ABAP Based
33/61
3. Select the source as External WSDL.
http://sapuniversity.eu/wp-content/uploads/2012/12/image037.png8/10/2019 How to Create Web Services ABAP Based
34/61
4. Paste the WSDL URL copied locally in step 16 of part
http://sapuniversity.eu/wp-content/uploads/2012/12/image039.png8/10/2019 How to Create Web Services ABAP Based
35/61
5. Save a give some prefix, to your proxy name.
http://sapuniversity.eu/wp-content/uploads/2012/12/image041.png8/10/2019 How to Create Web Services ABAP Based
36/61
6. Click on complete.
http://sapuniversity.eu/wp-content/uploads/2012/12/image043.png8/10/2019 How to Create Web Services ABAP Based
37/61
7. Service Consumer will be created and remember to activate it immediately.
8. Now the logical port has to be created. As the transaction LPCONFIG is obsolete, this can be
done through the SOAMANAGER. Again run the SOAMANAGER and select the consumer
http://sapuniversity.eu/wp-content/uploads/2012/12/image045.png8/10/2019 How to Create Web Services ABAP Based
38/61
proxy.
9. The screen will be extended, with a part to create the logical port. Click on create under
configuration tab.
10.It will open a pop up to enter the logical port name and settings as follows. Under the WSDL
location, enter the WSDL URL of the WebService to be consumed and the authentication
http://sapuniversity.eu/wp-content/uploads/2012/12/image049.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image047.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image049.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image047.png8/10/2019 How to Create Web Services ABAP Based
39/61
credentials.
11.The logical port is created.
http://sapuniversity.eu/wp-content/uploads/2012/12/image053.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image051.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image053.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image051.png8/10/2019 How to Create Web Services ABAP Based
40/61
12.Now test the service consumer from the SAP GUI by clicking on execute.
13.Enter the logical port created and execute.
http://sapuniversity.eu/wp-content/uploads/2012/12/image057.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image055.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image057.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image055.png8/10/2019 How to Create Web Services ABAP Based
41/61
8/10/2019 How to Create Web Services ABAP Based
42/61
16.Now create a program to consume the WebService in ABAP and execute.
17.Result
http://sapuniversity.eu/wp-content/uploads/2012/12/image065.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image063.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image065.pnghttp://sapuniversity.eu/wp-content/uploads/2012/12/image063.png8/10/2019 How to Create Web Services ABAP Based
43/61
Below are the steps required to create a service definition within ABAP and SE80 to
provide a webservice to the outside world. The example creates a webservice
based on the BAPI Function module BAPI_USER_GETLIST and shows how to get
the created WSDl so that you can consume this web service from another system.
Step 1 - Access ABAP Service Definition creation wizard via SE80
Execute transaction SE80 and within the the 'edit object' popup screen select
'Service Definition' from the 'Enterprise Services' tab and press create. I think you
have to actually enter a name within the service definition field but please note the
wizard does not seem to use this and asks you for the service definition name
again (i.e. Z_SAPWEBSERVICE).
Step 2 - Create ABAP Service Definition
You should now be presented with the first screen of the Service Definitiongeneration wizard where you need to enter select 'Service Provider' and press
continue.
8/10/2019 How to Create Web Services ABAP Based
44/61
Select 'Existing ABAP Objects (Inside Out) and Press Continue.
8/10/2019 How to Create Web Services ABAP Based
45/61
Enter the Service Definition Name (Z_SAPWEBSERVICE), description and select
'Function Module' as the end point. Press Continue.
8/10/2019 How to Create Web Services ABAP Based
46/61
Enter the name of the BAPI Function module you are going to create a web service
from (BAPI_USER_GETLIST), check the checkbox and Press Continue.
8/10/2019 How to Create Web Services ABAP Based
47/61
The next screen should be filled in with the correct details, all you need to do is
tick the 'Deploy Service' checkbox and press continue.
8/10/2019 How to Create Web Services ABAP Based
48/61
Select your package and transport or tick the Local object checkbox and press
continue.
8/10/2019 How to Create Web Services ABAP Based
49/61
Right thats it, simply press the complete button and your service definition will be
created.
8/10/2019 How to Create Web Services ABAP Based
50/61
Save and activate it!
Step 3 - Execute tranastion SOAMANAGER
Execute transaction SOAMANAGER. In the resultant webpage click on the 'Web
Service Administration' link within the 'Business Administrastion' tab.
8/10/2019 How to Create Web Services ABAP Based
51/61
In later version of SAP the option has been re-named 'Web Service Configuration'.
Step 4 - Search for your webservice
Enter your webservice name (Z_SAPWEBSERVICE) into the search pattern field
and press Go.
In later version of SAP the search has chnaged slightly
8/10/2019 How to Create Web Services ABAP Based
52/61
Step 5 - View your webservice
Select the resultant entry and press the 'Apply Selection' button. You just click on
the resultant entry in later versions of SAP.
Step 6 - Get the WSDL URL for your web service
Within the Overview tab simply click on the 'Open WSDL document for selected
binding' link.
Use the WSDL icons in later versions of SAP
8/10/2019 How to Create Web Services ABAP Based
53/61
A new window will open containing the WSDL information for your web service,
simply copy the browser URL. This URL can now be used to consume this web
service from another system, for example via SAP'sVisual composer.
http://www.sapdev.co.uk/sap-webapps/sap-webservices/vc_webservice.htmhttp://www.sapdev.co.uk/sap-webapps/sap-webservices/vc_webservice.htmhttp://www.sapdev.co.uk/sap-webapps/sap-webservices/vc_webservice.htmhttp://www.sapdev.co.uk/sap-webapps/sap-webservices/vc_webservice.htm8/10/2019 How to Create Web Services ABAP Based
54/61
ABAP and SE80 to consume a Web Service - Example todemonstrate simple creation process
Below are the steps required for consuming a webservice WSDL with ABAP andSE80. It is using a webservice called Currency converter available onthexmethods.comwebsite, but the concept can be applied to any webservice youfind, as long as you have the url of its WSDL.
Step 1 - Access ABAP proxy creation wizard via SE80Execute transaction SE80 and within the the 'edit object' popup screen selectClient proxy from the 'Enterprise Services' tab and press create.
Step 2 - Create ABAP proxy
You should now be presented with the first screen of the ABAP proxy generationwizard where you need to enter URL/HTTP Destination and press continue.
http://www.xmethods.com/http://www.xmethods.com/http://www.xmethods.com/http://www.xmethods.com/8/10/2019 How to Create Web Services ABAP Based
55/61
Next you need to select URL, enter the url of your webservice WSDL and presscontinue. For this example the WSDL will behttp://webservice.webserviceshare.com/currencyconverter/rates.asmx?WSDL
Now enter the package details or just click the local object checkbox and enter aprefix of 'ZES_'. When the auto generation occurs SAP only has a finite number of
of characters for the name of the proxy, this prefix helps ensure it does notencounter any duplication problems when it trims dowm names to fit in the field
available. Now press Continue and on the next screen press Complete.
8/10/2019 How to Create Web Services ABAP Based
56/61
Your ABAP proxy should now generate and you should be presented with thefollowing screen. Save and activate it!
Step 3 - Create a logical port
Execute transaction LPCONFIG and within Proxy class enter the proxy you just
created ZES_CO_CURRENCY_CONVERTER_SOAP in SE80. Then with the Logical
Port enter an appropriate name such as CURR_CONV_XMETHODS. Tick the DefaultPort checkbox and press create.
8/10/2019 How to Create Web Services ABAP Based
57/61
Step 4 - Setup Call parametersWithin the 'Call Parameters' tab select URL and enter the url of the WSDL again(http://webservice.webserviceshare.com/currencyconverter/rates.asmx?WSDL).
8/10/2019 How to Create Web Services ABAP Based
58/61
Step 5 - Setup OperationsRight this is where it gets a little messy as now we need to add the reference fromthe actual WSDL code into each operation. Basiaclly within the WSDL there is asection which details each operation and specifies a soapAction url. We simplyneed to find this soapAction url and enter it into the operations tab for the
appropriate operation. I am just going to set up the
'GET_SUPPORTED_CURRENCIES' operation but feel setup the others at any point.
To do this select the GET_SUPPORTED_CURRENCIES operation and enter the SOAPAction as "http://websevriceshare.com/GetSupportedCurrencies". This was found
in the following section of the WSDL:
8/10/2019 How to Create Web Services ABAP Based
59/61
style="document"/>
Step 6 - Test your webservice ABAP proxyMake sure you save and activate the logical port and return to your ABAP proxywith SE80. Hit the test button and enter CURR_CONV_XMETHODS as your logical
port name and GET_SUPPORTED_CURRENCIES as the method name (action). Nowpress execute!
8/10/2019 How to Create Web Services ABAP Based
60/61
Step 7 - Enter input detailsAs this method/action of the webservice does not require an input values simply
press the execute button again.
Step 8 - Enter input detailsThe webservice results should now be displayed, a list of all the currency codes
supported by the webservice.
8/10/2019 How to Create Web Services ABAP Based
61/61
Top Related