Application Development and Automation 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: 
Read only

need help with join

Former Member
0 Likes
627

Extract each entry from BSEG for BELNRs in BKPF-BELNR,

and KOSTL in ZTABLE-KOSTL.

sum(DMBTR) by KOSTL into

internal tab <ITAB (fields KOSTL, DMBTR)>.

i wrote the code like this:

Select sum( aDMBTR ) aKOSTL into inkostltotal from BSEG as a

inner join BKPF as b on bBELNR = aBELNR

inner join Ztable as c on c~KOSTL = a-KOSTL

group by a~KOSTL.

it was giving error:

You cannot use comparisons with column column references in pool and

cluster tables: "A~BELNR". column references in pool and cluster

tables: "A~BELNR". column references in pool and cluster tables:

"ABELNR". column tables: "ABELNR".

i need to use select, sum, group by to solve this can some one

help me with this.

5 REPLIES 5
Read only

Former Member
0 Likes
578

Hi,

You can not use Inner Join on cluster tables. You need to find an alternate table or retrieve the records from cluster table into internal table and use FOR ALL ENTRIES clause in select query.

Regards,

Ferry Lianto

Read only

0 Likes
578

try otherwise left outer join instead of inner join

Read only

Former Member
0 Likes
578

Hi Saritha,

You cannot use JOIN statement for a cluster table (BSEG).

Try to extract the entries from BKPF into an internal table (say i_bkpf), and form another SELECT statement for BSEG using entries in i_bkpf with FOR ALL ENTRIES IN.

Hope it helps.

Regards,

Patrick

Read only

Former Member
0 Likes
578

hi saritha,

y ur not using for all entries, that will best in this situation.

use for all entries like that

CLEAR : T_EQUZ,T_EQUZ[].

SELECT * FROM EQUZ INTO TABLE T_EQUZ

WHERE DATBI = '99991231'.

IF NOT T_EQUZ[] IS INITIAL.

select J_3GBELNRI equnr J_3GEMPFAE into

corresponding fields of table

T_J_3GBELP from J_3GBELP

FOR ALL ENTRIES IN T_EQUZ

where j_3guposnr ne '1'

and J_3GEMPFAE in Reciver

and equnr = T_EQUZ-EQUNR.

regards

vijay dwivedi

rewards if usefull

Read only

Former Member
0 Likes
578

Can you please talk to your FI specialist? It looks like you are being asked to get data from the wrong place - it should come from the CO (Controlling module), see tables COBK, COEP.

BSEG is a very big table, you cannot add indexes to it because it is a Cluster table, so trying to SELECT on a non key field like KOSTL should not be done.