2018年10月18日 星期四

SAP 的 Table 種類

What the different Types of Tables in SAP ? (Transparent, Pool and Cluster)



通透資料表(跟真實資料表一樣)

Transparent Table :
Exists with the same structure both in dictionary as well as in database exactly with the same data and fields.

匯集資料表(真實表格可對應到很多SAP表格)
Pooled Table :

Pooled tables are logical tables that must be assigned to a table pool when they are defined. Pooled tables are used to store control data. Several pooled tables can be cominied in a table pool. The data of these pooled tables are then sorted in a common table in the database.

重集表格(多個資料庫表格對應到同一 SAP表格)
Cluster Table :

Cluster tables are logical tables that must be assigned to a table cluster when they are defined. Cluster tables can be used to strore control data. They can also be used to store temporary data or texts, such as documentation.
difference between Standard tables, Pooled tables and Clusterd Tables
A transparent table is a table that stores data directly. You can read these tables directly on the database from outside SAP with for instance an SQL statement.
Transparent table is a one to one relation table i.e. when you create one transparent table then exactly same table will create in data base and if is basically used to store transaction data.
A clustered and a pooled table cannot be read from outside SAP because certain data are clustered and pooled in one field.
One of the possible reasons is for instance that their content can be variable in length and build up. Database manipulations in Abap are limited as well.


But pool and cluster table is a many to one relationship table. This means many pool table store in a database table which is know as table pool.


All the pool table stored table in table pool does not need to have any foreign key relationship but in the case of cluster table it is must. And pool and cluster table is basically use to store application data.


Table pool can contain 10 to 1000 small pool table which has 10 to 100 records. But cluster table can contain very big but few (1 to 10) cluster table.


For pool and cluster table you can create secondary index and you can use select distinct, group for pool and cluster table. You can use native SQL statement for pool and cluster table.

結構資料表(就是讓開發者引用複製本身是空表)
A structure is a table without data. It is only filled by program logic at the moment it is needed starting from tables.
A view is a way of looking at the contents of tables. It only contains the combination of the tables at the basis and the way the data needs to be represented. You actually call directly upon the underlying tables.

Types of Tables in SAP

SAP Transparent Tables

Contain a single table. Used to store master data
It has a one-to-one relationship with a table in the database
For each transparent table there is one associated table in the database
The database table has the same name, same number of fields and the fields have the same names
There is only a single table
Single table can have one or more primary key
Secondary indexes can be created
They can be accessed using open and native SQL

Use of Transparent Table in SAP

They are used to hold master data e.g. Table vendors or table of customers. Example of transaction data is orders placed by customers

Pooled Tables in SAP

They are used to hold a large number of very small tables(stores customizing data or system data)
It has a many-to-one relationship with a table in the database
It is stored with other pooled tables in a single table called table pool in the database
The database table has different name, different number of fields and fields have different names
Table pools contain more tables than table clusters
Primary key of each table does not begin with same fields or fields
Secondary indexes cannot be created
They can be accessed using open SQL only

Use of Pooled Tables in SAP
They reduce the amount of database resources needed when many small tables have to be opened at the same time

Types of Tables in SAP: Cluster

They are used to hold data from a few number of large tables.(stores system data)
It has a many-to-one relationship with table in the database
Many cluster tables are stored in a single table in the database called a table cluster
The database table has different name, different number of fields and fields have different names
Contains less tables than table pools
Primary key of each table begins with same fields or fields
Secondary indexes cannot be created
They can be accessed using open  SQL only

Use of Cluster Tables in SAP

They would be used when the tables have primary key in common and data in these tables are all accesses simultaneously

Types of SAP internal Tables

There is 5 types of SAP internal Tables:
  • Standard Table,
  • Sorted Table,
  • Index Table,
  • Hashed Table,
  • Any Table ( Generic type , used for generic ABAP Programming )


沒有留言:

張貼留言