2006 Jan 20 5:58 PM
Hi all,
Can somebody tell me, if it is possible to create an internal table with a key-column?
I think it is, but I do not know how? So, How can I make it? Does this keys work exactly like DB table keys?
Thanks,
MPM
2006 Jan 20 6:10 PM
Hi all,
Can somebody tell me, if it is possible to create an internal table with a key-column?
I think it is, but I do not know how? So, How can I make it? Does this keys work exactly like DB table keys?
Thanks,
MPM
2006 Jan 20 6:10 PM
2006 Jan 20 6:15 PM
Why do you want such an internal table? It is in your control all the time, so can you not simply implement the logic to work like a database table with keys?
Here is one example from SAP help
TYPES: BEGIN OF STRUC,
NAME(10) TYPE C,
AGE TYPE I,
END OF STRUC.
TYPES: TAB1 TYPE STANDARD TABLE OF STRUC WITH DEFAULT KEY,
TAB2 TYPE SORTED TABLE OF STRUC
WITH NON-UNIQUE KEY NAME,
TAB3 TYPE HASHED TABLE OF STRUC WITH UNIQUE KEY NAME.
As you can see, you can only have unique key for hashed and sorted tables not for standard tables.
Srinivas
2006 Jan 21 12:25 AM
I'm not sure if it is correct that sorted tables can only have unique keys.
The table keys are important for access:
1. Every table with character fields have got a key by (SAP) definition. An unsorted standard table's key consists of all non-numeric fields. In this case the access will be sequential except for a binary search.
2. Sorted tables may have one unique or non-unique key consisting odf one or more fields. If the key is not unique, the entry with the lowest index is accessed.
3. Only Hash tables require a unique key
4. Only one key per internal table is allowed (no secondary keys as in other programming languages or database definitions).
5. See also:
http://help.sap.com/saphelp_47x200/helpdata/en/90/8d7325b1af11d194f600a0c929b3c3/frameset.htm
regards,
Clemens
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |