2025 Mar 02 2:07 PM - edited 2025 Mar 02 2:07 PM
Hello,
Is there an error in the ABAP Keyword Documentation here about Table Type Keys, concerning the double use of "This addition expresses the default behavior in table types with a generic primary key":
I think that "WITHOUT further secondary keys" is the default for "complete primary key", not "generic", while a generic table type implies by default "WITH further secondary keys".
I did the test with the following program (which compiles):
REPORT.
" itab_1sk is compatible with TT_G (generic) but not with TT_C (complete).
"
" itab_0sk is compatible with both TT_G and TT_C.
"
" So, a generic type is by default WITH FURTHER SECONDARY KEYS,
" and a complete type is by default WITHOUT FURTHER SECONDARY KEYS.
" With one secondary key
DATA itab_1sk TYPE STANDARD TABLE OF bapireturn WITH DEFAULT KEY WITH NON-UNIQUE SORTED KEY by_type COMPONENTS type.
" With zero secondary key
DATA itab_0sk TYPE STANDARD TABLE OF bapireturn WITH DEFAULT KEY.
" Generic
TYPES tt_g TYPE STANDARD TABLE OF bapireturn.
" Complete
TYPES tt_c TYPE STANDARD TABLE OF bapireturn WITH DEFAULT KEY.
PERFORM sr_g USING itab_0sk.
PERFORM sr_g USING itab_1sk.
PERFORM sr_c USING itab_0sk. " wouldn't compile with itab_1sk
FORM sr_g USING itab TYPE tt_g.
ENDFORM.
FORM sr_c USING itab TYPE tt_c.
ENDFORM.
Request clarification before answering.
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 6 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.