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

Regarding internal table sorting

Former Member
0 Likes
336

Hi Experts,

In a report program, i am sorting an itab say itab1 with 5 fields like a, b, c, d and e as follow-

SORT itab with a b c d e.

Then i am deleting adjacent duplicates from itab like this ..

DELETE ADJACENT DUPLICATES FROM itab COMPARING a b c d.

after that am reading itab using first 2 , 3rd and 4th field

READ TABLE itab with key a = v1

b = v2

d = v3

e= v4

BINARY SEARCH.

Can anybody let me know whether i will get correct record from this search.

Thanks in adv,

Akash

2 REPLIES 2
Read only

Former Member
0 Likes
321

Hi,

It will give you the result, but one thing to be noted is if you are sorting the itab by 5 fields and deleting the records from itab by comparing 4 fields is not good.

It should be always like the fields what you are sorted and deleting should based on those fields only.

Ex:


sort itab by f1 f2 f3 f4 f5.

delete adjacent duplicates from itab comparing f1 f2 f3 f4 f5.

Thanks,

Sriram Ponna.

Read only

Former Member
0 Likes
321

Hi,

Yes you will get the correct records.