There are different causes for ABAP errors, depending on the program. Causes include:
Incorrect or incomplete entries in the RFC destination (transaction SM59)
Network problems
Authorization problems
Error in the RFC program
Check the following:
Check all the entries made in transaction SM59. Do all the entries match the settings of the target system?
Is the hostname correct?
Is the service/system number correct?
Is the user/password set correctly?
Is the target system active?
Did you save the destination?
Make sure that the target machine can be addressed by the host on which the gateway process is running.
Check that the gateway processes are running on both systems.
Check the network connection.