
In this article, I will explain "Hybrid Testing" in the context of the SAP Cloud Application Programming Model (CAP), which allows development while accessing real data from SAP S/4HANA On-Premise. I will focus on connectivity tests that are useful before executing Hybrid Testing. For detailed information on setting up the environment, please refer to the links below.
In app development using CAP, testing is typically conducted in a local environment using mock data. However, there are cases where you need to access cloud or on-premise services. "Hybrid Testing" is a useful method in such cases. By using this testing method, developers can run applications in a local environment while connecting to remote services, thereby improving development efficiency.
While there are advantages, accessing on-premise systems relies on services such as SAP Destination Service, SAP Connectivity Service, and Cloud Connector. This makes the environment setup more complex compared to local testing with mock data. Therefore, I introduce connectivity tests that can help streamline the environment setup process.
The connectivity tests introduced are in the order shown in the diagram below. I recommend testing them sequentially, starting with those with fewer dependencies.
The SAP Gateway Client, with T-code /IWFND/GW_CLIENT, functions as an HTTP(S) client to test OData services. After entering the appropriate HTTP method, OData query (format, top...), request URI, request headers like Content-Type, and payload, click "Execute" on the app to check the availability and response of the target OData service within S/4HANA.
If an error occurs, verify that the OData service is activated and that the correct path is specified, among other potential issues.
After a successful test from the Gateway Client, test the connectivity from SCC to the on-premise system. Specifically, click the leftmost icon in Actions to verify the connection from the Virtual host defined in SCC to the Internal host (on-premise). If 'Reachable' is displayed, the test is successful.
In the BTP Cockpit, perform a "Check Connection" to SCC to verify if the URL of the Destination can be reached. Note that this test does not guarantee that the Virtual host of the Destination Service (SCC) is operational, but only confirms reachability.
If an error occurs, there may be issues with the SCC settings, version, or server availability.
Finally, perform Hybrid Testing itself. Bind the destination and auth services to the app deployed in the Cloud Foundry Runtime, and execute the following command to make an HTTP request from the HTTP file.
# JavaScript
cds watch --profile hybrid
# TypeScript
cds-ts watch --profile hybrid
Notes:
destinations=[{"name":"demodestination","proxyHost":"http://127.0.0.1","proxyPort":"8887","url":"http://demodestination.dest"}]
I hope this helps you in your app development using CAP.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
33 | |
15 | |
11 | |
8 | |
8 | |
7 | |
7 | |
7 | |
6 | |
5 |