cancel
Showing results for 
Search instead for 
Did you mean: 

How to remove value for Duplicate record

former_member596753
Participant
0 Kudos

Dear All,

I am having following scenario.

I

INVOICE NUMBERitem
DeliverynumberDelivery value
5000110DEL1000150
5000220DEL1000150
5000310DEL1000150

i want to delete the value for "Delivery Value" on the basis of Delivery number which is repeating and not entire row.How can i routine for same.

Accepted Solutions (0)

Answers (5)

Answers (5)

ccc_ccc
Active Contributor
0 Kudos

Hi Tushar,

If I understand your issue correctly

As is

INVOICE NUMBERitem
DeliverynumberDelivery value
5000110DEL1000150
5000220DEL1000150
5000310DEL10001

50

To be

INVOICE NUMBERitem
DeliverynumberDelivery value
5000110DEL1000150
5000220DEL10001
5000310DEL10001

The problem your facing at present , you may be using Delivery number either report or another

while using delivery number it repeating three times here because of 10,20 and 10  items based on this "Delivery value" aggregating 150 which is wrong your expecting delivery value 50.

For goto maintenance of delivery value key figure->Aggregation Tab-->Exception Aggregation--> first value  and

Reference char of exp aggre "Delivery number"

in report it will only 50 instead of 150.

And if you want do with code , here is code.

Data wa_dn type data element of delivery number.

loop at source_package assigning <source_fields>.

if sy-tabix eq 1.

clear : wa_dn.

wa_dn = <source_fields>-delivery_num.

endif.

if sy-tabix gt 1.

if wa_dn = <source_fields>-delivery_num.

<source_fields>-delivery value = 0.

else.

clear : wa_dn.

wa_dn = <source_fields>-delivery_num.

endif


endif.

endloop.

Thank you,

Nanda

Loed
Active Contributor
0 Kudos

Hi,

Can you show your DESIRED OUTPUT for your example above?

Regards,

Loed

KodandaPani_KV
Active Contributor
0 Kudos

Hi,

sort the internal table,

SORT lt_test

      DELETE ADJACENT DUPLICATES FROM <lt_test>

      COMPARING <delivary number>.

Thanks,

Phani.

Former Member
0 Kudos

Good ...

former_member184884
Active Participant
0 Kudos

Hi Tushar,

I think you can achieve this by writing delete statement in end routine level. I am just giving hint here, based on your requirement do necessary declaration part.

Delete adjacent duplicates from <itab>  comparing < Delivery number>.

Thanks & Regards,

Harish

Former Member
0 Kudos

Hi

If you want to achieve this at report level , create a customer exit variable on Delivery Number and delete the unwanted/duplicate record in exit. Do not make this variable input ready and include this in your report design .