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

Transfer data from SAP TABLES to a SQL table

Former Member
0 Likes
951

Hi,

I need to transfer data from SAP tables to a SQL table. Please suggest the best way as well as the steps please.

Regards,

Kamlesh

Hi,

I need to transfer data from SAP tables to a SQL table. Please suggest the best way as well as the steps please.

Regards,

Kamlesh

4 REPLIES 4
Read only

Former Member
0 Likes
655

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.

< Populate SAP data into an internal table >

Loop on itab.

EXEC SQL.

< code here for populating data into MS-SQL Server table>

ENDEXEC.

Endloop.

Regards,

Raj

Read only

0 Likes
655

Hi Raj,

DBCA transaction does not exit.

Read only

0 Likes
655

Hi Raj,

I am getting a runtime error

ABAP runtime Errors DBIF_DSQL2_CONNECTSTR_ERROR.

I suppose i am not getting connected. please help me out

Read only

0 Likes
655

EXEC SQL.

CONNECT TO 'test'

ENDEXEC.