Skip to Content
author's profile photo Former Member
Former Member

Collect statement

What is the purpose of collect statement?

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Dec 21, 2008 at 08:14 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 21, 2008 at 09:13 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      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

  • Posted on Dec 21, 2008 at 03:42 PM

    Mate,

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

    Rest in Peace Gentleman.

    Amit;

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Dec 21, 2008 at 04:14 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.