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

Database connection to SQL server using ABAP program

Former Member
0 Likes
443

Hi all,

What do we need to enter in the con_env feild of dbcon table for connecting to the SQL databse

I have entered the following string dbname=SAP_DB user=sap password=sap host=145.17.60.87 port=1433

Is it correct ?

DATA: tbr(50) type c.

EXEC SQL.

CONNECT TO 'SQLDB'

ENDEXEC.

IF SY-SUBRC NE 0.

message s000(zf) with 'Imposible conectar a SQLDB'.

ENDIF.

EXEC SQL.

SET CONNECTION 'SQLDB'

ENDEXEC.

EXEC SQL PERFORMING LOOP_OUTPUT.

SELECT T_DES

INTO :tbr

FROM data_table

ENDEXEC.

FORM LOOP_OUTPUT.

write: / tbr.

ENDFORM.

where data_table is the database table name

also i think i will have to create a table in ABAP dictionary with the same structure as data_table but that table will start from 'Z'.

kindly help

2 REPLIES 2
Read only

Former Member
0 Likes
397

SOLVED ON MY OWN

Read only

0 Likes
397

Hi Sunil,

I am working on this same problem. What was the solution you used?

Thanks

Shane