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

Problem in fetching data from SQL Server

Former Member
0 Likes
555

Hi all

i have legacy system with sql server, I have connect to the sql server with sap though DBCO connection, now i want fetch data from SQL servers table ,pls advice how fetch the data

Thanks

kanishka

4 REPLIES 4
Read only

Former Member
0 Likes
480

For this you can use Native sql commands. Search for the native sql commands in the abap help.

They will be like

EXEC.

select field1 field2 into :abap_field1 , :abap_field2 from table@domain where field1 = :abap_field3

ENDEXEC.

If you want to fetch the data into internal tables we can use exec porforming perform.

Or cursor concepts. Any more help please do ask.

Read only

0 Likes
480

Thanks Phani,

can you explan table@domain command,what is the domain mean

Thanks

kanishka

Read only

0 Likes
480

Dude sorry for the late reply. That table@domain is the domain of the database that we are using. usually we have table pools and in them tables and then we have domains for this table pools.

So to represent a table completely we give the table name as pool.table@domani. Simply table name.

Read only

Former Member
0 Likes
480

Hi kanishdkadp,

1. for this u will also require help of basis team.

2. these are the steps.

a) make an entry in DBCON

b) make connection string

(on the physical application server,

so that it can connect to secondary database)

(this will be done by basis team,

in which, they will specify the

IP address of the secondary database server,

the DATABASE ID, and the port number)

c) then using open sql / native sql,

we can use the secondary database connection,

just like normal.

d) if we use open sql,

then there must be Y/Z table on

sap as well as secondary database,

and the field names , their type all should be identical.

regards,

amit m.