
- •Icons in Body Text
- •Introduction to the Dictionary
- •Overview of the functions
- •Data objects in the ABAP Dictionary
- •Data types
- •Exercise 1: Basic Data Types
- •Exercise 2: Simple and Nested Structures
- •Exercise 4: Deep Structures
- •Tables
- •Summary
- •Exercise 5: Tables in the ABAP Dictionary
- •Pooled and cluster tables
- •Performance During Table Access
- •Improved Performance through Access per Index
- •Improving the Performance through Table Buffering
- •Exercise 6: Performance Aspects with Table Access
- •Task 1:
- •Input Checks
- •Input check via the technical domains
- •Object Dependencies
- •Activation and Where-Used List
- •Changes to Tables
- •Database Changes to Transparent Tables
- •Enhancement of SAP Standard Tables
- •Exercise 9: Changes to Database Tables
- •Views and Maintenance Views
- •Restricted or Enhanced Views on Database Tables
- •Exercise 11: Views
- •Creating Maintenance Views
- •Exercise 12: Maintenance Views
- •Search Helps
- •Input helps
- •Exercise 13: Search Helps
- •Table ZEMPLOY##
- •Table ZDEPMENT##
- •Table ZEMPLOY##
- •Table ZEMPLOY##
- •Table ZDEPMENT##
- •Table ZDEPMENT##
- •Check table T000
- •Check table SCARR
- •Check table ZDEPMENT##
- •Check table SCURX
- •Check table STRAVELAG
- •Check table ZDEPMENT##
- •Check table T002

BC430 |
Lesson: Basic Data Types |
Exercise 4: Deep Structures
Exercise Objectives
After completing this exercise, you will be able to:
•Create deep structures and use them in ABAP programs
Business Example
You expand the structure of the personal data for your project team to such an extent that you can incorporate a telephone list of any length you wish for each employee.
Task:
Create an internal table based on a data object so that you can enter this in a structure. Use this in an ABAP program.
1.Create a table type for a standard table ZIT_PHONE_NUMBER## in the Dictionary. The table type should be based on the line type of the existing structure STR_PHONE.
2.Extend your existing structure ZPERSON## in the Dictionary. The new component should receive the name PHONE and be based on the internal table ZIT_PHONE_NUMBER##.
3.Create an ABAP program ZBC430_##_STRUCT_DEEP. To do this, copy your solution for the program ZBC430_##_STRUCT_NESTED or the model template SAPBC430S_STRUCT_NESTED. Extend this program by one work area for a structured data object (wa_phone) of the type
STR_PHONE.
4.Extend the program as follows:
Insert three telephone numbers into the structured data object wa_person and output this data in the same list using the LOOP command.
2006/Q2 |
© 2007 SAP AG. All rights reserved. |
41 |

Unit 2: Data objects in the ABAP Dictionary |
BC430 |
Solution 4: Deep Structures
Task:
Create an internal table based on a data object so that you can enter this in a structure. Use this in an ABAP program.
1.Create a table type for a standard table ZIT_PHONE_NUMBER## in the Dictionary. The table type should be based on the line type of the existing structure STR_PHONE.
a) In the SAP EASY ACCESS, enter se11 in the command field and confirm your entry
If you are in another transaction, you have to enter /n se11 in the command field and confirm the entry.
b)Select Data Type from the radio buttons.
c)Enter the name of the table in the input field.
d)Choose Create.
e)In the subsequent dialog box, choose Table Type.
f)Provide a short description and enter the name of the structure in the line type field.
g)Switch to the Initialization and Access tab page and choose Standard Table as the access type.
h)Switch to the Key tab page and choose Non-unique as key type.
i)Now choose Standard Key as a Key Definition
2.Extend your existing structure ZPERSON## in the Dictionary. The new component should receive the name PHONE and be based on the internal table ZIT_PHONE_NUMBER##.
a)Enter a new component with the name 'Phone' in your structure and specify the newly created table type as component type.
Compo- |
Component Type |
|
Description |
nent |
|
|
|
|
|
|
|
.include |
ZADRESS## |
|
Address structure |
NAME |
ZNAME## |
|
References the |
|
|
|
name structure |
PHONE |
ZIT_PHONE_NUMBER## |
|
References the |
|
|
|
telephone table |
|
|
Continued on next page |
42 |
© 2007 SAP AG. All rights reserved. |
2006/Q2 |

BC430 |
Lesson: Basic Data Types |
3.Create an ABAP program ZBC430_##_STRUCT_DEEP. To do this, copy your solution for the program ZBC430_##_STRUCT_NESTED or the model template SAPBC430S_STRUCT_NESTED. Extend this program by one work area for a structured data object (wa_phone) of the type
STR_PHONE.
a)See the source code excerpt from the model solution.
4.Extend the program as follows:
Insert three telephone numbers into the structured data object wa_person and output this data in the same list using the LOOP command.
a)See the source code excerpt from the model solution.
Result
Source text excerpt: SAPBC430S_STRUCT_DEEP
REPORT sapbc430s_struct_deep.
DATA wa_person TYPE zperson##.
DATA wa_phone TYPE str_phone.
START-OF-SELECTION.
*Fill deep structure with data wa_person-name-firstname = 'Harry'. wa_person-name-lastname = 'Potter'.
wa_person-street = 'Privet Drive'. wa_person-nr = '3'.
wa_person-zip = 'GB-10889'. wa_person-city = 'London'.
wa_phone-p_type = 'P'. wa_phone-p_number = '+31-10-9938990'.
INSERT wa_phone INTO TABLE wa_person-phone.
wa_phone-p_type = 'F'. wa_phone-p_number = '+31-10-9938991'.
INSERT wa_phone INTO TABLE wa_person-phone.
wa_phone-p_type = 'M'. wa_phone-p_number = '+31-79-12211433'.
INSERT wa_phone INTO TABLE wa_person-phone.
Continued on next page
2006/Q2 |
© 2007 SAP AG. All rights reserved. |
43 |

Unit 2: Data objects in the ABAP Dictionary |
BC430 |
*Write on List
WRITE: / wa_person-name-firstname , wa_person-name-lastname , wa_person-street , wa_person-nr , wa_person-zip , wa_person-city .
WRITE: / 'Phone-Numbers:'.
LOOP AT wa_person-phone INTO wa_phone.
WRITE: AT 20 wa_phone-p_type,
wa_phone-p_number.
NEW-LINE.
ENDLOOP.
44 |
© 2007 SAP AG. All rights reserved. |
2006/Q2 |

BC430 |
Lesson: Basic Data Types |
Lesson Summary
You should now be able to:
•Create domains and use them in data elements
•Define data elements and use them as the basis for defining data objects in ABAP programs
•Define structures and use them as the basis for defining data objects in ABAP programs
•Define internal tables and use them as the basis for defining data objects in ABAP programs
•Define complex (nested / deep) structures and use them as the basis for defining data objects in ABAP programs
•Define global constants with the help of a type pool and use them in ABAP programs
2006/Q2 |
© 2007 SAP AG. All rights reserved. |
45 |