cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Which one of "WITH or WITHOUT" FURTHER SECOND KEYS is the default for complete Table Types?

Sandra_Rossi
Active Contributor
0 Likes
254

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":

Sandra_Rossi_0-1740923876788.png

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.

 

 

Accepted Solutions (0)

Answers (0)