Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
Showing results for 
Search instead for 
Did you mean: 

Delete adjacent duplicates

Former Member
0 Kudos

Hi Team ,

I have been strugguling with a typical issue .

Our Production system  has been migrated from Window to Unix ( Os 400 ) system , In one of the report the below code works differenctly .


  sort t_lqua by werks matnr.
    delete adjacent duplicates from t_lqua comparing all fields.

In one production system the T_tqua is a result of 142 records and other sytem it is giving 129 records there is a data loss of 13 records . Some one can please help me on how to solve this issue .


K.Vinay Kumar .


Former Member
0 Kudos

Hi Kumar,

For this you need analyze record by record only,

it is possible to tell after analysis only 

Active Contributor
0 Kudos

Are you sure  T_tqua contains the same data in both they systems before the delete statement?

Kindly debug and compare the contents of t_tqua in both the systems before the delete statement.There is probably a difference in format for some fields in both the systems.

0 Kudos

Dear Vinay,

I think data is different in both the production system.. please check it before sort and delete adjacent.

Many Thanks / Himanshu Gupta

0 Kudos

Hello Vinay Kumar,

you sort your table by only two fields and then delete adjacent duplicates comparing all fields.

Thus the final outcome depends on the sorting of your internal table before the first sort and is not guaranteed to always give the same result.

Former Member
0 Kudos


Please consider these 2 things:

1. Are you sure you have the exact same data in both system?

2. Normally you should sort and delete adjacent by the same fields.

0 Kudos

Hi Vinay,

Please check the following things:

1. You are giving the same selection screen parameters.

2. Put a breakpoint on the 'DELETE ADJACENT DUPLICATES' statement and check the internal table contents in debugger in both the scenarios.

3. Check the place where you populate this internal table. Check if different values are getting populated in the internal table.



0 Kudos

Hi Anupam ,

Thanks for your  response , we have values different at table level .

Looks like this is a migration issue .

K.Vinay Kumar

0 Kudos

Hi Vinay,

Also there might be a possibility that after migration some transactions have been processed due to which there might be some additional entries inserted in the table.