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

Regarding internal table

Row EBELN UDATE USERNAME EBELP NETWR EKGRP ERNAM GRNAM BEDAT BUDAT DMBTR

1 4500016284 20081111 INDIRAS 10 675 A26 INDIRAS INDIRAS 20081111 20081111 30

2 4500016284 20081111 POTEST 10 675 A26 INDIRAS INDIRAS 20081111 20081111 30

3 4500016284 20081111 INDIRAS 20 675 A26 INDIRAS INDIRAS 20081111 20081111 40

4 4500016284 20081111 POTEST 20 675 A26 INDIRAS INDIRAS 20081111 20081111 40

5 4500016285 20081111 INDIRAS 10 200 A26 POTEST INDIRAS 20081111 20081111 100

6 4500016286 20081111 INDIRAS 10 2160 A26 POTEST INDIRAS 20081111 20081111 280

iam having the following data in the final internal table

i want to delete ebelp(lineietm) for the same ebeln if it's repeating more than once

and keep the latest ebelp only among the repeated ones.i can add time also in the same tabel if needed.

please guide.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    Posted on Nov 12, 2008 at 04:37 AM

    >

    > i want to delete ebelp(lineietm) for the same ebeln if it's repeating more than once

    >

    > and keep the latest ebelp only among the repeated ones

    Yes,you need to take time field in internal table than sort decending accordind to EBELN EBELP TIME and delete adjecent duplicate comparing EBELN EBELP .your old entry would be deleted.

    Sampl code:

    SORT itab BY ebeln ebelp time decending.
    DELETE ADJACENT DUPLICATES FROM itab COMPARING ebeln ebelp .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2008 at 04:35 AM

    Hi,

    Delete like this...

    SORT itab BY ebeln ebelp.
    DELETE ADJACENT DUPLICATES FROM itab COMPARING ebeln ebelp.
    

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2008 at 04:35 AM

    hi Prakash,

    You can do it in 2 steps

    sort itab by BEDAT BUDAT descending.

    DELETE ADJACENT DUPLICATES FROM itab COMPARING EBELP

    regards,

    Anirban

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2008 at 04:37 AM

    DELETE ADJACENT DUPLICATES FROM itab comparing field1(vbeln) field2 (posnr) .

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2008 at 04:41 AM

    Hi,

    youcan do like this:

    sort itab by ebeln ebelp,

    delete adjacent duplicates from itab comparing ebelp

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2008 at 04:49 AM

    U add another field timestamp to the internal table.

    while populating the internal table...populate that too...

    SORT itab by ebeln ebelp timestamp descending.

    DELETE ADJACENT DUPLICATES FROM itab COMPARING ebeln ebelp.

    Regards,

    SAPient

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2008 at 05:08 AM

    Hi,

    After populating the internal table; sort it with EBELN and EBELP.

    Then use Delete Adjacent Duplicates comapring the same fields as above.

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 12, 2008 at 05:12 AM

    You can use the logic what Amit has suggested.

    Regards

    Sathar

    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.