Essential SAP Tutorial SAP ABAP Basics:HTTP Request Handler Creation By John DeGrandchamp 1 Copyrighted 2013 by LeverX, Inc.
Tutorial Goal Often times you need to integrate SAP with other third party systems Without SAP XI/PI this can often be quite a hassle This tutorial will show you how to create a web server using a standard SAP interface This web server can be used to receive HTTP requests that contain any structure of data The data received can be processed in any way you desire 2 Copyrighted 2013 by LeverX, Inc.
Use Transaction SE24 Enter the desired name for your class Press Create Choose ‘Class’ on the following popup screen 3 Copyrighted 2013 by LeverX, Inc.
Create Class Popup Enter a description for your object Choose the ‘Usual ABAP Class’ radio button Select the ‘Final’ checkbox Press the ‘Save’ button Choose appropriate package or choose local object 4 Copyrighted 2013 by LeverX, Inc.
Interface Tab Enter interface IF_HTTP_EXTENSION Press Enter or click green checkmark 5 Copyrighted 2013 by LeverX, Inc.
Method Go to the methods tab and double click the HANDLE_REQUEST method This is where you will implement your custom code 6 Copyrighted 2013 by LeverX, Inc.
Custom Code The get_header_fields method is used to get the header of the HTTP request The get_cdata method is used to get the body of the http request into the string variable lv_request_string Activate the code 7 Copyrighted 2013 by LeverX, Inc.
Create Service In Transaction SICF Go to transaction SICF and press execute From default_host, navigate to sap dropdown Right click and choose create new sub-element Enter name of new service element, make sure ‘Independent Service’ radio button is selected 8 Copyrighted 2013 by LeverX, Inc.
Create/Change Service Enter a description Choose required logon procedure and security in logon data tab In the handler list tab enter the name of the class you created Return to SICF screen, right-click and activate service 9 Copyrighted 2013 by LeverX, Inc.
Test Service Place an external break- point in the method you implemented your code Right-click your service and select test service If the debugger triggers you have created your break- point successfully 10 Copyrighted 2013 by LeverX, Inc.
Conclusion This service created is only accessible from inside your companies network. It can be made accessible from outside your network through the use of tools such as the SAP Web Dispatcher Additional code can be placed inside the method you created to process and do many different things with the HTTP request you received There also many additional methods available from the IF_HTTP_EXTENSION interface 11 Copyrighted 2013 by LeverX, Inc.
Contact InformationPlease contact us for more information about our services or solutions available. LeverX, Inc. 800 West El Camino Real, Suite 180 Mountain View, CA 94040 USA Tel: (650) 625 – 8347 Web Site: www.LeverX.com 12 Copyrighted 2013 by LeverX, Inc.