07-19-2005 12:21 PM
Hi all,
When iam fetching wrbtr,augdt,zterm fields from BSEG table by passing VBELN and BUKRS it is taking lot of time to get.My query goes like this
select vbeln wrbtr augdt zterm from bseg into table t_bsegtab for all
entries in t_vtab where bukrs = p_bukrs and
vbeln = t_vtab-vbeln.
Is there any wrong in statement.If not what is the possible solution for that.
regards
kiran
07-19-2005 12:56 PM
Hi ,
use table bsad for cleared items
( and bsid for open items )
-> all important fields from bseg and bkpf are in that table
-> or look for ldb DDF with transaction SE36
regards Andreas
07-19-2005 12:31 PM
Hi,
Instead of using two internal table t_bsegtab & t_vtab, use only one internal table with INNER JOIN statement. That can improve your speed of the application.
Thanks & Regards,
Ravikiran.
07-19-2005 12:37 PM
Let me assume that the vbeln is purhcase order document.
Since the BSEG is a cluster table it is not indexed therefore it will take a lot of time if ur not using key fields in the where condition.
One possible soloution is , if your looking for all the documents corresponding to the purchase order then u can query the purchase order history table EKBE.
With regards,
Sharath.
07-19-2005 12:38 PM
Hi Kiran,
Your Select-statement seems correct. Unfortunately the BSEG is not very good in performace if you don't select on the key fields.
And you can NOT use inner joins because the BSEG is not a transparant table.
Have you tried using the index tables like BSID?
Regards,
Arjan
07-19-2005 12:54 PM
Hi Kiran,
BSEG is a cluster and will always be a performance issue and in your select you have not specified all the key fields requried for fetch. With addition to that you are using FOR ALL ENTRIES which will cause the performance.
Try to use the secondary Index transparant table like BSIK, BSIS, Which mite have a good result.
Prabhu Rajesh.
07-19-2005 12:54 PM
Hi,
As BSEG is a cluster table and has open/close item details of Vendor, Customer & GL account, as far as possible avoid quering BSEG instead use the relevant tables to get the data, BSEG has the combination of following tables,
BSID & BSAD --> Customer Accounting details
BSIK & BSAK --> Vendor Accounting details
BSAS & BSIS --> G/L Account details
If your requirement is to get the open/close items for Vendor, access BSIK & BSAK tables by passing the key fields in the where condition.
Hope this helps, get back for further clarifications,
Rgds,
07-19-2005 12:56 PM
Hi ,
use table bsad for cleared items
( and bsid for open items )
-> all important fields from bseg and bkpf are in that table
-> or look for ldb DDF with transaction SE36
regards Andreas