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

Transferring data from SAP tables to SQL server

Former Member
0 Likes
2,741

How do we transfer data from an SAP Ztable to an SQL server? I have got the ip address, user id and passowrd of the SQL server. How do I go about thus?

6 REPLIES 6
Read only

Former Member
0 Likes
1,080

Hi

One way is to write a program, which extracts the data

from ZTABLE, download to application server and trasnfer

the same to other server using FM's: FTP_CONNECT, FTP_COMMAND, FTP_CLOSE.

Doing this way, you can use the same object whenever

itz necessary or schedule it as per the requirement.

Kind Regards

Eswar

Read only

0 Likes
1,080

refer...

Read only

Former Member
0 Likes
1,080

You can give this data in the transaction DBCON and open a connection using the native SQL statements and then in the command. In this we can use the database specific insert commands.

EXEC.

ENDEXEC.

Read only

0 Likes
1,080

where do I enter the ip address in the DBCON table?

Read only

0 Likes
1,080

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

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

Table: DBCON (Description of Database Connections)

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

CON_NAME Logical name RAJ

DBMS Database system MSS

USER_NAME Database user <username>

PASSWORD Password <pwd>/<pwd>

CON_ENV Database-specific information

connection

MSSQL_SERVER=depotserver MSSQL_DBNAME=HOF_INDORE

DB_RECO Availability type for an open database connect

Step 2: Now you can write code to connect to the external database…

Your Sample code can be something like this……

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.

Read only

Former Member
0 Likes
1,080