Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

help with group by

hi

i wont to use group by but i have eroor waht i doing wrong?

SELECT pernr perid orgeh

FROM /bic/azps_ods600

INTO CORRESPONDING FIELDS OF TABLE b_tab

WHERE /bic/zps_wbs_d = project

GROUP BY orgeh.

regards

Tags:
Former Member
replied

Hi,

Let's say you have 3 fields in custom database table:

MATNR, WERKS, KMENG.

and the values are:

100, 1000, 50.00

100, 1001, 80.00

100, 1001, 60.00

101, 1005, 100.00.

Now you can use group by to get the average of quantities (MENGE) for a given material and plant.

select MATNR WERKS AVG (MENGE)
into ITAB
from ZTABLE
group by MATNR WERKS.

Now the ITAB contents are :

100, 1000, 50.00

100, 1001, 70.00

101, 1005, 100.00

Regards,

Ferry Lianto

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question