Application Development and Automation 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: 
Read only

filter in internal table

Former Member
0 Likes
604

hi,

in the below table

EBELN UDATE UTIME USERNAME EBELP ERNAM GRNAM CHANGEDBY

4500016284 20081113 132504 SIVAK 10 INDIRAS SIVAK

4500016284 20081113 145020 SIVAK 10 INDIRAS SIVAK

4500016284 20081111 104220 POTEST 10 INDIRAS SIVAK

4500016284 20081111 104756 INDIRAS 10 INDIRAS SIVAK

4500016284 20081113 132504 SIVAK 20 INDIRAS INDIRAS

4500016284 20081113 145020 SIVAK 20 INDIRAS INDIRAS SIVAK

4500016284 20081111 104220 POTEST 20 INDIRAS INDIRAS SIVAK

4500016284 20081111 104756 INDIRAS 20 INDIRAS INDIRAS

4500016284 20081113 132504 SIVAK 10 INDIRAS SIVAK

4500016284 20081113 145020 SIVAK 10 INDIRAS SIVAK POTEST

4500016284 20081111 104220 POTEST 10 INDIRAS SIVAK POTEST

4500016284 20081111 104756 INDIRAS 10 INDIRAS SIVAK POTEST

4500016285 20081113 144549 SIVAK 10 POTEST INDIRAS

4500016285 20081111 104608 INDIRAS 10 POTEST INDIRAS

4500016286 20081113 143824 SIVAK 10 POTEST SIVAK SIVAK

4500016286 20081111 111303 INDIRAS 10 POTEST SIVAK SIVAK

4500016286 20081113 143824 SIVAK 10 POTEST SIVAK SIVAK

4500016286 20081111 111303 INDIRAS 10 POTEST SIVAK

4500016287 20081115 214509 POTEST 10 POTEST INDIRAS SIVAK

4500016287 20081115 214146 INDIRAS 10 POTEST INDIRAS SIVAK

in this table i want unique lineitems for the corresponding order

but the latest changed by name should be displayed for this unique record and

if the changed by field is no present then it should show the latest unique line item

please suggest the needful.

Thnaks in advance

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
580

your question:

in this table i want unique lineitems for the corresponding order

but the latest changed by name should be displayed for this unique record and

if the changed by field is no present then it should show the latest unique line item

please suggest the needful.

answer:

what ever may be the value for changed by name you need unique lineitems (right)

1. sort itab by

EBELN

UDATE descending

UTIME descending

2. delete adjacent duplicates from itab comparing ebeln

6 REPLIES 6
Read only

GauthamV
Active Contributor
0 Likes
580

hi,

First sort your internal table descending based on changed date and time and

then use this statement.

delete adjacent duplicates from itab comparing ebeln.

Read only

naveen_inuganti2
Active Contributor
0 Likes
580

HI.,

Initially I can suggest you one thing make utility of SORT ITAB BY <field name>

Thanks,

Naveen.I

Read only

Former Member
0 Likes
580

Hi,


sort itab DESCENDING.

delete ADJACENT DUPLICATES FROM itab 
            COMPARING  ebeln utime.

Regards

Debarshi

Read only

Former Member
0 Likes
580

Hi,

You can do as below:



sort itab by EBELN UDATE descending.

delete adjacent duplicates from itab comparing ebeln.

Thanks,

Sriram POnna.

Read only

Former Member
0 Likes
581

your question:

in this table i want unique lineitems for the corresponding order

but the latest changed by name should be displayed for this unique record and

if the changed by field is no present then it should show the latest unique line item

please suggest the needful.

answer:

what ever may be the value for changed by name you need unique lineitems (right)

1. sort itab by

EBELN

UDATE descending

UTIME descending

2. delete adjacent duplicates from itab comparing ebeln

Read only

Former Member
0 Likes
580

Hello Prakash,

First you sort the table on ( EBELN UDATE UTIME ) these combination and finally used this statement

DELETE ADJACENT DUPLICATES FROM itab COMPARING ebeln utime and mould the itab as per requirement.

Mahesh