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: 

Collect statement

Former Member
0 Kudos

What is the purpose of collect statement?

8 REPLIES 8

Former Member
0 Kudos

The collect statement is used to fill an internal table with data by summarizing the entries based on ket data.

COLLECT <work area> into <internal table>

The contents of the work area are inserted into the internal table by appending the entry to the end of the table if a row doesnot already exist with the same key data.

If the row does exist with the same key data then the numeric fields from the work area are added to the row in the internal table.

Thanks & Best Regards,

Shakti Barath

Former Member
0 Kudos

hai ,

COLLECT is used to create unique or compressed datsets. The key fields are the default key fields of the internal table itab .

If you use only COLLECT to fill an internal table, COLLECT makes sure that the internal table does not contain two entries with the same default key fields.

If you specify wa INTO , the entry to be processed is taken from the explicitly specified work area wa . If not, it comes from the header line of the internal table itab .

After COLLECT , the system field SY-TABIX contains the index of the - existing or new - table entry with default key fields which match those of the entry to be processed.

COLLECT can create unique or compressed datasets and should be used precisely for this purpose. If uniqueness or compression are unimportant, or two values with identical default key field values could not possibly occur in your particular task, you should use APPEND instead. However, for a unique or compressed dataset which is also efficient, COLLECT is the statement to use.

If you process a table with COLLECT , you should also use COLLECT to fill it. Only by doing this can you guarantee that the internal table will actually be unique or compressed, as described above and COLLECT will run very efficiently.

If you use COLLECT with an explicitly specified work area, it must be compatible with the line type of the internal table.

regards

chinnaiya

0 Kudos

Hi chinnaiya,

First of all, I would not bother answering such questions...

2nd, if you look closely the first answer came within 2 minutes of the question. This is near to impossible for a real answer typed out by a different person.

So it is the same person... cheating the ponits system. Or better said, trying to ...

Their user ID's will all be deleted.

Merry Christmas,

Julius

matt
Active Contributor
0 Kudos

And I only started investigating to tell both of him to use a more informative subject in future...

0 Kudos

Julius is definately the best points-gamer hunter here, most of the times he's able catch these kind of point gamers pretty quickly.

But I hope that any innocent person doesnot come in the firing line ever.

All the best to the moderators, continue ur good work.

Merry Christmas and Happy new year to all SDN'rs

кu03B1ятu03B9к.

0 Kudos

The best moderators of all are the attentative contributors who see what is going on and report it to us to take a closer look into and as required take action...

I try to watch the forums, but the cummulative power of the folks who use the abuse reports is much more accurate and faster.

Once a point game as been confirmed via various analysis tools which we have, I often give a little "signal" to the person who reported it, and others who watch for them.

I imagine that the points gamers might be sad to loose all their dishonestly earned points, but probably more glad to be guestified ASAP to enjoy the relief of being anonymous. Pfewww....

This was the case here as well --> the abuse reports started singing:

>Dashing through the forums

>In a one person point game

>O'er the rules we go

>Laughing all the way

>10's within seconds ring

>Making spirits bright

>What fun it is to grin a while

>A sleeping forum tonight

>

>Oh, cheating points, cheating points

>Cheating all the way

>Oh, what fun it is to lie

>In a one person point game

>Cheating points, cheating points

>Cheating all the way

>Oh, what fun it is to lie

>In a one person point game

>

>A minute or two ago

>I thought I'd take a cheat

>And soon Miss Foolish Guest

>Was located by my quest

>The cheat was lean and lank

>Misfortune seemed my lot

>We got into an abuse report

>And then we got whacked.

>

>Oh, cheating points, cheating points

>Cheating all the way

>Oh, what fun it is to lie

>In a one person point game

>Cheating points, cheating points

>Cheating all the way

>Oh, what fun it is to lie

>In a one person point game

Merry Christmas,

Julius

former_member181995
Active Contributor
0 Kudos

Mate,

You Landed on a wrong Forum.Who Kicked out you from ERP HCM (HR)?

Rest in Peace Gentleman.

Amit;

Former Member
0 Kudos

Hi,

Collect statement used for aggregate the numeric field. Like

A = 100

B = 100

A = 200

C = 300

After Collect statement the result should like this:

A = 300

B = 100

C = 300.

Regds,

Rakesh