Application Development and Automation 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: 
Read only

How will a collect statement work without primary key definitions?

digantogos
Participant
0 Likes
3,294

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
Read only

Sandra_Rossi
Active Contributor
1,780

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.

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

2 REPLIES 2
Read only

Sandra_Rossi
Active Contributor
1,781

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.

Read only

0 Likes
1,780

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

Regards

Diganto