2023 Jun 20 8:40 AM
Hi Experts,
Duplicate entries displaying in the following query result in AMDP class. But when I checked data with the SE16N no duplicate entries were found. I have used the proxy object MBV_MBEW. I need to get Material Valuation. data duplicating with 0 entry with salk3, lbkum.
it_mbv_mbew = select distinct matnr, bwkey, salk3, lbkum
from MBV_MBEW;
2023 Jun 20 9:10 AM
2023 Jun 20 9:35 AM
DISTINCT can't return duplicate values.
It's probably what comes next which make you SEE (i.e. apparently) that there are duplicates.
Please clarify.
2023 Jun 20 9:48 AM
You don't provide the full key, so there are multiple records if you use split valuation.
You could try (The 3 first fields will remove duplicates and the where clause remove the total records in case of split valuation)
it_mbv_mbew = select matnr, bwkey, bwtar, salk3, lbkum
from MBV_MBEW where bwtty = space OR bwtar <> space ;
or use some aggregation. What was the original requirement?
2023 Jun 20 10:05 AM
Thank you all.
Problem solved by adding where condition mandt = SESSION_CONTEXT('CLIENT'). Thank you again xiaosanyu
it_mbv_mbew = select distinct matnr, bwkey, salk3, lbkum
from MBV_MBEW
where mandt = SESSION_CONTEXT('CLIENT');
2023 Jun 20 10:05 AM
Problem solved by adding where condition mandt = SESSION_CONTEXT('CLIENT'). Thank you xiaosanyu