Symtoms
The requests sent from the JCo program to the SAP system are failing to reach the SAP gateway.
When checking the SAP logs, including the Gateway Trace, no entries related to JCo were found.
Solution
First, check the logs in the SAP system using the following tools:
- Gateway Trace (set to Level 2 or higher)
- STAD
- ST01
- SM20 (filtered for RFC Function Calls)
If there are no logs in the SAP Gateway, the next step is to check the network conditions.
- Check the firewall or 33XX port status using telnet from the legacy system.
- Run “curl -v <IP:Port>” on the legacy system to verify whether network packets can successfully reach the SAP Gateway.
Note:
If you succeed in sending the packet using the above command, SAP Gateway trace will show logs like “Invalid data”.
This is because the curl command sends an HTTP protocol, but the Gateway is unable to understand this type of protocol.
Summary:
If the above tests succeed, it means there are no network issues between the legacy system and the SAP system. Also, the SAP Gateway is working properly. Therefore, you can assume that the issue lies within the JCo program.
In my case, the issue was caused by the JCo program libraries.
Additional Info.
- In SMGW > Logged on Clients, you can check the external program clients that are connected to the SAP Gateway, such as JCo and .NET applications (e.g., w3wp.exe).
- In many cases, the dispatcher port (32xx) can be used to connect JCo. Therefore, it is recommended to open the 32xx port as well.
Refer to the following links: Port for JCO connection, Port requirements for SAP. - You can change the port by setting the following JCo properties:
- jco.client.mshost – message server host or IP
- jco.client.msserv – message server service name or port (e.g., sapmsSID and 36XX)
- jco.client.gwhost – gateway host or IP
- jco.client.gwserv – gateway service name or port (e.g., sapgwSID and 33XX)
- If you set the above properties in JCo, you may need to add the corresponding service names and port numbers to the “/etc/services” file.
- If the “/etc/services” file is not configured properly, you may encounter errors such as: “service ‘sapmsGCP’ unknown”, “JCO_ERROR_COMMUNICATION:”, “Connect to message server on host <hostname or IP> failed”.