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

SELECT * CONNECTION not work

Former Member
0 Likes
2,036

Hi,

It is found that SELECT * does not work with CONNECTION. For example, I use the following statement to retrieve data from another system and an error states that SQL error 207 when accessing table 'MARA'. 'Invalid column name  'ANIMAL_ORIGIN''. If columns are specified, data can then be retrieved. The SAP BASIS version is 7.31.

SELECT SINGLE *

      INTO CORRESPONDING FIELDS OF ls_mara

    FROM MARA

               CLIENT SPECIFIED

               CONNECTION ('G01')

WHERE MANDT = '100'.

1 ACCEPTED SOLUTION
Read only

custodio_deoliveira
Active Contributor
0 Likes
1,635

Hi TS,

You gave the answer already, but look at the HELP:

  • To allow the Open SQL command to be run for the secondary database connection, the table definitions in the connection must be the same as those in the standard database.

Cheers,

Custodio

5 REPLIES 5
Read only

custodio_deoliveira
Active Contributor
0 Likes
1,636

Hi TS,

You gave the answer already, but look at the HELP:

  • To allow the Open SQL command to be run for the secondary database connection, the table definitions in the connection must be the same as those in the standard database.

Cheers,

Custodio

Read only

0 Likes
1,635

Hi Custodio,

Thanks for you prompt reply, but would you please elaborate more? If I use the same statement to retrieve data from table MAKT, it works.

Thanks,

TS

Read only

0 Likes
1,635

Hi TS,

What I mean is, check if the structure of MARA is the same in both systems. I believe it's not and that's why SELECT * fails.

Cheers,

Custodio

Read only

0 Likes
1,635

Hi Custodio,

Thanks.

Read only

ThangaPrakash
Active Contributor
0 Likes
1,635

Hi TS,

Have you checked whether your database connection G01 exists in DBCON table to check whether there is a existing database connection with that name.

Regards,

Thanga