Registration

Dear SAP Community Member,
In order to fully benefit from what the SAP Community has to offer, please register at:
http://scn.sap.com
Thank you,
The SAP Community team.
Skip to end of metadata
Go to start of metadata

What is the Inventory Service

The web service "Inventory Service" is a sample web service used by several examples on how to use single sign-on with webservices. These examples are in:

1) Code Exchange sample for .Net https://cw.sdn.sap.com/cw/groups/wcf-saml-sender-vouches-for-net

2) SAP Press book "Single Sign-On mit SAP", http://www.sappress.de/2409

Creating the Inventory Service

to create the samlple web service "inventory service", follow the steps listed below:

1) Open transaction SE37and create a new function ZINVENTORYSRV.
Copy the source code below and add the following parameters:

Import:

ITEMID TYPE STRING

Export:

QUANTITY TYPE STRING
DISCOUNT TYPE STRING
USERID TYPE STRING
FUNCTION zinventorysrv.
\*"---------------------------------------------------------------------\-
\*"*"Local Interface:
\*"  IMPORTING
\*"     VALUE(ITEMID) TYPE  STRING
\*"  EXPORTING
\*"     VALUE(QUANTITY) TYPE  STRING
\*"     VALUE(DISCOUNT) TYPE  STRING
\*"     VALUE(USERID) TYPE  STRING
\*"---------------------------------------------------------------------\-
 "get quantity
IF itemid = '978-1592291809'.
 quantity = '5'.
 ELSE.
quantity = '100'.
 ENDIF.
 "get user name
 userid = sy-uname.
"calculate discount of user based on his client
 IF sy-mandt GE 600.
 discount = '30%'.
 ELSEIF sy-mandt GE 300.
 discount = '20%'.
 ELSE.
 discount = '10%'.
 ENDIF.
ENDFUNCTION.

3) Set the following attributes

 
 
4) Using the web service wizard from SE, create a web service from this function

  • No labels