‎2007 Jun 01 3:08 PM
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.
‎2007 Jun 01 3:12 PM
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
‎2007 Jun 01 3:14 PM
‎2007 Jun 01 3:23 PM
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
‎2007 Jun 01 3:23 PM
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
‎2007 Jun 01 3:52 PM
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.