Skip to content

Commit 5d8eb94

Browse files
committed
Automatic commit: Move 'abap-websocket-rfc-bc' from QA to Production
1 parent af96224 commit 5d8eb94

10 files changed

Lines changed: 247 additions & 0 deletions

File tree

Lines changed: 247 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,247 @@
1+
---
2+
title: WebSocket RFC to Cloud Using SAP Business Connector
3+
description: Learn how to connect an on-premise system prior to 1909 to cloud using WebSocket RFC.
4+
auto_validation: true
5+
time: 40
6+
tags: [ tutorial>intermediate, topic>abap-development]
7+
primary_tag: topic>abap-connectivity
8+
---
9+
10+
## Prerequisites
11+
- Access to an SAP S/4 HANA system prior to version 1909
12+
- Access to an SAP S/4 HANA Cloud system
13+
- Latest version of SAP Business Connector including all updates installed. To download SAP Business Connector, go to the [download page](https://support.sap.com/sbc-download). For more information about the installation and other documentation, go to the [details page](https://support.sap.com/en/product/connectors/bc/details.html).
14+
- You've created a private key, signing certificate, and signed certificate as described in the [certificate toolkit guide](https://support.sap.com/content/dam/support/en_us/library/ssp/products/connectors/bc/SBC_CertificateToolkitGuide_481.pdf).
15+
16+
## Details
17+
### You will learn
18+
- How to setup a WebSocket RFC connection from an on-premise system to a cloud system using SAP Business Connector.
19+
20+
In this tutorial, wherever **`XXX`** appears, use a number (e.g. **`000`**).
21+
22+
---
23+
24+
[ACCORDION-BEGIN [Step 1: ](Introduction)]
25+
The following tutorial describes how to establish a connection between an on-premise ABAP system and a cloud-based ABAP system.
26+
27+
Technically, the connection works as follows:
28+
29+
1. The on-premise ABAP system makes an RFC request for an RFC destination of type **`T`**.
30+
2. At this RFC destination, an SAP Business Connector (SAP BC) is registered. It receives the request, transforms it into a WebSocket/HTTPS-based request and forwards it to the cloud-based ABAP system.
31+
3. The cloud-based ABAP system processes the request and returns the response back to the SAP BC.
32+
4. The SAP BC transforms the response back to classic RFC protocol and returns it to the originating on-premise system.
33+
34+
![System URL](wsrfc_1.png)
35+
36+
SAP BC acts as a middleware between the classic CPIC-based RFC protocol and the WebSocket-based RFC protocol that can be `tunneled` through firewalls into the cloud without problems.
37+
38+
**If the on-premise ABAP System is an S/4HANA version 1909 or newer, the underlying ABAP platform can perform WebSocket RFC calls without any additional component. The business connector is not required in this case.**
39+
40+
[DONE]
41+
[ACCORDION-END]
42+
43+
[ACCORDION-BEGIN [Step 2: ](Setting up the source system)]
44+
45+
In the source system, you need to setup an RFC destination of type **`T`** and allow SAP BC to register at this destination. The source system will later send all RFC calls, which are intended for the cloud system, to this RFC destination.
46+
47+
In the source system (the on-premise system), set up an RFC destination of type **`T`**.
48+
49+
1. Run transaction **`SM59`**.
50+
2. Choose **create**.
51+
- Destination: **`MYDESTINATION_XXX`**
52+
- Connection Type: **T RFC connection to external program using TCP/IP**
53+
3. (Optional): Enter a meaningful description.
54+
4. On tab **Technical Settings**, make the following settings:
55+
- Activation Type: **Registered server program**
56+
- Program ID: **`CLOUD_SYSTEM_VIA_BC`**
57+
- Gateway Host: Hostname of one of the application servers of the on-premise system, which still has some free capacity.
58+
- Gateway Service: **`sapgwXX`**, where **`XX`** is the instance number of the on-premise system.
59+
5. Go to tab **Unicode**.
60+
- Make sure that here **Unicode** is selected.
61+
6. Save the destination.
62+
63+
![System URL](wsrfc_2.png) ![System URL](wsrfc_3.png)
64+
65+
[DONE]
66+
[ACCORDION-END]
67+
68+
69+
[ACCORDION-BEGIN [Step 3: ](Allow SAP BC to register at the RFC destination)]
70+
**If there is already a line like `P TP=* HOST=*`, you can skip this step.**
71+
72+
1. Run transaction **`SMGW`**.
73+
2. Choose **`Goto` > Expert Functions > External Security > Maintain ACL Files**.
74+
3. Go to tab **`Reginfo File`**.
75+
4. Choose **Insert Line > Standard**.
76+
- P/D (*): `P`
77+
- TP (*): `CLOUD_SYSTEM_VIA_BC`
78+
- Host: Host/IP where SAP BC will run, e.g. `10.87.64.3`
79+
80+
**You can find out the IP in the command line. On Windows, enter `ipconfig`. On Mac or Linux, enter `ifconfig`. Copy the IPv4 Address.**
81+
82+
- Access: `internal`
83+
- Cancel: `local`
84+
- No: Leave this field unspecified.
85+
- Choose **Save**.
86+
- Save your settings globally.
87+
- Choose **`Goto` > Reread (global)**
88+
89+
**In releases older than 7.40 SP11, you have to change the `Reginfo` file manually. See [SAP Note 1989587](https://launchpad.support.sap.com/#/notes/1989587) for more information.**
90+
91+
92+
[DONE]
93+
[ACCORDION-END]
94+
95+
[ACCORDION-BEGIN [Step 4: ](Communication management in the target system)]
96+
To provide a service in the cloud system, you must create the following entities:
97+
98+
- Communication user
99+
- Communication system
100+
- Communication arrangement
101+
102+
This procedure is the same as for other connection types. See [Overview of Communication Management](https://help.sap.com/docs/SAP_S4HANA_CLOUD/6aa39f1ac05441e5a23f484f31e477e7/5b8ff39ddb6741a29ddfcf587939e8f4.html?version=LATEST) for more information. In this tutorial, you don't need to create a communication scenario as we use the SAP-delivered scenario `SAP_COM_0636`. This scenario provides access to the following function modules:
103+
104+
- **`RFC_METADATA_GET`**
105+
- **`RFC_FUNCTION_SEARCH`**
106+
- **`RFC_GET_FUNCTION_INTERFACE`**
107+
- **`DDIF_FIELDINFO_GET`**
108+
109+
However, you can also use your remote-enabled function module with a custom communication scenario. See [Develop a Remote-Enabled Function Module (RFM)](https://help.sap.com/docs/SAP_S4HANA_CLOUD/6aa39f1ac05441e5a23f484f31e477e7/abf7105063f345edad7588cf58d53118.html?version=LATEST) and [Communication Scenario](https://help.sap.com/docs/SAP_S4HANA_CLOUD/6aa39f1ac05441e5a23f484f31e477e7/7ea7276c89a644d9867bf0f8627aed67.html?version=LATEST) for more information.
110+
111+
### Create a communication user in the target system
112+
1. Login to Fiori Launchpad in the target cloud system.
113+
2. Choose **Communication Management > Maintain Communication Users**.
114+
3. Choose **New**.
115+
4. User Name: **`BC_USERXXX`**
116+
5. Description: **`User for SAP BC`**
117+
6. Password: **`PasswordForBC_USERXXX`**
118+
7. Choose **Create**.
119+
120+
### Create a communication system
121+
1. In Fiori Launchpad, choose **Communication Management > Communication Systems**.
122+
2. Choose **New**.
123+
- System ID: **`MY_SYSTEMXXX`**
124+
- System Name: **`MY_SYSTEMXXX`**
125+
3. Activate **Inbound Only**.
126+
4. Under **Users for Inbound Communication**, choose **Add**.
127+
- Choose user **`BC_USERXXX`**.
128+
- Choose **OK**.
129+
5. Save the communication system.
130+
131+
### Create a communication arrangement
132+
1. In Fiori Launchpad, choose **Communication Management > Communication Arrangements**.
133+
2. Choose **New**.
134+
3. Search for communication scenario **`SAP_COM_0636`**.
135+
4. Arrangement Name: **`MY_ARRANGEMENTXXX`**
136+
5. Choose **Create**.
137+
- Communication System: **`MY_SYSTEMXXX`**
138+
- Copy the **API-URL**.
139+
6. Save the communication arrangement.
140+
141+
[DONE]
142+
[ACCORDION-END]
143+
144+
[ACCORDION-BEGIN [Step 5: ](Define connection parameters for the cloud system in SAP BC)]
145+
1. Start SAP BC.
146+
2. Go to **Adapters > SAP**.
147+
3. Choose **Add SAP Server**.
148+
- Name: **`Connection_to_Cloud`**
149+
- Connection Type: **`WebSocket Connection`**
150+
- Logon Type: **`User/Password`**
151+
- User: **`BC_USERXXX`**
152+
- Activate **Alias User**.
153+
- Password: **`PasswordForBC_USERXXX`**
154+
- Client: Client of the target cloud system (optional)
155+
- WebSocket Host: API-URL of the communication arrangement without the **`https://`** prefix
156+
157+
**Including the `https://` prefix leads to an error when you test the connection.**
158+
159+
- WebSocket Port: **`443`**
160+
- Network: **WAN**
161+
- Choose **Save**.
162+
163+
![System URL](wsrfc_4.png)
164+
165+
4. Download the certificate of the target cloud system. We recommend using the browser's "show certificate" functionality. Most browsers provide information on the security status of the SSL/TLS connection, usually displayed as a small lock icon. Select this icon and save the CA root certificate to file. We recommend to use Chrome browser for this.
166+
167+
![System URL](wsrfc_5.png)
168+
169+
5. Add the cloud system's certificate to the trusted list in SAP BC.
170+
- Copy the certificate to the CA certificate directory of SAP BC. In this tutorial, the directory is in **`C:\sapbc481\Server\config\trust`**
171+
- Go to **Security > Certificates** and choose **Trusted Certificates > Reload CA List**.
172+
173+
If your corporate firewall requires an HTTP proxy for outbound connections, you need to make this proxy known to the SAP BC. For this, go to **Settings > Proxy Servers > Secure Proxy (HTTPS)** and enter the host, port, and, if necessary, user information of your proxy server. Here, only basic proxy authentication can be configured.
174+
175+
6. Test the connection. Select the newly configured SAP server form the server list and choose **Test Connection**.
176+
177+
[DONE]
178+
[ACCORDION-END]
179+
180+
[ACCORDION-BEGIN [Step 6: ](Define connection parameters for the on-premise system in SAP BC)]
181+
1. In SAP BC, choose **Adapters > SAP**.
182+
2. Choose **Add SAP Server**.
183+
- Name: **`Connection_to_OP`**
184+
- Connection Type: **CPIC Connection**
185+
- Application Server: Hostname of your application server (= gateway host defined in your destination in *step 2*)
186+
- System Number: The instance number you used in *step 2*
187+
188+
![System URL](wsrfc_6.png)
189+
190+
- Choose **Save**.
191+
3. Go back to the **SAP Servers** list and choose **0** in the **Listeners** column of **`Connection_to_OP`** and choose **Add Listener**. This will create a so-called RFC Listener, which will connect to the RFC destination that we created in the on-premise system via transaction **`SM59`**.
192+
- Connection Type: **TCP/IP**
193+
- Program ID: **`CLOUD_SYSTEM_VIA_BC`**
194+
- Number of Threads: **5**
195+
- Gateway Host: Hostname of your application server (= gateway host defined in your destination in *step 2*). This field is filled automatically.
196+
- Gateway Service: The gateway service you used in *step 2*
197+
- Repository Server: **`Connection_to_Cloud`**
198+
199+
Using the target cloud system as repository server has two advantages:
200+
201+
- A function module must exist in the system, where it is to be executed. However, the same does not apply to the source system. Therefore, by letting SAP BC make the DDIC lookup in the cloud system, the on-premise system can call function modules of the cloud system, that do not exist in the on-premise system.
202+
203+
- By using the cloud system for the DDIC lookups, the SAP BC does not need user credentials for the on-premise system.
204+
205+
![System URL](wsrfc_7.png)
206+
207+
- Choose **Save**.
208+
- Start the listener. Choose the red button in column **Started?**.
209+
210+
[DONE]
211+
[ACCORDION-END]
212+
213+
[ACCORDION-BEGIN [Step 7: ](Define routing for function modules)]
214+
Define what SAP BC shall do with the incoming RFC requests. In our case, we simply instruct SAP BC to send everything that it receives from the on-premise system to the target cloud system.
215+
216+
1. In SAP BC, choose **Adapters > Routing > Routing Rules**.
217+
2. Under **Add Routing Rule**, enter the following:
218+
- Sender: Enter your the system ID of the on-premise system with the current client, for example **`YI3000`**.
219+
- Receiver: **`MYDESTINATION_XXX`**
220+
- Message Type: **`*`**
221+
222+
223+
3. Choose **Add**.
224+
- Transport: **RFC**
225+
- Destination: **`Connection_to_Cloud`**
226+
- Choose **Save**.
227+
- Activate the rule by choosing **No** in column **Enabled?**.
228+
229+
![System URL](wsrfc_9.png)
230+
231+
[DONE]
232+
[ACCORDION-END]
233+
234+
[ACCORDION-BEGIN [Step 8: ](Test the connection)]
235+
1. Run transaction **`SM59`**.
236+
2. Choose your destination **`MYDESTINATION_XXX`**.
237+
3. Choose **Connection Test**.
238+
239+
240+
[DONE]
241+
[ACCORDION-END]
242+
243+
[ACCORDION-BEGIN [Step 9: ](Test yourself)]
244+
245+
246+
[VALIDATE_1]
247+
[ACCORDION-END]
43.1 KB
Loading
68.8 KB
Loading
85.9 KB
Loading
47.8 KB
Loading
51.5 KB
Loading
57.2 KB
Loading
45.4 KB
Loading
6.67 KB
Loading
38.4 KB
Loading

0 commit comments

Comments
 (0)