Connectivity Tests Before Executing Hybrid Testing with CAP: Connecting to SAP S/4HANA On-Premise

Estimated read time 7 min read

Introduction

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.

SAP Gateway – Activate and Maintain ServicesDiscovery Center – Connect S/4HANA system using Cloud ConnectorSAP CAP  – Consuming Services #Connect to Remote Services LocallySAP CAP – Hybrid TestingSAP Cloud SKD – Connecting to External Systems From the Business Application Studio #Connection to a…

What is Hybrid Testing?

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.

Challenges of Hybrid Testing with SAP S/4HANA On-Premise

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.

Connectivity Tests

The connectivity tests introduced are in the order shown in the diagram below. I recommend testing them sequentially, starting with those with fewer dependencies.

1. Connectivity Test from SAP Gateway Client

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.

2. Connectivity Test from Cloud Connector Administration UI

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.

3. Connectivity Test from BTP Cockpit

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.

‘The check does not guarantee that the target system or service is operational. It only verifies if …

If an error occurs, there may be issues with the SCC settings, version, or server availability.

4. Connectivity Test from SAP Business Application Studio (BAS)

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:

When accessing SCC from a local machine using Hybrid Testing, it is necessary to make calls from within the BTP environment. Therefore, please use BAS instead of IDEs like VS Code. Reference linkIn the .env file, you need to add the destinations variable by obtaining the name and URL information of the destination from the Destinations page in the BTP Cockpit.destinations=[{“name”:”demodestination”,”proxyHost”:”http://127.0.0.1″,”proxyPort”:”8887″,”url”:”http://demodestination.dest”}]

Conclusion

I hope this helps you in your app development using CAP.

 

​ IntroductionIn 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.SAP Gateway – Activate and Maintain ServicesDiscovery Center – Connect S/4HANA system using Cloud ConnectorSAP CAP  – Consuming Services #Connect to Remote Services LocallySAP CAP – Hybrid TestingSAP Cloud SKD – Connecting to External Systems From the Business Application Studio #Connection to a…What is Hybrid Testing?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.Challenges of Hybrid Testing with SAP S/4HANA On-PremiseWhile 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.Connectivity TestsThe connectivity tests introduced are in the order shown in the diagram below. I recommend testing them sequentially, starting with those with fewer dependencies.1. Connectivity Test from SAP Gateway ClientThe 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.2. Connectivity Test from Cloud Connector Administration UIAfter 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.3. Connectivity Test from BTP CockpitIn 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.’The check does not guarantee that the target system or service is operational. It only verifies if …If an error occurs, there may be issues with the SCC settings, version, or server availability.4. Connectivity Test from SAP Business Application Studio (BAS)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 hybridNotes:When accessing SCC from a local machine using Hybrid Testing, it is necessary to make calls from within the BTP environment. Therefore, please use BAS instead of IDEs like VS Code. Reference linkIn the .env file, you need to add the destinations variable by obtaining the name and URL information of the destination from the Destinations page in the BTP Cockpit.destinations=[{“name”:”demodestination”,”proxyHost”:”http://127.0.0.1″,”proxyPort”:”8887″,”url”:”http://demodestination.dest”}]ConclusionI hope this helps you in your app development using CAP.   Read More Technology Blogs by SAP articles 

#SAP

#SAPTechnologyblog

You May Also Like

More From Author