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.
cancel
Showing results for 
Search instead for 
Did you mean: 

Delete adjacent duplicates

Former Member
0 Kudos
143


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 .

Regards,

K.Vinay Kumar .

8 REPLIES 8

Former Member
0 Kudos
81

Hi Kumar,

For this you need analyze record by record only,

it is possible to tell after analysis only 

former_member184569
Active Contributor
0 Kudos
81

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.


himanshu_gupta13
Employee
Employee
0 Kudos
81

Dear Vinay,

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

Many Thanks / Himanshu Gupta

stefan_schmcker
Explorer
0 Kudos
81

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
81

Hello,

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.

anupam_anand
Participant
0 Kudos
81

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.

Thanks,

Anupam

0 Kudos
81

Hi Anupam ,

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

Looks like this is a migration issue .

Regards,
K.Vinay Kumar

0 Kudos
81

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.

Regards,

Ramiz