cancel
Showing results for 
Search instead for 
Did you mean: 

link between sap table and oracle table

Former Member
0 Kudos

Hi all,

I got the question if it was possible to make the link between a SAP-table and an Oracle-table. I don 't have a response,

But maybe you guys can help me ?

Thanks in advance !

Edited by: Bjorn Demol on Mar 31, 2009 10:49 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Bjorn,

I understand your question as: if a table exists in the SAP dictionary with a given name and structure, what does that table look like in the database?

In the SAP dictionary there are three types of database tables:

- transparent table

- pooled table

- clustered table

For a transparent table there is an exact 1:1 relation between dictionary and database. If a table exists in the SAP dictionary with name "TABXYZ" and fields "MANDT", "COL1" and "COL2", then you will also find a database table named TABXYZ with fields MANDT, COL1 and COL2. The data type of a field in the dictionary is mapped to a data type of the underlying database system, e.g. with Oracle a field with type CHAR(n) in the dictionary becomes VARCHAR2(n) in the database.

A pooled table does not exist as a separate database table. Instead, groups of pooled tables are stored together inside a physical pool. At the database level there is only one table (namely the physical pool). This table has a field called TABNAME, which contains the name of the "logical" (i.e. pooled table) that each specific row belongs to. You can see this in the SAP dictionary: in SE12, enter "ATAB" as the table name and look at the structure. ATAB is the most important physical pool in the SAP database; in ECC 6 systems ATAB contains over 1800 pooled tables. The actual columns of a pooled table are not visible at database level: they are grouped together in the phsyical pool columns VARKEY (for the primary key fields) and VARDATA (non-key fields); both columns are of raw (binary) type. The database interface of the SAP kernel takes care of converting between these binary containers and the logical field names as defined in the dictionary.

Like pooled tables, clustered tables do not exist as separate database tables; they are part of a physical cluster. At the database level only the physical cluster exists as a table. Whereas with pooled tables, one row of the pool belongs uniquely to one logical table, one row of a physical cluster contains data of several clustered tables. The idea is that data of a "master" table is kept physically together with data of "subordinate" tables that share a cmmon primary key. This is beneficial for performance. Because the combination of the "header" row with its subordinate records may exceed the maximum size of a physical row in the cluster, the rows for a common key have a sequence number. You can for example look in SE12 at the cluster RFBLG (a cluster containing accounting tables). The first four fields of RFBLG (MANDT, BUKRS, BELNR, GJAHR) define the common part of the primary key of the master and subordinate tables. PAGENO is the sequence number. TIMESTMP is an internal timestamp, PAGELG the length of the page (binary data) and VARDATA holds the actual data in binary form. PAGENO, TIMESTMP, PAGELG and VARDATA exist in all clusters; the fields coming before this (common key fields) are specific to each cluster.

Transparent tables form the overwhelming majority. In the ECC 6 system I have here, there are 69984 transparent tables, 2019 pooled tables and just 77 clustered tables. That does not mean that they are unmiportant: pooled tables are often small but critical (mostly customizing) tables; and some of the most critical tables in the system are clustered, e.g. the core accounting table (BSEG, clustered inside RFBLG) or the change document tables CDPOS and PCDPOS (in physical cluster CDCLS).

I hope this clarifies things (at least if I got your question right).

Regards,

Mark

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

first of all ,I want to apologize for two things :

- the time between my initial post and a response, I forgot my password and for one reason or another I was logged out from SDN

- the fuzzy question

But all answers were helpfull, so thanks everyone for the guidance !

Former Member
0 Kudos

Hi,

if both tables are in the same database check the native SQL option to use a "SAP" table and an Oracle table (i.e. in a join or similar).

As said, a "SAP"-table is an ORACLE table with a ABAP Data dictionary structure description .

You can't use both together in OPEN SQL - but you can in native SQL.

bye

yk

Former Member
0 Kudos

Hi,

SAP tables are stored in the database in the ABAP (pure ABAP stack) or Java schema (pure Java or ABAP+Java stack). You can access these tables using <SCHEMA-ID>.<tablename> if you are logged in as sysdba. Hopes this answers your query.

Thanks.

lbreddemann
Active Contributor
0 Kudos

Could you be a bit more elaborate on what you want to do?

"SAP tables" are most often "Oracle tables" as well.

So what kind of "link" do you want to create?

Give an example if possible.

regards,

Lars