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: 

using aggregate function count

Former Member
0 Kudos

hi experts,

I want to select 2 fields from a table and put into structure (gw_konzs.) and with respect to that i want to use aggregate function count(*) for knowing how many rows has been selected ? and i dont want to use select & endselect

please help regarding this ...........

for example:

select konts ltext from ztab into corresponding fields of gw_konzs.

select count(*) from kna1 into gw_konzs

where konzs = gw_konzs-konzs.

append gw_konzs to gt_konzs

endselect.

4 REPLIES 4

Former Member
0 Kudos

hi experts,

I want to select 2 fields from a table and put into structure and i want to select based on the where condition i dont want to use select & endselect

please help regarding this ...........

rewarded if useful

for example:

gw_detail & gw_konzs is structure

gt_detail & gt_konzsis internal table

select kunnr name1 from kna1 into corresponding fields of gw_detail where konzs = gw_konzs-konzs.

gw_detail-konzs = gw_konzs-konzs.

append gw_detail-konzs to gt_detail-konzs

endselect.

0 Kudos

Your code doesn't link together, but you need something like

select konzs count(*)

into l_it_mytable

from kna1

group by konzs

0 Kudos

it is not working fine............ and i dont want to use select.......endselect but when i check for syntax it is showing error for not using endselect.............what to do?

0 Kudos

I want to select gruop key(konzs) field from ztable then i want to know how many customers are there with respect to gruop key(konzs) field and how many vendors are for that group key ..iam using aggregate function count(*) but i dont want to use inside select..endselect

sample output should be:

grp key customer vendor

-


abc 1 4