Skip to Content

Does FAE will take care DELETE ADJACENT DUPLICATES?

Hello

I saw the below statement in a blog (not sure about its reliability), i want to double check with experts,

"FOR ALL ENTRIES statement will implicitly take care of the DELETE ADJACENT DUPLICATES from the driver itab", pls. let me know is it true?

If so, on what basis the FAE will SORT the driver itab, say , i have an itab as below,

DATA: BEGIN OF it_vbap,

vbeln TYPE vbeln_va,

posnr TYPE posnr,

matnrTYPE matnr,

ntgew TYPE ntgew_ap,

END OF it_vbap.

I wan to get Material descriptions of all the MATNRs in the above said itab, so, i dont need to SORT BY matnr and then, DELETE ADJACENT DUPLICATES COMPARING matnr?

Thank you

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jun 05, 2012 at 01:41 PM

    This comes from SAP Abap documentation - read FOR ALL ENTRIES WHERE

    With duplicated rows in the resulting set, the addition FOR ALL ENTRIES has the same effect as if addition DISTINCT were specified in the definition of the selection quantity. Unlike DISTINCT, the rows are not deleted from the database system but are deleted on the application server from the resulting set.

    There is no mention of "adjacent records" in this. In your sample a SELECT FROM MAKT FOR ALL ENTRIES will result in only one record per materiam number. But Open SQL will not always compress the "key list" before executing statement and reading database, read the same record multiple times and collect the whole result before passing data to caller program, so you could compress an internal table of keys for performance, giving the same result set.

    Answer : So you don't need but you can/should.

    Regards,

    Raymond

    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.