Create a Remote Client Proxy
Requires Customer/Partner License
January 27, 2021
Advanced
30 min.
In the SAP Cloud Platform, ABAP Environment, create a local class that instantiates a proxy, which passes an OData request to a remote service.
You will learn
- How to create an HTTP client in an ABAP class
- How to instantiate a client proxy in this class
- How to handle errors by creating an exception class and message class
Prerequisites
- IMPORTANT: This tutorial cannot be completed on a trial account
To retrieve data from a remote service, you must:
-
Connect to the provisioning system
-
Instantiate a proxy in the client system that passes an OData request to the remote service
This tutorial is based on: SAP Help Portal: Creating a Remote Client Proxy.
Therefore, this tutorial will only cover in detail those aspects that are different - in particular, handling exceptions.
Step 1: Create auxiliary class
Step 2: Copy code
Step 3: Adapt code
Step 4: Create message class
Step 5: Add messages
Step 6: Create exception class
Step 7: Define constants
Step 8: Handle exceptions
Step 9: Check code for proxy class
Step 10: Check code for exception class
Step 11: Test yourself
More Information
For more information on ABAP class-based exceptions, see:
-
ABAP Keyword Documentation > METHODS > General Instance Methods > 4…RAISING…
-
ABAP Keyword Documentation > ABAP Subject Directory > Search > Class-Based Exceptions, Subject
Navigate tutorial steps
-
Step 1: Create auxiliary class
-
Step 2: Copy code
-
Step 3: Adapt code
-
Step 4: Create message class
-
Step 5: Add messages
-
Step 6: Create exception class
-
Step 7: Define constants
-
Step 8: Handle exceptions
-
Step 9: Check code for proxy class
-
Step 10: Check code for exception class
-
Step 11: Test yourself
- Back to Top