Recently I faced following
issue related to Native SQL statement. While attempt to connect external DB via
Native SQL’s statement CONNECT TO I got return code 4. This happened only in
one of systems in the landscape same ABAP code on other systems connected to
the same external DB worked just fine.
After consulting this
issue with Basis team we found out root cause. Issue was that TNS Names entry
was missing. After adding the connection worked fine.
From SAP GUI you can check
the enry via tcode: DBCO or DBACOCKPIT
From ORACLE DB point of
view; the TNS names entry are physically stored tnsnames.ora file. Usually the
file is located under path:
ORACLE_HOME\NETWORK\ADMIN directory of your database server.
Or in SAP instance:
/usr/sap/SID/SYS/profile/oracle/