Test the Connection to the Remote System
Requires Customer/Partner License
2019-11-18
Advanced
20 min.
You will test your connection by calling a BAPI via RFC
You will learn
- How to call a BAPI using RFC in an ABAP class
- How to test this class by outputting the data to the ABAP Console
The class:
- Connects to the backend system, here an ERP System.
- Calls the BAPI remotely via RFC.
- Reads the data from the back end into a local table.
- Outputs that local table to the ABAP Console.
In future, we hope to provide a helper class that generates the appropriate DDL source code for a custom entity and associated type definition - for any BAPI in your backend system. In the meantime, I have provided all the necessary code to use with BAPI_EPM_PRODUCT_GET_LIST
and BAPI_EPM_PRODUCT_GET_DETAIL
.
Step 1: Create an ABAP class
Step 2: Add an INTERFACES statement
Step 3: Define the type for the local table variable
Step 4: Create a TRY...CATCH block
Step 5: Set up the connection
Step 6: Define some variables
Step 7: Call the BAPI
Step 8: Add the exception handling statements
Step 9: Save and activate the class
Step 10: Check your code
Step 11: Test the class in the ABAP Console
Step 12: Test yourself
Step 13: Troubleshooting the SAP Cloud Connector
Navigate tutorial steps
-
Step 1: Create an ABAP class
-
Step 2: Add an INTERFACES statement
-
Step 3: Define the type for the local table variable
-
Step 4: Create a TRY...CATCH block
-
Step 5: Set up the connection
-
Step 6: Define some variables
-
Step 7: Call the BAPI
-
Step 8: Add the exception handling statements
-
Step 9: Save and activate the class
-
Step 10: Check your code
-
Step 11: Test the class in the ABAP Console
-
Step 12: Test yourself
-
Step 13: Troubleshooting the SAP Cloud Connector
- Back to Top