- •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
Unit 4: Input Checks |
BC430 |
Table |
Field |
ZDEPMENT## |
Client |
|
Airline |
ZFLCREW## |
Employee number |
1.Create foreign key ZEMPLOY##-Client as follows:
a)Place the cursor on the Client field in ZEMPLOY##. Choose Goto
→ Foreign key.
Since you are using domain CLIENT for the Client field in ZEMPLOY##, the system proposes value table T000 as check table.
b) Have the system make a proposal for the foreign key definition. Check the proposal. The following fields must be assigned:
Check table T000
CkTabFld |
For. key table |
For. key fld |
MANDT |
ZEMPLOY## |
Client |
c) Enter a short text and define the semantic attributes as follows:
Field |
Value |
|
|
Type of foreign key fields |
Key fields / |
|
candidates |
|
|
Cardinality |
1:CN |
d) Save your foreign key.
Continued on next page
118 |
© 2007 SAP AG. All rights reserved. |
2006/Q2 |
BC430 |
Lesson: Consistency Through Input Checks |
2.Create foreign key ZEMPLOY##-Carrier.
Note: Since you are using domain S_CARR_ID for the Carrier field in ZEMPLOY##, you can use value table SCARR for the foreign key definition.
a) Place the cursor on the Carrier field. Choose Goto → Foreign key.
b) Have the system make a proposal for the foreign key definition. Check the proposal. The following fields must be assigned:
Check table SCARR
CkTabFld |
For. key table |
For. key fld |
|
|
|
MANDT |
ZEMPLOY## |
Client |
|
|
|
CARRID |
ZEMPLOY## |
Airline |
|
|
|
c) Enter a short text and determine the semantic attributes as follows:
Field |
Value |
Type of foreign key fields |
Key fields / |
|
candidates |
|
|
Cardinality |
1:CN |
|
|
d) Save your foreign key.
3. Create the foreign key ZEMPLOY##-Department code as follows:
Continued on next page
2006/Q2 |
© 2007 SAP AG. All rights reserved. |
119 |
Unit 4: Input Checks |
BC430 |
Enter the value table ZDEPMENT## in the domain for the Department code field and activate the domain.
Note: To get a proposal for the foreign key definition, you must change the domain for the Department code field in ZEMPLOY##. This is not absolutely necessary for later foreign key definitions, but makes the definition easier.
a)First of all, place the cursor on the Department code field in ZEMPLOY##. Choose Goto → Foreign key.
Note: Since you are using the domain of
ZDEPMENT##-Department code field for the
ZEMPLOY##-Department code field, you can use value table
ZDEPMENT## for the foreign key definition.
b) Have the system make a proposal for the foreign key definition. Check the proposal. The following fields must be assigned:
Check table ZDEPMENT##
CkTabFld |
For. key table |
For. key fld |
|
|
|
MANDT |
ZEMPLOY## |
Client |
|
|
|
CARRID |
ZEMPLOY## |
Airline |
|
|
|
DEPARTMENT |
ZEMPLOY## |
Department code |
|
|
|
c) Enter a short text and determine the semantic attributes as follows:
Field |
Value |
Type of foreign key fields |
non-key-fields / |
|
candidates |
|
|
Cardinality |
1:CN |
|
|
d) Save your foreign key.
Continued on next page
120 |
© 2007 SAP AG. All rights reserved. |
2006/Q2 |
BC430 |
Lesson: Consistency Through Input Checks |
4.Create the foreign key ZEMPLOY##-Currency as follows:
Note: Since you are using domain S_CURR for field ZEMPLOY##-Currency, you can use value table SCURX for the foreign key definition.
a) Place the cursor on field ZEMPLOY##-Currency. Choose Goto → Foreign key.
b) Have the system make a proposal for the foreign key definition. Check
|
|
the proposal. The following fields must be assigned: |
||||
|
|
Check table SCURX |
|
|
||
|
|
|
|
|
|
|
|
|
CkTabFld |
|
For. key table |
For. key fld |
|
|
|
CURRKEY |
|
ZEMPLOY## |
Currency |
|
|
c) Enter a short text and determine the semantic attributes as follows: |
|||||
|
|
|
|
|
|
|
|
|
Field |
|
Value |
|
|
|
|
|
|
|||
|
|
Type of foreign key fields |
non-key-fields / |
|||
|
|
|
|
|
candidates |
|
|
|
|
|
|
|
|
|
|
Cardinality |
|
1:CN |
|
|
|
|
|
|
|
|
|
|
d) Save your foreign key. |
|
|
|
||
5. |
Create the foreign key ZDEPMENT##-Client as follows. |
|||||
|
a) See foreign key ZEMPLOY##-Client. |
|
||||
|
|
|
|
|
|
|
|
|
Field |
|
Value |
|
|
|
|
|
|
|||
|
|
Type of foreign key fields |
Key fields / |
|||
|
|
|
|
|
candidates |
|
|
|
|
|
|
|
|
|
|
Cardinality |
|
1:CN |
|
|
|
|
|
|
|||
6. |
Create the foreign key ZDEPMENT## Carrier as follows: |
|||||
|
a) See foreign key ZEMPLOY##-Carrier. |
|
||||
|
|
|
|
|
|
|
|
|
Field |
|
Value |
|
|
|
|
Type of foreign key fields |
Key fields / |
|||
|
|
|
|
|
candidates |
|
|
|
|
|
|
|
|
|
|
Cardinality |
|
1:CN |
|
|
|
|
|
|
|
|
|
Continued on next page
2006/Q2 |
© 2007 SAP AG. All rights reserved. |
121 |
Unit 4: Input Checks |
BC430 |
7.Create foreign key ZFLCREW##-Employee number.
a)Place the cursor on the Employee number field in ZFLCREW##. Choose Goto → Foreign key.
Note: The check table is the ZEMPLOY## table. If you have stored this as value table in the domain for the employee number, a corresponding proposal is created. If not, you have to enter it yourself.
b) Copy the system proposal for the field assignment.
c) Enter a short text and determine the semantic attributes as follows:
Field |
Value |
Type of foreign key fields |
Key fields / |
|
candidates |
|
|
Cardinality |
1:CN |
|
|
d) Save your foreign key.
8. Maintain the data for table ZEMPLOY## and test the effect of your foreign key relationships.
a) In the maintenance screen of the ZEMPLOY## table, select Utilities → Table Content → Create entries.
b) Enter data and check whether your foreign key functions correctly using the F4 help.
Task 3:
Some employees of airline carriers work in travel agencies in order to sell flights for their companies there. Enhance table ZEMPLOY## with a field that documents the travel agency where each employee works.
Enhance table ZEMPLOY## accordingly and define the foreign key relationship.
Hint: The table of all travel agencies is called STRAVELAG.
1.Create a new field Agency in your table ZEMPLOY##.
a)Navigate to the field maintenance screen for table ZEMPLOY##. Insert a new field Agency in the field list (select New rows).
Note: In the maintenance screen for table STRAVELAG you can see that the suitable data element is called S_AGNCYNUM.
Continued on next page
122 |
© 2007 SAP AG. All rights reserved. |
2006/Q2 |