Professional Documents
Culture Documents
ABAP system
The following steps demonstrates how to expose a function module as a web service provider in SAP
CRM system.
1. create a new function module to return product description by given input product ID.
FUNCTION ZGET_PROD_DESCRIPTION.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" IMPORTING
*" VALUE(IV_PROD_ID) TYPE COMM_PRODUCT-PRODUCT_ID
*" EXPORTING
*" VALUE(RV_TEXT) TYPE STRING
*"----------------------------------------------------------------------
SELECT SINGLE A~short_text INTO rv_text FROM COMM_PRSHTEXT AS A
INNER JOIN comm_product AS B ON B~product_id = iv_prod_id AND B~product_guid =
A~product_guid.
ENDFUNCTION.
3. Once creation is finished, you would find your service definition as below:
click tab WSDL, write down your WSDL link:
Now your web service is ready for consumption. click this icon:
activate your consumer proxy and write down the ABAP class name.
3. go back to SOAMANAGER, find the consumer proxy created in step2:
you can find the data type for input and output parameters in SE80:
Execute the report which triggers the web service call. After it finishes, click tab “Functional Trace”
and click refresh button, you should see several records for execution trace.
Double click and select the row with type “Response”, where you could find the product description
value returned by service provider.