Technology: SAP ABAP Simplified - Part-II
June 30, 2008 by Ameya Pimpalgaonkar
-SAP Consultant, L & T Infotech
Further to the previous artilce SAP ABAP - Part-1 MadeITsimple, i am continuing the series with the second article which will elaborate on technical details of SAP ABAP and will go indepth. I must say again that this article is alo published by GoArticle and DropJack.
Few concepts we wil discuss here are ABAP Dictionary element, Data elements, Tebles, Structures and some more.
Primary Key:
We can define field(s) in Tables as Primary Key. The value of primary key must be unique and there can be any number of primary keys for a table. However, all the primary keys should be defined at same place and there should not be any non-primary keys present in between primary keys.
Foreign key:
We can define a field as foreign key only when it is a primary key in another table. We can join two tables with foreign key relation ship.
While creating a table/structure field the basic elements required are data element and domain.
Domain: It defines the technical attributes of a field.
- About the Data type of the field
- Length of the field
- Decimal Places
- Output Length
- Sign of a field and
- Case for a field
We can define value range for a field by specifying value table in the domain. With this value range one can define whether the field had fixed set of values or not.
Value table does not have input check and it will not provide F4 help, it just defines the range of values a particular field can have.
Input check will be provided to a particular field only when that field is defined as foreign key for the table.
Data Element:
Data Element describes the type attributes of a field. It defines:
· whether the field is pointing to a domain or pointing to a reference type
· Search help for a field
· Parameter ID ( For SET/GET Parameters)
· Field Labels
One or more data elements can refer to same domain. However, reverse of this is not possible i.e. more than one domain can’t point to one data element.
All the characteristics of data element are inherited to a table field when it is assigned to a particular field. Each field in a table can refer to different data elements.
One or more fields can refer to same data element but more than one data element can’t point to one field.
One can define characteristics of a field by defining separately instead of using a data element. Defining through data element maintains consistency between different fields.
Creating domain, data element and assigning the data element can be top-down approach or bottom approach. We can create data element and the domain directly while assigning to a field or else we can create domain and data element first and then assign that data element to a field.
This process of creating data element and domain and assigning to fields is same for dictionary objects like Tables, Structures
Tables:
The following features are available for a table:
1. Creating data elements and domains as aforementioned
2. Maintaining Table
3. Controlling Table Data
4. Technical Settings
5. Table Maintenance Generator
Maintaining Table:
A table can be maintained using different transactions like SM30 or SE16. However, options have been provided for the user to restrict this maintenance.
Three options have been provided:
1. Display/Maintenance allowed with restrictions.
2. Display/Maintenance allowed.
3. Display/Maintenance not allowed.
Third option just displays the table attributes and its respective fields but will completely restricts the user even for display of the table contents.
Controlling the Table contents:
Data can be controlled by using the option ‘Delivery Class’ in a table. It controls data at different aspects like up gradation, installation.
Technical Settings:
Technical Settings will help to define the accessibility and storage requirement of a table.
Data Class can be defined to ensure the storage type of data. Three types of storage classes are provided which can be termed as:
- APPL0 – Master Data, Transparent Data
- APPL1 – Transaction Data, Transparent Data
- APPL2 – Organizing and Customizing
As the names indicate APPL0 is the one which contains data that is rarely modified,
APPL1 is the one on which frequent transactions will happen and APPL2 is used to refer rarely changed data.
User has the option to define the required storage area for that table. It gives the option to select from 0 to 4 where the ranges for each are as follows:
0 - 0 to 1000
1 - 1001 to 5000
2 - 5001 to 20,000
3 - 20,000 to 100,000
4 - 100,000 and more
Buffering can be done using technical settings which defines whether a buffering is allowed for the table or not. If else a buffering is allowed which type of buffering is needed for the table like single record or fully buffered.
Tracking the data changes can also be set using technical settings. By selecting the button ‘Log Data Changes’ it will maintain the history whenever a Delete/ Update have been done on the table data.
Table Maintenance Generator:
It will provide the details of the maintenance screen how it should look like.
Whether the screen is a two-step which means there is a detailed screen and also an over view screen or single-step which shows only overview screen. The size of the overview and Detail screen can be selected based on the requirement.
This option is provided only if the user has selected Maintenance allowed in the Maintain Table feature.
Structures:
A structure defines a standard model with no data in it. This is mainly used in Function Modules for defining parameters. Creating fields, data elements and domain follows the same process as aforementioned.
Views:
A view can be created with the combination of one or more tables based on join conditions. The fields that are required from different tables can be selected and can be viewed with the help of view.
Search Help:
With the help of search help one can provide F4 help to the fields in a table. There are two types of Search Help
- Elementary Search Help
- Collective Search Help
Elementary Search Help gives one path of F4 help. Where as Collective Search help is a collection of Elementary search helps which provides multiple paths of F4 help for a single field.
The selection method contains an object (table/view) name from which the values are taken for F4 help. For getting the values the same field name in the view should be used in the search help parameter.
We can define the outcome of the search help using the Dialog type which provides the following options.
1. Display values immediately
2. Dialog with value restrictions
3. Dialog depends on set of values
The values will be displayed immediately the moment F4 is selected if ‘Display values immediately’ option is selected.
When ‘Dialog with value restrictions’ is selected then before the output displays, a dialog box pop-ups which allows the user for searching values based on selected search criteria.
For third option, when the output list contains large amount of data then a dialog box appears asking for number of records to be displayed.
Search Help Exit:
A function module can be defined in this for doing further process on the selected values. It can be called at different events of search help process.
I will discuss the Report Programming concepts in the thirs article of this series and will discuss some more technical concepts.





Comments
Feel free to leave a comment...
and oh, if you want a pic to show with your comment, go get a gravatar!