Skip to Content
avatar image
Former Member

Unable to connect Oracle DB from SAP

Hi ,

I have a scenario to fetch data from SAP and Oracle database , I am getting error while trying to fetch data from oracle databse from ABAP Report by using Native SQL Command and the code below .

EXEC SQL.

CONNECT TO 'DB1' " DB1 Connection maintained in DBCON table in SAP

*SQL Server

ENDEXEC.

EXEC SQL.

SET CONNECTION 'DB1'

ENDEXEC..

EXEC SQL.

SELECT INVOICE_NUM INTO INVOICE_COUNT FROM INVOICES WHERE BUDAT BETWEEN :S_BUDAT-LOW and :S_BUDAT-HIGH

ENDEXEC.

Note : INVOICE_COUNT used is Internal table and INVOICES used is Database table in Oracle

SY-SUBRC Becoming 4 after obove connection command executes and program going to dump after execution of select statement

The short text provided in the runtime provided is table does not exist in database table although the table

INVOICES exist in the oracle databse

Can anybody please let me know what is the problem in the obove scenario please?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jul 07, 2011 at 11:04 AM

    Rehan,

    Is this a data-fetch-only query. I mean I assume the tables to be already existing. If it so, can you ask your Basis Consultant/DBA to check if the query suns from the Oracle level on the server.

    Regards,

    Varun

    Add comment
    10|10000 characters needed characters exceeded