on 03-11-2008 3:07 PM
Hi,
I have used smartforms for generating suppler payment statement for financial department. more time duration is taken by the program when it is generating.
I think this problem comes while data fetching from BSEG table. because, it has more records for one vendor ID.
I want reduce this time duration.
Please guide me.
I have mention following code which I used.
SELECT sgtxt wrbtr belnr
FROM bseg
INTO
CORRESPONDING FIELDS OF TABLE it_eft_invoice
WHERE bukrs = '1000'
AND augbl = (reugh-vblnr)
AND gjahr = (Current Fiscal)
AND bschl = '31' (Posting key).
It has to do with the selection universe. You are restricting
only bukrs from the primary key (all the other restrictions in your where clause are filters that are applied on SAP's side (not on the database side)). The problem is that bseg isn't stored as separated fields in the RDBMS, but as a table with the primary key and a stream of bits in a raw field.
You should review and change the logic you're using before reading bseg. It's the only way you'll improve the performance of this select. (for example, you could use one or more secondary index tables - bi or ba to retrieve belnr and access bseg with a better where clause).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you know the vendor, then you should use BSIK and BSAK instead of BSEG.
Rob
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
avoid INTO CORRESPONDING..
maintain order of fields in internal table and select query should be same and use into table .
one more is there is alternative of using BSEG table, because it is cluster table.
Since performance will be an issue, 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 vor 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...
regards.
santhosh reddy
Edited by: Santhosh Reddy on Mar 11, 2008 8:44 PM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.