Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Taking time to fetch records from BSEG

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

andreas_mann3
Active Contributor
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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,

andreas_mann3
Active Contributor
0 Kudos

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