2007 Feb 23 9:56 AM
hi
i have to use 3 tables from FICO Modules
pa0006, bseg and bkpf.
but bseg is a cluster table.
i want to fetch data from 3 tables but bseg table is giving error while running prog as it is a cluster table.
my question is how to fetch data from cluster table through select query.
thanx
rocky
hi
i have to use 3 tables from FICO Modules
pa0006, bseg and bkpf.
but bseg is a cluster table.
i want to fetch data from 3 tables but bseg table is giving error while running prog as it is a cluster table.
my question is how to fetch data from cluster table through select query.
thanx
rocky
2007 Feb 23 10:00 AM
hi Rocky ...
here is a sample code ..
**Subroutine to get BSIS data(G/L Accounts)
PERFORM GET_BSIS_DATA.
**Subroutine to get BSAS data(G/L Accounts (Cleared Item)
PERFORM GET_BSAS_DATA.
* Proceed only if data found
CHECK GV_NODATA_FLG IS INITIAL.
**Subroutine to get BKPF data(Accounting Document Header)
PERFORM GET_BKPF_DATA.
**Subroutine to get BSEG data(Accounting Document Segment)
PERFORM GET_BSEG_DATA.
FORM GET_BSIS_DATA.
CLEAR IT_GLACCOUNTS.
REFRESH IT_GLACCOUNTS.
SELECT BUKRS
GJAHR
BELNR
FROM BSIS INTO TABLE IT_GLACCOUNTS
WHERE BUKRS IN S_BUKRS AND
( HKONT IN S_HKT_IC OR
HKONT IN S_HKT_TX ) AND
BELNR IN S_BELNR AND
BUDAT IN S_BUDAT .
ENDFORM. " GET_BSIS_DATA
FORM GET_BSEG_DATA.
CLEAR IT_BSEG.
IF NOT IT_GLACCOUNTS[] IS INITIAL.
SELECT BUKRS
BELNR
GJAHR
BUZEI
SHKZG
MWSKZ
DMBTR
KOSTL
AUFNR
XAUTO
HKONT
PROJK
XBILK
FROM BSEG INTO CORRESPONDING FIELDS OF TABLE IT_BSEG
FOR ALL ENTRIES IN IT_GLACCOUNTS
WHERE BUKRS = IT_GLACCOUNTS-BUKRS AND
BELNR = IT_GLACCOUNTS-BELNR AND
GJAHR = IT_GLACCOUNTS-GJAHR.
ENDIF. "IF NOT IT_BKPF[] IS INITIAL
ENDFORM. " GET_BSEG_DATA
2007 Feb 23 10:03 AM
hi,
use tables bsis, bsik, bsid (resp. bsas, bsak or bsad) instead of bseg or use logical database like brf or sdf
A.
Message was edited by:
Andreas Mann
2007 Feb 23 10:05 AM
Hi Rocky,
Check this link.
http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3c60358411d1829f0000e829fbfe/frameset.htm
Hope this helps you.
Regards,
Saumya
2007 Feb 23 10:13 AM
u can't do aggregate functions or joins on cluster table... but u can definately select data frm BSEG table .... use FOR ALL ENTRIES.... and declare 2 different ITABS with complete primary key ...and then using control break statements do the processing... on ITABS
hope this will help
bbye tac care
Ashwani
2007 Feb 23 10:22 AM
2007 Feb 23 10:18 AM
2007 Feb 23 2:21 PM
Can't really say without seeing your code. Could you post it please?
Rob