Ads

All about Tables in SAP ABAP

All about Tables in SAP ABAP


Tables are most and import basic concept which every ABAPer should learn to understand SAP ABAP development wolrd. So tables are important topic to get ABAP programming.
Tables are database independent in the ABAP dictionary,when the table is activated,the system create physical table in the SAP database and translates tables definition from the ABAP dictionary to the particular database definition.
Table is defined in the ABAP dictionary with following components:
Table fields
Foreign keys
Technical settings
Indexes

Table fields  define the filed names and data types of table fields
Foreign keys define the relationship between the tables
Technical setting used for controlling the creation of the table in the database.
Indexes are used to speed up the data selection

We can modify the tables with append structures and customizing includes. 

We can create ,change and delete the table.

Table contains the following components:
Field name:name of the filed.
Key flag:whether filed belongs to key filed are not.
Initial value indicator:for initial value.
field type:data type of field.
filed length:number of valid places in the field.
decimal places:number of the places after decimal point.
short description: meaning of the field.


we can also include the fields of structure in the field.


Tables features:

we can assign a data element to th filed.
A check table can be assigned to table.
A search help can be assigned to table.
Refence table and reference table can be assigned to table.

Foreign keys:
We use foreign keys to define relationships between tables in the ABAP Dictionary, create value checks for input fields and connect several tables in view or lock object.
A foreign key connects two tables Table1 and Table2 by assigning fields of table T1 to the primary key fields of table T2.

Technical settings:

We use the technical settings of a table to define how to handle table when it is created in the database. We can specify whether the table is buffered and changes to the table's data records are logged.

Buffering permission:
The buffering permission defines whether the table can be buffered.
Buffering type:
If the table can be buffered, you must define a buffering type (full, generic, single-record). The buffering type defines how many table records are loaded into the buffer when a table entry is accessed.
Logging:
This parameter defines whether the system logs changes to the table entries. If logging is switched on, the system records each change to a table record in a log table.
Write access only with JAVA
Using the indicator "Write access with Java only" you can define that contents of the table may only be changed from within Java. If you implement changes (INSERT, UPDATE) to the table content through ABAP programs, there is no guarantee that this data can be read correctly from the Java side. If the data written by ABAP is ASCII data, it can be read from the Java side.
The Convert to transparent table flag  is also displayed for pooled tables or for tables which were converted into transparent tables earlier on with this flag.


We use table buffering to get best performance when accessing the data records from the table. The table buffers exists on each application server in the system. The data of buffered tables can be accessed directly from the buffer of the application server. This avoids the time-consuming process of accessing the database.


We use indexes to speed up searching a table for data records that satisfy certain search criteria.
An index can be considered a copy of a database table that has been reduced to certain fields. This copy is always in sorted form. Sorting provides faster access to the data records of the table, for example using a binary search. The index also contains a pointer to the corresponding record of the actual table so that the fields not contained in the index can also be read.

primary indexes: defualat indexes.
secondary indexes:custom indexes.


customizing include:
A customizing include is a structure that satisfies a special naming convention. The name of a customizing include begins with 'CI_' and the include is in the customer namespace.

Append Structures

We use append structures for enhancements that are not included in the standard. This includes special developments, country versions and adding customer fields to any tables or structures.
An append structure is a structure that is assigned to exactly one table or structure. There can be more than one append structure for a table or structure.


Making Changes to Tables

We use this process to make changes to already existing tables.


Adding an Append Structure
Inserting an Include
Inserting New Fields
Deleting Existing Fields
Changing the Data Type, Field Length and Decimal Places of Existing Fields
Changing the Table Category
Moving Fields
Copy Fields from Another Table
Copying Fields from an Entity Type.
Deleting Tables


Comments

Popular posts from this blog

BADI Interview Questions in SAP ABAP

Sample SAP ABAP Programming Examples for Practice

Module Pool Programming Interview Questions and Answers in SAP ABAP

Step by Step tutorial on BDC Session Method Program in SAP ABAP

SAP ABAP Interview Questions and Answers for 10 Years Experienced