cancel
Showing results for 
Search instead for 
Did you mean: 

Regarding internal table

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

former_member181995
Active Contributor
0 Kudos

>

> 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 .

Former Member
0 Kudos

Hi,

Thanks for your response in the same table i want to add goods recipeted by name also

can you please guide .

Former Member
0 Kudos

iam selecting goods reciepted by from ekbe ernam but if there are 2 names for the same purchase order

then i want to select the latest one,how can do that please guide

Answers (7)

Answers (7)

Former Member
0 Kudos

You can use the logic what Amit has suggested.

Regards

Sathar

Former Member
0 Kudos

Hi,

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

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

Thanks.

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi,

youcan do like this:

sort itab by ebeln ebelp,

delete adjacent duplicates from itab comparing ebelp

Former Member
0 Kudos

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

Former Member
0 Kudos

hi Prakash,

You can do it in 2 steps

sort itab by BEDAT BUDAT descending.

DELETE ADJACENT DUPLICATES FROM itab COMPARING EBELP

regards,

Anirban

Former Member
0 Kudos

Hi,

Delete like this...


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