0

Sorry for a very basic question, suppose you have an oracle database with sap system in organisation, then while writing the select queries , will the database tables names differ?

Suppose if am retrieving data from standard sap vbak table, then actually data won't be existing here right?, since I am using oracle database, the sales document data will be stored in some oracle database table right? so how can you write the select query with vbak only (i.e sap database table)?

Thanks & Regards.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
I_code
  • 59
  • 3
  • 11
  • 2
    I only understand that you are trying to bypass the application logic and access the database directly. There are numerous answers pointing out why this is a Very Bad Idea [TM]. – vwegert Feb 26 '15 at 09:59
  • Select vbeln from vbak into table it_vbak where vbeln=1000. if this is the query, then we are fetching data from vbak table right? so this is sap table, but I wont be having data in sap table because I am using oracle database, then the table name which store that vbeln field might differ in oracle databse right? @vwegert – I_code Feb 26 '15 at 10:08
  • 1
    as far as I know the table names on database level are the same as in the SAP Data Dictionary, at least for transparent tables. Pool-tables and other DDIC-specific constructs don't exist on the database in the same way as in the DDIC. The tables should belong to user sapsr3. Be aware that accessing the database directly circumvents any business logic and SAP-specific features like cacheing. And you have to make sure to select the correct client data yourself (the database table VBAK contains entries for all clients, whereas a SELECT in client 100 will only return rows for that client). – Dirk Trilsbeek Feb 26 '15 at 12:33

2 Answers2

0

The OPEN SQL statements in SAP use Information form a Data Dictionary and the kernel itself is Database Type specific.

So the same ABAP code can work in MSSQL, Oracle, MySQL Db2 etc.

You can use NATIVE SQL which is DB specific but that is rare and not recommended.

phil soady
  • 11,043
  • 5
  • 50
  • 95
0

All tables in Data Dictionary have the same names as their physical representations in backend RDBMS. As Phil kindly noted, this RDBMS could be MS SQL, MySQL as well as Oracle.
This is how it explained in ABAP Documentation:

Database table defined in ABAP Dictionary that has one instance in the database with the same name and the same columns as the definition in ABAP Dictionary. The data in transparent tables can be processed from outside AS ABAP using the programming interface of the database.

So the answer to your question will be "no, their names cannot be different". The name of transparent VBAK table will be identical with Oracle VBAK table and their contents also will be identical.

Suncatcher
  • 10,355
  • 10
  • 52
  • 90