Hello,
I have the following entries in MARC (example)
Material | Plant | Profit Center |
---|---|---|
123456 | US | 500000 |
123456 | MX | 500000 |
123456 | TJ | 600000 |
123456 | AU | 500000 |
123456 | FR | 500000 |
7890 | US | 600000 |
7890 | MX | 600000 |
7890 | AU | 500000 |
7890 | FR | 600000 |
I would like to do something like the following:
SELECT DISTINCT on material number with the MAXIMUM number of profit centers
So I would end up with the following entries in my internal table:
123456 500000
7890 600000
Unfortunately, I cannot restrict based on plant because there isn't one plant that all Materials exist in.
I understand I can select all records and delete duplicates but this does not guarantee that I will get the profit center which appears the most.
Thank you!