Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Select - Group by

Former Member
0 Kudos

Hello ABAPers,

Im quite confuse in using the <b>group by</b> syntax in Select.. Here is my code, kindly correct what is the problem with this with error msg "The group by addition is not valid for pool or cluster tables".

SELECT bukrs

belnr

gjahr

augcp

bschl

wrbtr

pswsl

sgtxt

hkont

kunnr

FROM bseg

INTO TABLE it_bseg

WHERE bukrs EQ p_bukrs

AND augcp EQ p_augcp

GROUP BY hkont.

Please help..Thanks in advance

aVaDuDz

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Use select statement without group by.After that inside loop try using at new hkont.

4 REPLIES 4

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

SInce BSEG is cluster table,you cannot use group by.

Former Member
0 Kudos

HI Jayanthi,

Is there any other tables that I can use to get the following fields?

bukrs belnr gjahr augcp bschl wrbtr pswsl sgtxt hkont kunnr.

Do you have any suggestion how to group by a data in smartforms?

thats why i used groupby in select ...i just think its the solution.

Here is the sample output

currency : USD Bank : HBO

Entry No Document # Customer

1 11188000 Jack Dawson

Please Help

Thanks in advance

aVaDuDz

former_member194669
Active Contributor
0 Kudos

Hi,

check for secondary index tables of BSEG ie BSIS, BSAS, BSID ......

aRs

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Use select statement without group by.After that inside loop try using at new hkont.