Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Upload table from Oracle

Former Member
0 Likes
813

Hi,

I have a table in Oracle ....i want to fetch the records from the table and want to use that in my program.

Is it possible to write any connectivity program in ABAP for it ?

Rgds,

OP

1 ACCEPTED SOLUTION
Read only

anversha_s
Active Contributor
0 Likes
777

hi,

U need to write native SQL code for this in ABAP for getting the structure into SE11 & use the staructure in ur program.

rgds

anver

if hlped mark points

Hi,

I have a table in Oracle ....i want to fetch the records from the table and want to use that in my program.

Is it possible to write any connectivity program in ABAP for it ?

Rgds,

OP

5 REPLIES 5
Read only

Former Member
0 Likes
777

You can create your own BAPI and inside the BAPI specify the remote destination.Some basis settings may be required for connecting it to oracle.

Read only

anversha_s
Active Contributor
0 Likes
778

hi,

U need to write native SQL code for this in ABAP for getting the structure into SE11 & use the staructure in ur program.

rgds

anver

if hlped mark points

Read only

0 Likes
777

hi,

adding to the above post.

Please find the following helpfull link http://www.sap4.com/contentid-146.html on how to setup the connection and to read the data.

rgds

anver

if hlped mark points

Read only

Former Member
0 Likes
777

Hi

Step 1: Create an entry for the External database in DBCON table using Trxn: DBCA.

Field Name Description Value (For: E.g.:)

CON_NAME Logical name

for database con RAJ

DBMS Database system MSS

USER_NAME Database user <username>

PASSWORD Password for setting up

the connection

to the database <pwd>/<pwd>

CON_ENV Database-specific MSSQL_SERVER=depotserver MSSQL_DBNAME=HOF_INDORE

DB_RECO Availability type for an open database connect

Then, you can define internal table and code the following way:

DATA: BEGIN OF wa,

c_locid(3),

c_locname(50),

c_locstate(5),

END OF wa.

EXEC SQL.

CONNECT TO 'RAJ' AS 'V'

ENDEXEC.

EXEC SQL.

SET CONNECTION 'V'

ENDEXEC.

*- Get the data from MS-SQL Server

EXEC SQL.

open C1 for

select

loc_id,

loc_name,

loc_state

from ho_loc_mast

ENDEXEC.

DO.

EXEC SQL.

FETCH NEXT C1 into :wa-c_locid, :wa-c_locname,

:wa-c_locstate

ENDEXEC.

IF sy-subrc = 0.

PERFORM loop_output.

ELSE.

EXIT.

ENDIF.

ENDDO.

EXEC SQL.

CLOSE C1

ENDEXEC.

&----


*& Form LOOP_OUTPUT

&----


  • Output

----


FORM loop_output .

WRITE: /5 wa-c_locid, 10 wa-c_locname, 65 wa-c_locstate.

CLEAR wa.

ENDFORM. " LOOP_OUTPUT

Regards,

Raj

Message was edited by: Rajasekhar Dinavahi

Read only

Former Member
0 Likes
777

Hi,

You need to have the RFC conecton between the Oracle system with SAP system and you need to call a FM with RFC enabled one

see the bewlo blog which explains how to upload the data from Microsoft Excel, write the same logic to upload the data from the Oracle system

/people/kathirvel.balakrishnan2/blog/2006/05/08/data-upload-into-sap-from-microsoft-excel-150-abap-part

mark all the helpful answers

Regards

Sudheer