Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How will a collect statement work without primary key definitions?

digantogos
Participant
0 Kudos

Hii

Internal table has no primary keys in its declaration, but has one numeric, few currency fields and some char type field in it. A collect statement is called.

I would like to know whether this will aggregate columns per data type or wrt which fields would there be an aggregation.

Regards

Diganto

1 ACCEPTED SOLUTION

Sandra_Rossi
Active Contributor

It's all explained in the ABAP documentation of COLLECT:

You didn't say, but I guess your internal table is standard, isn't it ? If so, if you have declared it with TYPE TABLE OF and without mention of WITH ... KEY, then it's using WITH NON-UNIQUE DEFAULT KEY (cf ABAP documentation of DATA - key). Refer to the documentation to know how SAP determines which fields are part of the default key.

2 REPLIES 2

Sandra_Rossi
Active Contributor

It's all explained in the ABAP documentation of COLLECT:

You didn't say, but I guess your internal table is standard, isn't it ? If so, if you have declared it with TYPE TABLE OF and without mention of WITH ... KEY, then it's using WITH NON-UNIQUE DEFAULT KEY (cf ABAP documentation of DATA - key). Refer to the documentation to know how SAP determines which fields are part of the default key.

0 Kudos

Well i would have to test on it whatever I had understood. Thanks for sharing the info.

Regards

Diganto