Application Development 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: 

Accessing Table from Different Schema in CDS in ABAP

hawkvicky91
Explorer
0 Kudos

Hi,

We have Different Schema Containing Source Data replicated from SAP R/3/Non SAP systems.

Currently we are using concept of external view to access data in ABAP, But i want to access it in CDS in ABAP Without Creating External View through table in source system. I also tried "SOURCE"."TABLE". But its doesn't work.

So, How can i access table in different scheme in CDS?

1 ACCEPTED SOLUTION

jasmin_gruschke
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rohit,
you cannot access replicated tables in other schemas by means of ABAP CDS views maintained in an ABAP DDLS object - the answer might be different for native HANA CDS views, but for that we'll have to ask the HANA development guide or a corresponding expert around :-).

If there's a corresponding DDIC table, you might use the approach Christian mentioned above, but as you state it's a non-SAP system, I fear that this is not the case.

Alternatively, you might want to use ABAP managed database procedures (http://scn.sap.com/docs/DOC-51612), but therein you'd have to hard-code the schema name, which you certainly also don't want, right?

So your last two options seem to be native SQL (ADBC) or the external view approach you already mentioned yourself.

Cheers,
  Jasmin

3 REPLIES 3

christian_seitel
Participant
0 Kudos

Probably you may want to use an Open SQL - Secondary Database Connection, see

http://help.sap.com/abapdocu_740/en/abenopensql_multiconnect.htm

jasmin_gruschke
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Rohit,
you cannot access replicated tables in other schemas by means of ABAP CDS views maintained in an ABAP DDLS object - the answer might be different for native HANA CDS views, but for that we'll have to ask the HANA development guide or a corresponding expert around :-).

If there's a corresponding DDIC table, you might use the approach Christian mentioned above, but as you state it's a non-SAP system, I fear that this is not the case.

Alternatively, you might want to use ABAP managed database procedures (http://scn.sap.com/docs/DOC-51612), but therein you'd have to hard-code the schema name, which you certainly also don't want, right?

So your last two options seem to be native SQL (ADBC) or the external view approach you already mentioned yourself.

Cheers,
  Jasmin

0 Kudos

Its really sad to hear it. Only approach seems to be External view, haven't try ADBC yet, will give it try, But there should be some way to access table in Other schema , as we can do in AMDP("Source"."Table" or by using view ) or some thing like , where mapping can be take care.

Thanks. will try ADBC way..