on 05-31-2015 6:20 AM
Dear All,
I am having following scenario.
I
INVOICE NUMBER | item | Deliverynumber | Delivery value |
---|---|---|---|
50001 | 10 | DEL10001 | 50 |
50002 | 20 | DEL10001 | 50 |
50003 | 10 | DEL10001 | 50 |
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.
Hi Tushar,
If I understand your issue correctly
As is
INVOICE NUMBER | item | Deliverynumber | Delivery value |
---|---|---|---|
50001 | 10 | DEL10001 | 50 |
50002 | 20 | DEL10001 | 50 |
50003 | 10 | DEL10001 | 50 |
To be
INVOICE NUMBER | item | Deliverynumber | Delivery value |
---|---|---|---|
50001 | 10 | DEL10001 | 50 |
50002 | 20 | DEL10001 | |
50003 | 10 | DEL10001 |
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Can you show your DESIRED OUTPUT for your example above?
Regards,
Loed
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
sort the internal table,
SORT lt_test
DELETE ADJACENT DUPLICATES FROM <lt_test>
COMPARING <delivary number>.
Thanks,
Phani.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 .
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.