Application Development 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: 

Upload table from Oracle

Former Member
0 Kudos
126

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

anversha_s
Active Contributor
0 Kudos
90

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

5 REPLIES 5

Former Member
0 Kudos
90

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.

anversha_s
Active Contributor
0 Kudos
91

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

0 Kudos
90

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

Former Member
0 Kudos
90

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

Former Member
0 Kudos
90

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