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

Secondary database conections

Former Member
0 Likes
905

i’m working in a proyect, that consist in send data to other db server that is not on the r3 database server,

both database server are running on SQL Server 2000.

The version of sap is 46b.

S.O. Windows 2000 SERVER

THe secondary database is in Windows 2000 Server too.

i found information in the notes: 313151,178949.

i fill the table dbcon as follow:

Connection name : SAPPVF

DBMS:MSS

User name: csappvf

DB password *** / ********+

Conn. info: MSSQL_SERVER=NHUERTA MSSQL_DBNAME=PRU

csappvf, is the user with permision dbo in database PRU.

Where NHUERTA, is secondary server, where is the database PRU.

PRU, is the secondary database

Code program abap.

EXEC sql.

CONNECT TO 'SAPPVF' AS 'MIM'

ENDEXEC.

EXEC SQL.

SET CONNECTION 'MIM'

ENDEXEC.

IF SY-SUBRC = 0.

EXEC SQL.

SET CONNECTION 'MIM'

ENDEXEC.

EXEC SQL.

SELECT single * INTO :WA_RENTA FROM RENTA

ENDEXEC.

but the program generate a dump:

ABAP/4 Program ZMX_BC_IN_CONEXION

vSource ZMX_BC_IN_CONEXION

Line 38.

<b>Error Code DBIF_DSQL2_OBJ_UNKNOWN. </b>

Module $Id: //bas/46D/src/krn/runt/abexsql.c#8 $ SAP.

Function ExecuteCall Line 806

Table does not exist in database....

How i can identify if the problem is of basis

Someone have any suggestion about this !!!

Message was edited by: Noemi Huerta

Message was edited by: Noemi Huerta

4 REPLIES 4
Read only

Former Member
0 Likes
570

The problem with bind variable in native SQL is that they can not accept mutiple rows. In your case, your select statement will be returning multiple rows, therefore it dumps out. The one option is use Open cursor and fetch next statements. You can find help on the following link.

http://help.sap.com/saphelp_47x200/helpdata/en/7b/0bdea252d746429420007a69bd06c7/frameset.htm

Read only

0 Likes
570

Hi Sharad !!!!

Thanks by your suggestion !!!

I take note about this, but i think the problem that i have, is related with basis, i want supose, because the content of my table is only 1 row, i change the select

instruction by a single *, and the system throw the same

error , Do you know how i can check that the problem is not of basis.

Read only

Former Member
0 Likes
570

Hi Noemi,

1. As u said, you have a secondary database connection

which is tested and working. (But giving

error in ur Z program)

2. SAP recommends that instead of using NATIVE Sql,

use OPEN Sql.

So that if there is any change in database,

the R/3 system(Database Manager) will automatically

take care of it)

3. According to me, you should you OPEN Sql.

To do this,

you will have to create the same Z / Y table

in your R/3 database, with the same structure.

This can be a blank table or structure.

SO THAT ABAP IDENTIFIES IT AS A DATABASE OBJECT

IN DD DICTIONARY WHEN SYNTAX CHECKING THE SQL.

4. One can use the following syntax.

DATA: mydbcon(30) TYPE c.

mydbcon = 'SAPPVF'.

Select * FROM YTABLE CONNECTION (mydbcon)

into ITAB.

HOPE THIS HELPS

Regards,

Amit M.

Read only

0 Likes
570

Hi Amit !!!!

I created a ztable in the sapr3 with the same structure that i have in the other dabatase that is not in the r3.

And try to put the instuction, but in the editor send a error, i think this no support the instrucction

that you suggest to me.

the editor send a message

wrong expresion in from clause where condition.

i look in the help and i don't found the instruction select with the option connection, i'm working with the

sql server 2000.

have you been do it in any time ?

I think the problem could be are in the basis, but i don't know how i can identify this !!!!