2010 Dec 06 7:39 AM
Dear All,
Will anyone pls. tell me what is the problem in this query, it is not working.
SELECT aufnr SUM( menge )
INTO CORRESPONDING FIELDS OF TABLE itab_aufnr
FROM mkpf
INNER JOIN mseg ON msegmblnr EQ mkpfmblnr AND mkpfmjahr EQ msegmjahr
FOR ALL ENTRIES IN itab_rework
WHERE mseg~aufnr = itab_rework-aufnr
GROUP BY aufnr.
Regards,
Moderator message: please search for available information before asking, "it's not working" is not a proper error description.
Edited by: Thomas Zloch on Dec 6, 2010 9:41 AM
2010 Dec 06 7:45 AM
Your syntax check will clearly explain the problem. Aggregate functions are not allowed with for all entries.
Please check yourself before posting because the syntax message itself explains thats.
2010 Dec 06 7:53 AM
It's means that I cannot use aggregate functions with for all entries, but I want to take the sum() on the basis of aufnr. When I have used it in loop it is taking so much time to execute.
How I should solve this problem.
Thanks.
2010 Dec 06 7:59 AM
When I have used it in loop it is taking so much time to execute.
That depends upon the amount of data you are processing and the set of codes written inside the loop. For sum you have to use collect statement or a SUM statement inside a control break statement.