Hi all,
I need to make a select statement and group by 3 given fields namely batch material and plant. Following is my statement and I am getting the error:
Error message:
The field "C~MAKTX" from the SELECT list is is missing in the GROUP BY
clause. missing in the GROUP BY clause. missing in the GROUP BY clause.
is missing in the GROUP BY clause. is missing in the GROUP BY clause.
is "C~MATNR".
Anyone knows whether group by can be used in inner join or have I put in wrongly?
SELECT a~charg
a~matnr
a~werks
a~menge
a~kdauf
a~shkzg
b~matkl
c~maktx
INTO CORRESPONDING FIELDS OF TABLE lt_product
FROM aufm AS a
INNER JOIN mara AS b
ON a~mandt = b~mandt
AND a~matnr = b~matnr
INNER JOIN makt AS c
ON b~mandt = c~mandt
AND b~matnr = c~matnr
WHERE a~charg IN s_batch
AND a~werks EQ p_plant
AND ( a~bwart = '101' OR a~bwart = '102' )
GROUP BY a~charg a~matnr a~werks.