2007 Feb 19 2:04 PM
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
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
2007 Feb 19 2:07 PM
Hi,
the most important thing try to avoid using cluster table specially like BSEG, normally you can extract same data from transparent tables like BKPF too, your business person will be able to tell you better.
If nothing is there then try to provide all the key fields to read data from it.
Regards,
Amit
Reward all helpful replies.
2007 Feb 19 2:07 PM
hi Praneet,
1. Include all the key fields in the where conditon . Try making use of Indexes .
2. Never put these statements in loop and endloop .
3. Avoid using select .. endselect statement ..
Regards,
Santosh
2007 Feb 19 2:07 PM
<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
2007 Feb 19 2:09 PM
Hello,
Instead of BSEG make use of the fillowing tables:
BSEC One-Time Account Data Document Segment
BSED Bill of Exchange Fields Document Segment
BSEG Accounting Document Segment
BSES Document Control Data
BSET Tax Data Document Segment
There are also index tables like BSIS, BSAS, BSID, BSAD BSIK and BSAK. You may be able to use one or two of them
Vasanth
2007 Feb 19 2:09 PM
Hi,
Since BSEG is a cluster table field in where clause of the select shall contain only the primary keys. Any further filtering of the data shall be done after selection has been done.
Clear: I_BSEG/
Select BUKRS BELNR GJAHR BUZEI KOART SHKZG MENGE MEINS EBELN EBELP INTO TABLE I_BSEG FOR ALL ENTRIES IN I_BSIK WHERE BUKRS EQ I_BSIK-BUKRS
BELNR EQ I_BSIK-BELNR
GJAHR EQ I_BSIK-GJAHR.
If sy-subrc eq 0.
sort i_bseg by bukrs gjahr belnr.
endif.
Regards
Kannaiah
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |