Reading Cluster Table BSEG
Just want to know though BSEG is a cluster table but we can read it using Select or use SQL statements meant for transparent table. How is it possible?
Kindly clarify.
Regards
anya
Hi,
there a 2 types of 'cluster' tables. The first one is a physical cluster, linking of tables sort of speak. Here you can use select statements as already described in the above answers.
see .<a href="http://help.sap.com/saphelp_47x200/helpdata/en/81/415d363640933fe10000009b38f839/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/en/81/415d363640933fe10000009b38f839/frameset.htm</a>
Another type of cluster table is the one with a fixed structure. This can be used to store data dynamically with the export statement you speak of eg. you can store an intire internal table this way or a deep structure and later on extract it again.
<a href="http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3c1f358411d1829f0000e829fbfe/frameset.htm">http://help.sap.com/saphelp_47x200/helpdata/en/fc/eb3c1f358411d1829f0000e829fbfe/frameset.htm</a>
Similar Messages
-
Hi ,
I have a requirement to read cluster tables data using import statement . I have to access cluster tables data based on selection criteria . Any body help me regarding this isuue .
Regards
UdayHi Uday,
Check this one:
[Extraction from cluster tables through function module|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a0f46157-e1c4-2910-27aa-e3f4a9c8df33]
Re: BW extractor for ERP cluster tables
Regards,
Chandra Sekhar -
Error reading cluster table COIX for report 13BUD1A
Hi All,
We have issue when display report 13BUD1A using t.code CJE0 in ECC6 system. The error message appear as per below:-
Error reading cluster table COIX for report 13BUD1A (ID=13BUD1A KP 01RPSCO_X 0)
Message no. KH050
Diagnosis
The report structure for report 13BUD1A is stored in the cluster table COIX. An error occurred while the system was reading this data (ID = 13BUD1A KP 01RPSCO_X 0).
Table TKEB1 (Report List) contains administration information for report 13BUD1A. Consequently, table TKEB1 has an entry for the report, but table COIX does not.
The error may have resulted following a transport -- COIX has not yet been transported to the current client but TKEB1 is already there.
Procedure
If it is a transport problem, see if you can execute report 13BUD1A in client 000. If so, import it to the current client again.
If it is not a transport problem, delete report 13BUD1A from Tables TKEB1 and TKEB2.
Need you advice, how can we solve this error.
Thank You.Dear AP,
Thanks for your reply. FYI, we dont have access to client 000. And how to resolve this issue without access client 000? -
Special authorization need for read cluster table??
In one report, I use following coding to read information from RFDT table:
form get_f110_parm .
f110id-laufd = p_laufd.
f110id-laufi = p_laufi.
f110versionpar = space.
clear: buktab, fkttab, slktab, sldtab, trctab, usrtab,
faetab, jobtab, f110v, f110c, trcopt, f110versionpar.
import buktab fkttab slktab sldtab trctab usrtab
faetab jobtab f110c trcopt f110versionpar
from database rfdt(fb) id f110id
accepting padding.
endform. " GET_F110_PARM
I can fill F110c, trcopt and f110versionpar by this program. But there is no entry in table like fkttab, usrtab.
Is there any authorization need for read cluster table??
Thanks in advance.
Edited by: Amy Xie on Dec 21, 2010 10:41 AMHello,
After you run your code, check transaction SU53 to see if any authorization check failed. -
How to read Cluster Tables.
Sample program
Import and export to database is used in two programs and not in the same program.
ZPROGRAM1.
tables : indx.
Data : SALDO type i,
indxkey LIKE indx-srtfd VALUE 'ZAB1'.
indx-aedat = sy-datum.
indx-usera = sy-uname.
indx-pgmid = sy-repid.
EXPORT SALDO TO DATABASE indx(zc) ID indxkey.
In another program,
ZPROGRAM2.
tables : indx.
Data : SALDO type i,
indxkey LIKE indx-srtfd VALUE 'ZAB1'.
indx-aedat = sy-datum.
indx-usera = sy-uname.
indx-pgmid = sy-repid.
IMPORT SALDO FROM DATABASE indx(zc) ID indxkey. -
How do we join cluster table bseg?
Friends ,
i just wanna know as 2 how can we combine bseg and bkpf tables.
since bkpf is a transparent table and bseg is a cluster table.
regards
Essam
[email protected]Hi Essam,
REPORT ztestport_01.
TABLES : bkpf,
bseg.
INTERNAL TABLE AND WORK AREA FOR THE FIELDS IN BKPF TABLE *
DATA : BEGIN OF itab_bkpf OCCURS 0,
bukrs LIKE bkpf-bukrs, "Company Code.
gjahr LIKE bkpf-gjahr, "Fiscal Year.
budat LIKE bkpf-budat, "Posting Date in the Document.
belnr LIKE bkpf-belnr, "Accounting document number.
blart LIKE bkpf-blart, "Document Type.
END OF itab_bkpf.
DATA : wa_bkpf LIKE LINE OF itab_bkpf.
INTERNAL TABLE AND WORK AREA FOR THE FIEDLS IN BSEG TABLE *
DATA : BEGIN OF itab_bseg_debit OCCURS 0,
bukrs LIKE bseg-bukrs, "Company Code.
gjahr LIKE bseg-gjahr, "Fiscal Year.
belnr LIKE bseg-belnr, "Accounting Document Number.
buzei LIKE bseg-buzei, "Line Item.
hkont LIKE bseg-hkont, "General Leadger Account.
shkzg LIKE bseg-shkzg, "Credit/Debit Indicator.
wrbtr LIKE bseg-wrbtr, "Amount in Document Currency.
pswsl LIKE bseg-pswsl, "Update Currency for Gen.Ledger
dmbtr LIKE bseg-dmbtr, "Amount in local currency.
sgtxt LIKE bseg-sgtxt, "Item Text.
zuonr LIKE bseg-zuonr, "Assignment Number.
END OF itab_bseg_debit.
DATA : itab_bseg_credit LIKE STANDARD TABLE OF itab_bseg_debit WITH
HEADER LINE.
FINAL OUTPUT INTERNAL TABLE *
DATA : BEGIN OF itab_output OCCURS 0,
belnr(08) ,
bukrs(04) ,
budat LIKE bkpf-budat,
buzei(03) ,
hkont(07) ,
blart(02) ,
shkzg(01) ,
wrbtr(08) ,
pswsl(05) ,
dmbtr(10) ,
sgtxt(19) ,
zuonr(10) ,
END OF itab_output.
CONSTANTS : c_debit TYPE c VALUE 'S',
c_credit TYPE c VALUE 'H'.
SELECT-OPTIONS *
SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-t01.
SELECT-OPTIONS : s_bukrs FOR bkpf-bukrs.
PARAMETERS : p_year LIKE bkpf-gjahr visible length 2.
SELECT-OPTIONS : s_budat FOR bkpf-budat,
s_dbacct FOR bseg-hkont,
s_cracct FOR bseg-hkont,
s_amt FOR bseg-dmbtr.
SELECTION-SCREEN END OF BLOCK input.
SELECTING RECORDS FROM BKPF TABLE BASED ON THE CONDITION *
SELECT bukrs gjahr budat belnr blart
FROM bkpf INTO TABLE itab_bkpf
WHERE bukrs IN s_bukrs AND
gjahr EQ p_year AND
budat IN s_budat.
SELECTING DEBIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT *
NUMBER SELECTED FROM BKPF *
IF NOT itab_bkpf[] IS INITIAL.
SELECT bukrs gjahr belnr buzei
hkont shkzg wrbtr pswsl
dmbtr sgtxt zuonr
FROM bseg INTO TABLE itab_bseg_debit
FOR ALL ENTRIES IN itab_bkpf
WHERE bukrs EQ itab_bkpf-bukrs AND
belnr EQ itab_bkpf-belnr AND
gjahr EQ itab_bkpf-gjahr AND
hkont IN s_dbacct AND
shkzg EQ c_debit AND
dmbtr IN s_amt.
SELECTING CREDIT LINE ITEMITEMS FROM BSEG FOR THE DOCUMENT *
NUMBER SELECTED FROM BKPF *
SELECT bukrs gjahr belnr buzei
hkont shkzg wrbtr pswsl
dmbtr sgtxt zuonr
FROM bseg INTO TABLE itab_bseg_credit
FOR ALL ENTRIES IN itab_bkpf
WHERE bukrs EQ itab_bkpf-bukrs AND
belnr EQ itab_bkpf-belnr AND
gjahr EQ itab_bkpf-gjahr AND
hkont IN s_cracct AND
shkzg EQ c_credit AND
dmbtr IN s_amt.
ENDIF.
SORT itab_bkpf BY bukrs gjahr belnr.
SORT itab_bseg_credit BY bukrs gjahr belnr.
LOOPING THE DEBIT ENTRIES *
LOOP AT itab_bseg_debit.
READING THE CREDIT ENTRIES WHICH MATCHES WITH HE CURRENT DOC. NUMBER *
READ TABLE itab_bseg_credit WITH KEY
bukrs = itab_bseg_debit-bukrs
gjahr = itab_bseg_debit-gjahr
belnr = itab_bseg_debit-belnr BINARY SEARCH.
IF sy-subrc EQ 0.
*READING THE POSTING DATE AND DOCUMENT TYPE FOR THE CURRENT DOUCMENT *
AND APPENDING THE DEBIT AND CREDIT ENTRIES *
READ TABLE itab_bkpf INTO wa_bkpf WITH KEY
bukrs = itab_bseg_debit-bukrs
gjahr = itab_bseg_debit-gjahr
belnr = itab_bseg_debit-belnr BINARY SEARCH.
itab_output-belnr = itab_bseg_debit-belnr.
itab_output-bukrs = itab_bseg_debit-bukrs.
itab_output-budat = wa_bkpf-budat.
itab_output-buzei = itab_bseg_debit-buzei.
itab_output-hkont = itab_bseg_debit-hkont.
itab_output-blart = wa_bkpf-blart.
itab_output-shkzg = itab_bseg_debit-shkzg.
itab_output-wrbtr = itab_bseg_debit-wrbtr.
itab_output-pswsl = itab_bseg_debit-pswsl.
itab_output-dmbtr = itab_bseg_debit-dmbtr.
itab_output-sgtxt = itab_bseg_debit-sgtxt.
itab_output-zuonr = itab_bseg_debit-zuonr.
APPEND itab_output.
itab_output-belnr = itab_bseg_credit-belnr.
itab_output-bukrs = itab_bseg_credit-bukrs.
itab_output-budat = wa_bkpf-budat.
itab_output-buzei = itab_bseg_credit-buzei.
itab_output-hkont = itab_bseg_credit-hkont.
itab_output-blart = wa_bkpf-blart.
itab_output-shkzg = itab_bseg_credit-shkzg.
itab_output-wrbtr = itab_bseg_credit-wrbtr.
itab_output-pswsl = itab_bseg_credit-pswsl.
itab_output-dmbtr = itab_bseg_credit-dmbtr.
itab_output-sgtxt = itab_bseg_credit-sgtxt.
itab_output-zuonr = itab_bseg_credit-zuonr.
APPEND itab_output.
ENDIF.
ENDLOOP.
SORT itab_output BY belnr budat shkzg.
then loop your final itab_output
and give write command to print
your fields.
<b>Regards,
Jackie.</b>
Message was edited by:
Jackie -
By passing Cluster Table BSEG ?
What is the science of using Cluster tables? I mean why are cluster tables used for ? + HOW CAN I BY PASS CLUSTER TABLER to get the data quickly ??
Hi,
The famous BSEG table is a cluster table.
It is as was correctly stated part of the Accounting Document Segment. It is part of the Pool cluster RFBLG and lives in the package: FBAS (Financial accounting 'Basis').
You can't read a cluster table exactly the way you read a database (old speak, transparent table).
You can use a program to read called RFPPWF05
Note 435694: Display BSEG item by calling FB09D (modified FB09)
Other possiblity: Other possibility: CALL DIALOG 'RF_ZEILEN_ANZEIGE', but since this is a dialog I don't think this would work.
In any event go to FBAS Package (development class) to see your business objects, class library and functions.
you must use keyfields bukrs , belnr, gjahr
(so 1st select table bkpf) to select bseg.
or use secondary index tables:
bsas, bsis, bsik, bsak, bsid, bsad
Cluster Table : Cluster tables are logical tables that must be assigned to a table cluster when they are defined. Cluster tables can be used to strore control data. They can also be used to store temporary data or texts, such as documentation.
A clustered and a pooled table cannot be read from outside SAP because certain data are clustered and pooled in one field.
One of the possible reasons is for instance that their content can be variable in length and build up. Database manipulations in Abap are limited as well.
But pool and cluster table is a many to one relationship table. This means many pool table store in a database table which is know as table pool.
All the pool table stored table in table pool does not need to have any foreign key relationship but in the case of cluster table it is must. And pool and cluster table is basically use to store application data.
For pool and cluster table you can create secondary index and you can use select distinct, group for pool and cluster table. You can use native SQL statement for pool and cluster table.
Regards,
Raj. -
Data Retrieval from Cluster Table - BSEG
Hi all,
I need to retreive data related to document line items from BSEG whose CLEARING DATE (AUGDT) is greater than a user given date for TWO COMPANY CODES (say 0010/0200).
as BSEG is a cluster table, it has huge data and taking large amt of time can anybody suggest a better way of retrieving data for the above conditions(fastly)
Thanks in Advance,
Lakshmihi,
use second. index tables:
customers: BSAD
vendors: BSAK
G/L acc.: BSAS
sample:
SELECT (felder) FROM bsad into TABLE stab
WHERE bukrs = bukrs
AND kunnr IN kunnr
AND gsber IN gsber
AND augbl <> space
AND hkont IN akont
AND augdt GT p_date.
regards Andreas
Message was edited by: Andreas Mann -
Hi all,
As we all know BSEG is cluster table and it has one to many relationship with the underlying database.tables
I just wanna know how we can find tables that are clustered in BSEG. In general any tables that are clustered to form cluster table?
Thanks
Paraghi
in se11, take bseg, u can see the cluster RFBLG in the Delivery and maintenance tab.
Double click on RFBLG.
place the cursor in RFBLG and press the button where used list (ctrlshiftf3).......select the option Tables.........this will display u the tables.
BSEC
BSED
BSEG
BSES
BSET
Regards
Sajid -
Hello Friends,
I have replicated the transparent tables by applying filters in IUUC_REPL_CONTENT but I know it's different for Cluster tables.
Does anyone replicated the BSEG or CDPOS ?
I need some inputs on this folks.
Thanks in advance.
Regards
RajaMay be this is helpful - http://scn.sap.com/community/replication-server/blog/2014/02/25/how-to-filter-on-the-initial-load-parallelize-replication
-
Read from cluster table ZL-PCL2
Hi all,
I need to read cluster table ZL that stores wage type for pernr. Now previously i was suggested
FM 'CU_READ_RGDIR'
FM 'CD_RED_LAST'.
FM 'PYXX_READ_PAYROLL_RESULT'. But i want to use the statement
Import from database.
i have included the file RPC2ZL00.
then the statement
Import ZL to ZZL from database PCL2(ZL) ID ZL-KEY.
Now does anyone have idea abt ZL-KEY??
means what value i need to feed in ZL-KEy and how do i feed it??
thanks in advance for all those who help me..
ReenaHi Reena,
Key is the combination of Pernr & sequence no., which u see it from report display payroll result(HINCLSTR) or RGDIR table.
Instead of Import statement You can also use macro as below .
CALL FUNCTION 'CU_READ_RGDIR'
EXPORTING
PERSNR = PERNR-PERNR
TABLES
IN_RGDIR = RGDIR
EXCEPTIONS
NO_RECORD_FOUND = 1
OTHERS = 2.
CHECK SY-SUBRC = 0.
PAY_BEGDA = SEL-BEGDA.
LOOP AT RGDIR WHERE SRTZA = 'A' AND VOID = SPACE
AND ( PAYDT >= SEL-BEGDA AND PAYDT <= SEL-ENDDA ).
IF RGDIR-RUNDT >= PAY_RUNDT.
MOVE RGDIR-RUNDT TO PAY_RUNDT.
PAY_BEGDA = RGDIR-FPBEG.
SEQNR = RGDIR-SEQNR.
ENDIF.
ENDLOOP.
RX-KEY-PERNR = PERNR-PERNR.
UNPACK SEQNR TO RX-KEY-SEQNO.
<b>RP-IMP-C2-RU.</b>
CHECK RP-IMP-RU-SUBRC = 0.
Read the cluster table
LOOP AT CRT.
ENDLOOP.
Hope this helps.
Thanks,
Sarika. -
Cluster tables , pool tables ,hashed tables?
give me the examles of cluster and pool tables & hashed tables ?
<b>I. Transparent tables (BKPF, VBAK, VBAP, KNA1, COEP)</b>
Allows secondary indexes (SE11->Display Table->Indexes)
Can be buffered (SE11->Display Table->technical settings) Heavily updated tables should not be buffered.
<b>
II. Pool Tables (match codes, look up tables)</b>
Should be accessed via primary key or
Should be buffered (SE11->Display Table->technical settings)
No secondary indexes
Select * is Ok because all columns retrieved anyway
<b>III. Cluster Tables (BSEG,BSEC)</b>
Should be accessed via primary key - very fast retrieval otherwise very slow
No secondary indexes
Select * is Ok because all columns retrieved anyway. Performing an operation on multiple rows is more efficient than single row operations. Therefore you still want to select into an internal table. If many rows are being selected into the internal table, you might still like to retrieve specific columns to cut down on the memory required.
Statistical SQL functions (SUM, AVG, MIN, MAX, etc) not supported
Can not be buffered
<b>IV. Buffered Tables (includes both Transparent & Pool Tables)</b>
While buffering database tables in program memory (SELECT into internal table) is generally a good idea for performance, it is not always necessary. Some tables are already buffered in memory. These are mostly configuration tables. If a table is already buffered, then a select statement against it is very fast. To determine if a table is buffered, choose the 'technical settings' soft button from the data dictionary display of a table (SE12). Pool tables should all be buffered.
regards,
srinivas
<b>*reward for useful answers*</b> -
Hi,
I never read data from Cluster table like BSEG, is there any precautions to be taken while reading data from it? as it contains voluminous data
please suggest.
regards,
Pra<b>Cluster Tables (BSEG,BSEC)</b>
Should be accessed via primary key - very fast retrieval otherwise very slow
No secondary indexes
Select * is Ok because all columns retrieved anyway. Performing an operation on multiple rows is more efficient than single row operations. Therefore you still want to select into an internal table. If many rows are being selected into the internal table, you might still like to retrieve specific columns to cut down on the memory required.
Statistical SQL functions (SUM, AVG, MIN, MAX, etc) not supported
Can not be buffered
SELECT bukrs belnr gjahr blart budat monat
tcode bvorg waers kursf hwaer
FROM bkpf
INTO TABLE it_bkpf
WHERE bukrs IN s_bukrs
AND gjahr IN s_gjahr
AND monat IN s_monat
AND tcode IN ('CO88', 'KO88', 'KK87')
AND awtyp EQ c_ref_pro. "'AUAK'
Pick up the corresponding line items from BSEG
SELECT bukrs belnr gjahr dmbtr wrbtr ktosl
zuonr hkont matnr werks menge
FROM bseg
INTO TABLE it_bseg
FOR ALL ENTRIES IN it_bkpf
WHERE bukrs = it_bkpf-bukrs
AND belnr = it_bkpf-belnr
AND gjahr = it_bkpf-gjahr
AND werks IN s_werks
AND ktosl = c_tr_key. "'PRD'
<b>BSEG Access</b>
BSAD Accounting: Secondary index for customers (cleared items)
BSAK Accounting: Secondary index for vendors (cleared items)
BSAS Accounting: Secondary index for G/L accounts (cleared items)
BSID Accounting: Secondary index for customers
BSIK Accounting: Secondary index for vendors
BSIM Secondary Index, Documents for Material
BSIS Accounting: Secondary index for G/L accounts -
How to Extract data from Cluster table and transperant table
Hello BW Experts ,
I want to extract the data from cluster table BSEG and a transperant table BKPF .
The primary fields are BELNR , GJHAR and BUKRS.
the fields of table BKPF to extarct is BUDAT and fields of BSEG table is HKONT , BSCHL , ZUONR and POSID.
I can not create a view over these two tables as BSEG is a Cluster table.
Please guide me.
Regadrs ,
Amol.hi Amol,
take a look Sigg's weblog
/people/siegfried.szameitat/blog/2005/09/29/generic-extraction-via-function-module
you can use RSAX_BIW_GET_DATA_SIMPLE as sample, there specified import parameters
FUNCTION RSAX_BIW_GET_DATA_SIMPLE.
""Lokale Schnittstelle:
*" IMPORTING
*" VALUE(I_REQUNR) TYPE SRSC_S_IF_SIMPLE-REQUNR
*" VALUE(I_DSOURCE) TYPE SRSC_S_IF_SIMPLE-DSOURCE OPTIONAL
*" VALUE(I_MAXSIZE) TYPE SRSC_S_IF_SIMPLE-MAXSIZE OPTIONAL
*" VALUE(I_INITFLAG) TYPE SRSC_S_IF_SIMPLE-INITFLAG OPTIONAL
*" VALUE(I_READ_ONLY) TYPE SRSC_S_IF_SIMPLE-READONLY OPTIONAL
*" TABLES
*" I_T_SELECT TYPE SRSC_S_IF_SIMPLE-T_SELECT OPTIONAL
*" I_T_FIELDS TYPE SRSC_S_IF_SIMPLE-T_FIELDS OPTIONAL
*" E_T_DATA STRUCTURE SFLIGHT OPTIONAL
*" EXCEPTIONS
*" NO_MORE_DATA
*" ERROR_PASSED_TO_MESS_HANDLER -
Maintaince view creation for a cluster table
Hi friends,
I have created a maintaince view for a cluster table bseg and i have activated it its working fine..
now my problem is i can create maintaince view for mutiple tables if other tables are linked with primary table using foriegn key relationship..
Now can any one tell me is it possible to create maintance view for cluster table with multiple tables as i need a linked table with bseg which iam not able to get... ie : when i click on the relationship tab iam not getting the linked tables for bseg...
now can i create a maintaince view with 2 linked cluster tables..
if so can any one tell me how to create it.
As sap says we can create projection view for cluster and pooled table and we cannot create database view for cluster and pooled tables , but it does not mentioned like that for maintaince view....
I assume we can do it.... as iam trying to create a maintaince view with single cluster table then it shoudl allow me to create for multiple linked cluster tables.... and is it mandatory to maintain TMG for this maintaince view....?
Regards
KUMARyes.. ur right inserting values into a cluster table other than standard sap tarnactions is dangerious....
But sap didnot mentioned any where that we cannot maintain data for cluster tables using maintaince view... which it said for database view..that pooled and cluster table cannot be used for database view..
Regards
Kumar
Maybe you are looking for
-
Push Not Working Properly After Update. How To Downgrade?
I have a 3Gs with a few apps that use push (BeejiveIM, Prowl, Aardvark), but when I updated from 3.0 to 3.0.1, it broke all push notifications. Being too busy at the time to do anything about it, I just let it go and waited for 3.1 to be released, ho
-
Cannot update or reload third party software
Can someone please help? I have a new imac runnng latest lion OS. I have been using MS office for mac 2011 suite successfully. on attempting to update software using updater, software succesfully downloads but fails to load stopping with a terminal w
-
How can I get an AP out of OfficeExtend mode?
I was setting a group of access points to a certain block of settings and I used a template to apply it. I have one access point that keeps giving me an error about the AP mode. I set this AP back to factory defaults, rebooted it, and it still joins
-
hey i bought this second hand phone from a friend and this phone is locked by a korean carrier KT free tel, its currently running on IOS 4.1. so now i am thinking to use this phone on this IOS 4.1. but when i am downloading the apps from Itunes. it s
-
Hardware Configuration Checker Tool??
A while back I found a tool in Cisco's web site that would allow you to select a switch, enter in its modules and check the configuration for errors... Does any one have a link to that tool? I cannot for the life of me find it again...