2009 Mar 26 9:53 AM
Dear,
I want to access and read from Oracle 9i tables from SAP.
How can i do this.
Do i have to do anything from basis side or write a connection string in ABAP.
Regards,
Priya
2009 Mar 26 10:24 AM
Hi Priya,
First of all check whether DB connection is done from transaction DBCO. If no connection is made then ask your basis team to do this.
Then is your program were you want to read the table from oracle 9i write a code like this:
The table can be read with the help of declaring a cursor type data.
EXEC SQL.
CONNECT TO 'MYCONNECTION' " Name of DB connection
ENDEXEC.
EXEC SQL.
open c for
SELECT * from PVACCOUNTBALANCE2
ENDEXEC.
DO.
EXEC SQL.
FETCH NEXT c INTO :ithead " internal table for data
ENDEXEC.
append ithead.
IF sy-subrc ne 0.
EXIT.
ENDIF.
ENDDO.
EXEC SQL.
CLOSE c
ENDEXEC.
EXEC SQL.
DISCONNECT :'MYCONNECTION'
ENDEXEC.I hope this answers your query.
Regards,
Brajvir
Dear,
I want to access and read from Oracle 9i tables from SAP.
How can i do this.
Do i have to do anything from basis side or write a connection string in ABAP.
Regards,
Priya
2009 Mar 26 10:00 AM
2009 Mar 26 10:24 AM
Hi Priya,
First of all check whether DB connection is done from transaction DBCO. If no connection is made then ask your basis team to do this.
Then is your program were you want to read the table from oracle 9i write a code like this:
The table can be read with the help of declaring a cursor type data.
EXEC SQL.
CONNECT TO 'MYCONNECTION' " Name of DB connection
ENDEXEC.
EXEC SQL.
open c for
SELECT * from PVACCOUNTBALANCE2
ENDEXEC.
DO.
EXEC SQL.
FETCH NEXT c INTO :ithead " internal table for data
ENDEXEC.
append ithead.
IF sy-subrc ne 0.
EXIT.
ENDIF.
ENDDO.
EXEC SQL.
CLOSE c
ENDEXEC.
EXEC SQL.
DISCONNECT :'MYCONNECTION'
ENDEXEC.I hope this answers your query.
Regards,
Brajvir
2009 Jun 02 5:59 AM
2009 Jun 02 6:04 AM
Dear,
It is same as normal internal table we declare for abap programming.
Regards,
Priya
2009 Jun 02 6:07 AM
hi Priya,
i mean, what is the structure of the iternal table. Do we need to declare the fileds in the internal table having the same structure of remote server table stucture ?
2009 Jun 02 6:18 AM
Yes u will have to declare the same structure that of remote server table.
Regards,
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |