Showing posts with label data dictionary. Show all posts
Showing posts with label data dictionary. Show all posts

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.



Tuesday, June 28, 2011

Maintaining a table hastle free

Maintaining your customized table with your own tcode and program did ever cross your mind?

There's a very easy way to address your problem by creating a TCODE in se93 and choosing the parameter type tcode. By calling SM30, skipping initial screen then at the bottom part, you may include the table name (add VIEWNAME under name of screen field) and assign whether it can be updated (X) or not (blank) (add UPDATE under name of screen field).

To start with, in SE11 after creating your table, tech settings, etc. go to  Utilities->table maintenance generator. Save your changes.

Prerequisite: Make sure that the below where assigned to table:



If you want to add new fields, you may go to se11--> change--> utilities--> table maintenance generator-->generated objects--change-->new fields table and press enter and generate (click key or normal fields as well as click the screens to regenerate new)

Note: Put &NC& in Authorization Group and the table name in function group field if you don't assign any authorization..

Don't forget to adjust and activate your db in se14. then generate again.You may want also to modify your generated function group codes i.e changing screen layout, column names, etc.

Hope you find this useful. If you have questions or comments, please don't forget to put. Thanks!