Tuesday, April 10, 2012

SAP SpecialTables

I came across this topic "SAP Special Tables" upon reading my SAP ABAP Certification ebook. SAP Special Tables are very common table types of SAP that we as ABAPERs encounter from our day to day ABAP development. SAP Special Tables are very common in ABAP and very important as far as SAP technology is concerned. They are simply tables that contain the business data needed by everyone using SAP technology. 

These special tables are called Transparent, Cluster, and Pooled tables. You may find various definitions and comparisons in the internet if you like but, I noticed that those definitions are described commonly based on textbook type of explanations which for me I found it difficult to understand quickly esp. by the newbies. So, I decided to write this down immediately after compiling my own understanding and figuring out how I am going to plot and describe it here through my blog.

First, I will explain one by one the definition and how these tables are used and how to create one of them in SAP. Let's start with Transparent table:

Transparent table - is a type of table in SAP with a direct relation to the database itself. meaning every time you create a transparent table, there should always a corresponding instance as one to one physical relationship in a database table. The below picture shows how ABAP tables relate to the database tables from dictionary logical view relationship.

Creating transparent table can be done in SE11. Changing the type can be done by clicking extras and Change Table Category.

Cluster table - is a special table contains many cluster tables and grouped them into one table by combining each of their keys whichever is identical otherwise create a new key field. As you can see on the above picture, cluster table is composed of various cluster tables in dictionary logical view but it is made of only one physical database table.

Pooled table - simply a combination of various tables regardless of the key combination. Meaning keys are not combined but rather treated them independently for each table being pooled.

The below picture how pooled and cluster table differentiate to each other by means of UNION.

The letter shows the keys, if you noticed, in cluster same keys are combined to produced only one key in the database table while in pooled keys are treated independently.