2008 Apr 03 11:00 AM
Abap Gurus,
I am fetching belnr dmbtr buzei hkont from bseg
for all entries from one table say 'TAB'
where hkont = TAB-hkont
and koart = 'S'.
but in in the code inspector check it;s showing error
The message is
"Large table BSEG: No field of a table index in WHERE"
How to optimize a fetch from a larger cluster table BSEG
rewards if useful.
Thanks in advance
2008 Apr 03 11:06 AM
Hi,
Alternatives to Reading BSEG (Accounting Document Segment).
Since performance is an issue if reading data from BSEG table ( being a cluster table ), maybe you would
consider using the tables:
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
BSIS Accounting : Secondary Index for G/L Accounts
instead of BSEG.
It depends on what your program has to select (if you're only looking for customers
you can use BSID and BSAD etc.)
These are normal database tables, not clusters. Normally every record from BSEG
can be found back in one of these 6 tables and a program which selects data from
these tables runs faster than from BSEG.
Reward points if helpful
Thanks
Shambhu
Abap Gurus,
I am fetching belnr dmbtr buzei hkont from bseg
for all entries from one table say 'TAB'
where hkont = TAB-hkont
and koart = 'S'.
but in in the code inspector check it;s showing error
The message is
"Large table BSEG: No field of a table index in WHERE"
How to optimize a fetch from a larger cluster table BSEG
rewards if useful.
Thanks in advance
2008 Apr 03 11:03 AM
Thats not an error, thats a warning, but a critical one from a performance point of view. The report will run, but because you dont use an index the database will use a table space scan resulting in very slow performance.
Create an index for fields in the where clause, but ask your database admins before, cause having a lot of indexes will slow the system down when isnerts or updates will take place very often.
2008 Apr 03 11:06 AM
Hi,
Alternatives to Reading BSEG (Accounting Document Segment).
Since performance is an issue if reading data from BSEG table ( being a cluster table ), maybe you would
consider using the tables:
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
BSIS Accounting : Secondary Index for G/L Accounts
instead of BSEG.
It depends on what your program has to select (if you're only looking for customers
you can use BSID and BSAD etc.)
These are normal database tables, not clusters. Normally every record from BSEG
can be found back in one of these 6 tables and a program which selects data from
these tables runs faster than from BSEG.
Reward points if helpful
Thanks
Shambhu
2008 Apr 03 11:09 AM
If you know HKONT, the best way is doing a first select in BSIS and for each selected row do a SELECT SINGLE in BSEG with all keys (if you don't have all necessary fields in BSIS). If you are also searching for cleared items, you must do also the same with BSAS.
2008 Apr 03 11:13 AM
2008 Apr 03 1:33 PM
which type of records comes in cancelled g/l accounts
how is it identified
2008 Apr 03 2:08 PM
2008 Apr 03 2:26 PM
Gowri ,
You are trying to fetch records from BSEG based on the GL A/C number. BSEG is a cluster table with keys BUKRS BELNR GJAHR BUZID. In your select you are not using any keys. SELECT s on cluster tables are always a matter of concern if you are not using the FULL KEY.
But if the functionality is like that, i will suggest you to use secondary index tables for deriving the data. One option is using logical database SDF. ( most FI programs like FBL3N uses it ). Or you will have to derive the logic for deriving the BSEG keys ( I guess you can at least use the BUKRS and GJAHR if not BELNR) .
Hope it explains.
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |