Troubleshooting SAP Connectivity
Problem
Some of the common issues seen when NLINK tries to connect to SAP are documented here.
See Test SAP Connectivity with the NMM for more information about the Test Connection tool in the NLINK applications.
Common Errors
Missing User Id / Password
If you see the following error:CALL_FUNCTION_SIGNON_INCOMPL
Connector:: SAP XXX Connector: Unable to log on to destination YYYY. Error message: KEY=CALL_FUNCTION_SIGNON_INCOMPL Message= Incomplete logon data..
Solution: Check your user id / password valuesName or password is incorrect (repeat logon)
If you see the following error:RFC_LOGON_FAILURE
Key 'RFC_LOGON_FAILURE': Message 'Name or password is incorrect (repeat logon)'
Solution:
The issue could be because of multiple reasonsDouble-check user id and password (passwords are case-sensitive)
Verify that user id exists in the SAP client trying to connect to
If the SAP system is setup to rejects expired/initial passwords, i.e. profile parameter rfc/reject_expired_passwd is set to "1", then need to change the user's password via SAPGui before trying to connect via NLINK. See SAP note 161146 for details.
Problem connecting to load balanced SAP, Service Unknown
For outbound SAP connection such as SAP RFC/BAPI, SAP Query, SAP Transaction or SAP IDoc (IDoc sent from NLINK to SAP) External Systems, if following error occurs
RFC_LOGON_FAILURE
Key=RFC_COMMUNICATION_FAILURE Message= LOCATION CPIC (TCP/IP) on local host SomeHostName with Unicode ERROR service '?' unknown TIME Wed Jul 1 10:22:59 2015 RELEASE 721 COMPONENT NI (network interface) VERSION 40 RC -3 DETAIL NiErrSet COUNTER 3
Solution: Specify the actual port value for MSSERV parameter, e.g., MSSERV=3601 instead of MSSERV=sapms01.
Connection to load balanced SAP fails with "unexpected function call"
An outbound SAP connection such as SAP RFC/BAPI, SAP Query, SAP Transaction or SAP IDoc (IDoc sent from NLINK to SAP) External Systems, when setup to connect with an load balanced SAP system, fails with following message "unexpected function call" or in some cases no description for error just "RFC_COMMUNICATION_FAILURE"
Solution: Make sure MSHOST specified is really SAP Message Server. Also make sure specified port 36xx (where xx SAP System Number) is is open.Service Unknown / GWSERV not found
In some cases the IDoc or RFC Listener connections fail to register properly, even if the proper GWSERV parameter is specified:
RFC_COMMUNICATION_FAILURE
Solution: Specify the actual port in the GWSERV parameter, e.g., GWSERV=3301 instead of GWSERV=sapgw01.WSAENOBUFS: No buffer space available
When trying to register RFC Listener or IDoc, the connection gets disconnected almost immediately. Get entries in log file similar to the following:
Solution: This can be caused by SAP Gateway security rule that blocks requests from an external RFC Server.Invalid Parameter
If you see the following message,RFC_INVALID_PARAMETER
Solution: Check the format, spelling and completeness of the parameters in your SAPNWRFC.INI file. Refer to the sample file for correct entries. Make sure value specified for "DEST" is not same as SAP System ID. For example if SAP System ID is "AB2" and value for "DEST" in SAPNWRFC.INI is specified as "AB2" it can cause this error.NLINK fails to connect to SAP, get communication errors
NLINK cannot connect to SAP system when NAT is involved, fails with error similar to thisSolution: See SAP Note 148832 about an SAP profile parameter to set which will allow the SAP host to recognize the incoming IP address as valid.
NLINK cannot process received IDoc
NLINK cannot process received IDoc. Cannot resolve IDoc Type or Message Type properly, Event log shows IDoc Type ' ?????????????'Solution: In SAP transaction SM59, make sure corresponding RFC Destination is setup to use Unicode
IDoc (receiving) disconnecting few seconds after reconnect
When using IDoc or RFC Listener, the NLINK connection to SAP is broken with ABAP_RUNTIME_FAILURE, "external RFC Client not supported. NLINK reconnects but gets disconnected after few seconds with error
Solution: In SAP transaction SM59, make sure corresponding RFC Destination is setup to use Unicode
RFC Listener or IDoc (receiving) disconnecting immediately after reconnect
When using IDoc or RFC Listener, the NLINK connection to SAP is broken (with RFC_COMMUNICATION_FAILURE error) as soon as reconnected message. Or on NLINK 6.0.0.140 (or earlier) NLINK crashes when using RFC Listener or IDoc connector (to receive IDoc). If you look at dev_rfc.trc or dev_rfc.log or NLINK logs you can find message "registration of tp * from host * not allowed". NLINK 6.0.0.140 (or earlier) crash at start up with this issue. NLINK 6.0.0.142 (or later) re-connection attempts at start up may see many connect / disconnect messages.
Solution:If the SAP Gateway is setup to block incoming RFC function registration then SAP Gateway will allow connection to be established but breaks connection as soon as RFC function registration is attempted. Check and make sure SAP Gateway allows connections to NLINK connections.RFC Listener or IDoc (receiving) NLINK logs show connection as registered but cannot see connection in SAP
When using IDoc or RFC Listener, the NLINK logs show that connection is established but the connection cannot be found in SMGW→Logged on Clients. Also the connection test from SM59 failsSolution: This can occur if SAP Gateway is not correctly specified in SAP SM59 transaction. Make sure proper Gateway options are specified.
IDoc (receiving) fails after one IDoc
[In NLINK version 7.0.0.189 or later]
When IDoc is reveived from SAP, it works first time but subsequently it can fail with warning in NLINK with following messages'External System Name' (NN - Some External System ID): Resetting connection for destination '[SOME_DESTINATION]', GwHost '[SOME_SAP_GATEWAY]', SAP System ID '[XYZ - SOME SAP SYSTEM ID', Program_ID ''. Instance x of y, Handle '0x12345678'. Will retry to reconnect every N seconds.
Code '15': Group '5': Key 'RFC_EXTERNAL_FAILURE': Message 'No transaction handler is installed. Unable to process tRFC/qRFC requests.': abapMsgClass '': abapMsgType '': abapMsgNumber '786561382': V1 '': V2 '': V3 '': V4 ''
OR
[In NLINK versions between 7.0.0.141 and 7.0.0.188]'External System Name' (NN - Some External System ID): Resetting connection for destination '[SOME_DESTINATION]', GwHost '[SOME_SAP_GATEWAY]', SAP System ID '[XYZ - SOME SAP SYSTEM ID', Program_ID ''. Instance x of y, Handle '0x12345678'. Will retry to reconnect every N seconds.
Code '15': Group '6': Key 'EXTERNAL_APPLICATION_FAILURE': Message 'External server aborted without message.': abapMsgClass '': abapMsgType '': abapMsgNumber '666106502': V1 '': V2 '': V3 '': V4 ''
Solution: Clear the value for External System Attribute 'SAP System ID’. If there is only one IDoc External System is configured this value will not be needed. If value for External System Attribute 'SAP System ID’ is changed then it will need restart of NLINK ServerIDocs are missing
NLINK setup to receive IDocs, SAP is generating and sending them, but some of the IDocs are missing/ not received in NLINK
Solution: Make sure there are no other software or systems registered to receive on same SM59 program id. SAP transaction SMGW can be used to check the program ids (TP_NAME) of all registered destinations. (Important: Choose Goto >> Logged on clients from the menu after entering SMGW. The initial screen is NOT what you are looking for.) If there are multiple systems registered with the same program id, then SAP may send IDocs to any of them.IDoc (NLINK) logs shows TID not found message
NLINK IDoc log “NLINK Sap IDoc Connector2 Trace.log” has entries saying “On TidConfirm, could not find TID (SOME TID), sending 'RFC_OK' to SAP
"
Solution: When there are issues in SAP with sending a specific IDoc to a registered destination, the IDoc will end up in error state and indicate to the registered destination to ignore that TID. Note that you may still see status 03 for that IDoc in WE05. That just means that SAP found a place to send it--it does NOT indicate that the system on the other end actually received it. Typically errored IDocs can be seen using SAP transaction SM58. If the IDoc error message is “connection to partner*
broken/CPIC-CAL” (where*
is typically NLINK machine and port), then the IDoc had some communication issue and needs to be manually resent. Others may eventually be automatically resent by SAP.Cannot Launch SAPGUI for Debugging
When trying to step into ABAP code for debugging, get an error ”SYSTEM_PREPARE_ATTACH_GUI not found”.
Solution: To use RFC with SAPGUI, the new library needs at least the following support packs to be installed:SAP_BASIS 46C SAPKB46C58
SAP_BASIS 620 SAPKB62066
SAP_BASIS 640 SAPKB64025
SAP_BASIS 700 SAPKB70020
SAP_BASIS 701 SAPKB70103
SAP_BASIS 710 SAPKB71008
SAP_BASIS 711 SAPKB71102
Can Connect via SAPGUI but not via NLINK
If you can connect from the NLINK machine via SAPGUI but not via NLINK, and you see the following error, check that ports 33xx are open.
Solution: The following ports must be open (where ## is the SAP system number):GUI (dispatcher, sapdp##): 32##
RFC (gateway, sapgw##): 33##
Load Balancing (message server, sapms##): 36##
NLINK IDoc Connector (SAP→NLINK) does not register even though SAP is destination is correct
When NLINK is configured to receive IDocs from SAP, NLINK fails to register. At start up see message "Could not connect ot SAP, will retry after x seconds"
Solution: Check the logs folder for any messages. This can occur if the SAP user ID and Password are not correct for SAP system. For NLINK IDoc Connector, at start up NLINK reads IDoc RFC meta information from SAP, if the credentials are not correct then incorrect message is displayed.NLINK RFC Listener, no data is received from SAP
Configured meta-database to match the SAP CALL FUNCTION, but not getting data in NLINK.
Solution: Check to make sure parameter name and case match exactly to what is configured in SAP. Also for parameters sent from SAP → NLINK they need to be marked as "EXPORTING" in SAP. Corresponding parameters in NLINK should be "IMPORT" parameters. In NCM, Parameter names are Message Format Table Attributes. The case for field names for each parameter also has to match in SAP as well as NLINK meta-database. The field names are configured as Message Format Field Attributes.NLINK RFC Listener, "Function XYZ not found" error in SAP
Configured SAP System ID (3 character ID) should exactly match the SAP System ID from where request is sent. Even with incorrect SAP System ID, the connection test from SM59 will work. The SMGW→Logged on Clients will also look fine. But when request is sent from SAP the request fails because SAP System ID does not match.
If there are other functions are working from same SAP system, then make sure meta-database is configured to receive remote function in question. Corresponding Event Attribute in NLINK meta-database should match the request.
Note: This error can also show RFC_NOT_FOUND exception in NLINK logs.
Solution: Check to make sure SAP System ID is correct. To verify the SAP System ID from the SAP GUI, look in the popup menu at the bottom right of the screen:
If you do not see the popup menu, look for a small triangle in the bottom right corner. Click it to slide open the information tray.
To verify the list of functions registered in SAP, run the Extras >> Function List test from SM59.When you run the connection test in NLINK are you seeing the message “Invalid UserId/Password” or is it something like “Password logon no longer possible – too many failed attempts”?
Solution: Make sure UserId is indeed valid. Message “… too many failed attempts” , indicates that the UserId is locked by SAP. The local SAP administrator will need to reset the UserId.NLINK IDoc connection gets dropped and re-established with “'field 'STATE' not found" message
In some cases when IDocs are sent from SAP to NLINK, connection could be dropped and re-established for no apparent reason. Logs shown entries such asKey 'RFC_INVALID_PARAMETER': Message 'field 'STATE' not found (in "NLINK Trace.log")
On connection XYZ for TID 'ABC' got TidConfirm, could not find TID in data container, sending 'RFC_OK' to SAP (in "NLINK SapIDOC Connector2 Trace.log").
Solution: Both indicate possible load issue, make sure External System Attribute "Number of Connections to SAP" is equal or greater than "Max. Conn." column for destination in SAP transaction SMQS.
NLINK IDoc or RFC Listener disallowed from registration due to gateway security
Configured NLINK IDoc or RFC Listener fail with follow errorSolution: The SAP secinfo and/or reginfo settings in the SAP System Gateway may not be configured to allow the NLINK Server to register. This is a matter for the SAP BASIS / security administrators. SAP Note 1408081 may be helpful.
Following are general checks and guidelines that can be used in any of above errors (or ones not documented above)
Basic Checks
Can the NLINK Server machine ping the SAP Server on the network?
Open a Windows command window and try to “ping” the network IP address of the SAP Server. For example, “ping 10.1.1.127”.
If there is no network connectivity then it will be impossible to connect. Contact your systems administrator if this test fails.Does the sapnwrfc.ini exist?
Double-check that a sapnwrfc.ini file is located in the proper location and it is saved with UTF-8 encoding.Are the sapnwrfc.ini parameters for the selected SAP destination correct?
Double-check that the information entered into the sapnwrfc.ini file is correct, properly spelled, and properly formatted.
Make sure the correct parameters are configured depending on the connection type. For example, a direct connection to an SAP “Application Server” requires different parameters than a connection to a “Load Balancing Server”.
Refer to the sample documentation included in the default file.Is the SAP R/3 Server actually running?
Sometimes, SAP servers are taken down for maintenance or otherwise temporarily unavailable. Check with the SAP administrator that the SAP server is currently available for connection.
Advanced Checks
As a last step, it is possible to generate some detailed SAP trace logs to help diagnose the problem.
Edit the sapnwrfc.ini file (for whichever SAP system you are trying to connect to) and set “RFC_TRACE=1” (the default is RFC_TRACE=0).
SAP runtime library trace files may be in Windows Systems folder. If you run the test with SAP trace you will see 2 (or more) in that logs folder. The local SAP administrator can take a look at these log files to see if there is any issue. The SAP trace logs will be named "rfc*.trc" and dev_rfc.trc.