2007 Feb 01 3:21 AM
I want to retrieve a list of non-duplicate record from table BSEG so i code as below:
DATA: BEGIN OF it_bseg OCCURS 0,
belnr LIKE BSEG-BELNR,
vbund LIKE BSEG-VBUND,
END OF it_bseg.
SELECT DISTINCT BELNR VBUND
APPENDING CORRESPONDING FIELDS OF TABLE it_bseg
FROM BSEG
WHERE KUNNR <> '' OR KUNNR IS NOT NULL
ORDER BY BELNR.
But when i Check the code, it give me an error as below:
" Aggregate functions and the addition DISTINCT are not supported in field lists for pooled and clustered table. "
If i change the code to SELECT DISTINCT * then there is no error.
Why this error happen?
Thank you.
2007 Feb 01 3:35 AM
Aaron,
First i would like to know why did you used
APPENDING statement here when there is no ENDSELECT.
Use like below
SELECT DISTINCT BELNR VBUND
into CORESPONDING FIELDS OF TABLE it_bseg
FROM BSEG
WHERE KUNNR <> '' OR KUNNR IS NOT NULL
ORDER BY BELNR.
Now it will work
Pls reward if useful
in se11 give the name of the table go to display mode it will show you whether it is transp table/cluster/pool table just check before the table name display text will be there.
regards
shiba dutta
2007 Feb 01 3:34 AM
as bseg is a cluster table so only you can use distinct * or count( * ) aggregate fn in select clause.
regards
shiba dutta
2007 Feb 01 3:35 AM
Aaron,
First i would like to know why did you used
APPENDING statement here when there is no ENDSELECT.
Use like below
SELECT DISTINCT BELNR VBUND
into CORESPONDING FIELDS OF TABLE it_bseg
FROM BSEG
WHERE KUNNR <> '' OR KUNNR IS NOT NULL
ORDER BY BELNR.
Now it will work
Pls reward if useful
2007 Feb 02 1:20 AM
Hi muralikrishna kaipha,
I have tried on your code but it still give me the same error.
How can I check that whether a table is pooled/clustered table or not?
Thankz.
2007 Feb 02 3:19 AM
in se11 give the name of the table go to display mode it will show you whether it is transp table/cluster/pool table just check before the table name display text will be there.
regards
shiba dutta
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |