1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
-
Upload
sathish-b-sathish -
Category
Documents
-
view
212 -
download
0
Transcript of 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
1/28
Esse
SAP ABAP Tut
How To Use WEB Services In SAP
By Eugene Ostroumov
1
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
2/28
Tutorial Overview
In this tutorial you will learn how to create and call WEB Ser
ABAP. Tutorial consists of two parts:1) how to create WEB Service based on Function Mod
2) how to call WEB Service via ABAP
Each part is a step-by-step instruction that will guide you thr
whole process of creation
2
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
3/28
How to create WEB Service based on FMStep 1
3
Creating a
function modulewith
import and export
parameters
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
4/28
How to create WEB Service based on FMStep 2
4
As an example of
functional modulelogic lets extract
active users
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
5/28
How to create WEB Service based on FMStep 3
5
Mark the function
module as aRemote-Enabled
Module
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
6/28
How to create WEB Service based on FMStep 4
6
Create a
Web Servicebased on the
function module
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
7/28
How to create WEB Service based on FMStep 5
7
Enter a name and
description for theWeb Service
Name
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
8/28
How to create WEB Service based on FMStep 6
8
The name of
functional moduleis entered
automatically
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
9/28
How to create WEB Service based on FMStep 7
9
Choose a
profile forSecurity Settings
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
10/28
How to create WEB Service based on FMStep 8
10
Enter the name of
the package andtransport request
or choose
Local Object
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
11/28
How to create WEB Service based on FMStep 9
11
Creation of Web
Service is finishedIt will be activated
after pressing
Complete button
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
12/28
How to create WEB Service based on FMStep 10
12
After creation of Web Service it is important to get WSDL doc
main key for access to your Web Service. Use the URL or savURL
Save to file
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
13/28
How to create WEB Service based on FMStep 11
13
The correctness
of the WSDLdocument can be
checked in the
transaction
SOAMANAGER:
Path:Business
Administration =>
Web-Service
Administration
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
14/28
How to create WEB Service based on FMStep 12
14
Web Service can
be found in thetransaction SICF
Path:
default_host =>
sap => bc =>
srt => rfc => sap
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
15/28
How to call WEB Service using ABAPStep 1
15
To call Web
Service it isnecessary to
create a proxy
object
Use transaction
SE80 to do this
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
16/28
How to call WEB Service using ABAPStep 2
16
Choose
Service Consumer
type of proxy
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
17/28
How to call WEB Service using ABAPStep 3
17
Select a source of
WSDL. In our case
it is URL/HTTP
Destination
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
18/28
How to call WEB Service using ABAPStep 4
18
Define URL of
WSDL Document
(Step 10 of creation
of Web Service)
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
19/28
How to call WEB Service using ABAPStep 5
19
Enter the name of
the package and
transport request
or choose
Local Object
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
20/28
How to call WEB Service using ABAPStep 6
20
Creation of Proxy
is finished. You
should activate it
after pressing
Complete button
S
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
21/28
How to call WEB Service using ABAPStep 7
21
Enter User name and
Password to read
WSDL Document
This step doesnt
exist is case of local
file for WSDL
Document
H t ll WEB S i i ABAP
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
22/28
How to call WEB Service using ABAPStep 8
22
Activate the Proxy
H t ll WEB S i i ABAP
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
23/28
How to call WEB Service using ABAPStep 9
23
Now we need to
create a local
logical port in
transaction
SOAMANAGER
Path:
BusinessAdministration =>
Web-Service
Administration
Choose Consumer Proxy
Search your Pr
Choose yo
Apply Se
Create Log
H t ll WEB S i i ABAP
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
24/28
How to call WEB Service using ABAPStep 10
24
Enter general
configuration
settings
You can use
WSDL document
or do it manually
H t ll WEB S i i ABAP
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
25/28
How to call WEB Service using ABAPStep 11
25
Save logical port
after it is
generated
Save
H t ll WEB S i i ABAP
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
26/28
How to call WEB Service using ABAPStep 12
26
Now everything is done
and you can call Web
Service from your ABAP
program
Here is an example of a
report that shows all active
users
REPORT zws_call.
DATA: lr_proxy TYPE REF TO zws_co_z_get_active_useDATA: o_err TYPE REF TO cx_root.DATA: outputTYPE zws_zws_users_response.
DATA: inputTYPE zws_zws_users.DATA: ls_item TYPE LINE OF zws_zws_users_response-
TRY.CREATE OBJECT lr_proxyEXPORTINGlogical_port_name = 'GET_USERS'.
CATCH cx_ai_system_fault INTO o_err.MESSAGE o_err TYPE 'I'.
ENDTRY.input-rfc_only = space.TRY.
CALL METHOD lr_proxy->zws_usersEXPORTING
input = inputIMPORTINGoutput = output.
CATCH cx_ai_system_fault INTO o_err.MESSAGE o_err TYPE 'I'.CATCH cx_ai_application_fault INTO o_err.MESSAGE o_err TYPE 'I'.
ENDTRY.
LOOP AT output-users-item INTO ls_item.WRITE: / ls_item-bname, ls_item-tcode, ls_item-tENDLOOP.
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
27/28
Conclusion
27
Mobile applications
Another systems
WEB
Your
Web Services allow to increase functionality of your system
and leverage your investments
Web applications
-
8/11/2019 1. Leverxabaptutorial Creatingandcallingwebservices 130104144244 Phpapp01
28/28
Contact Informatio
Please contact us for more information about our services or solution
LeverX, Inc.
800 West El Camino Real, Suite 180
Mountain View, CA 94040 USA
Tel: (650) 625 8347
Web Site: www.LeverX.com
28