Application Development and Automation 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: 
Read only

fetching records from the VBFA : performance issue

Madhurivs23
Participant
0 Likes
792

I want to fetch the delivery docs correponding to the billing docs

from table vbfa.

code IS LIKE THIS :

t_bill_list table contains the invoice nos.

code 1)

select distinct

vbelv

vbeln

into table t_bill_del_data

from vbfa

for all entries in t_bill_list

where vbeln eq t_bill_list-vbeln

and vbtyp_v = 'J'

and vbtyp_n = 'M'

the above query was taking time so i changed that to -->

code 2)

loop at t_bill_list into wa_bill_list.

select single

vbelv

vbeln

into wa_bill_del_data

from vbfa

where vbeln eq wa_bill_list-vbeln

and vbtyp_v = 'J'

and vbtyp_n = 'M'.

if sy-subrc = 0.

append wa_bill_del_data to t_bill_del_data.

clear wa_bill_del_data.

endif.

endloop.

both the queries have poor performance in quality system because of large amount of data

Is there any other table other than vbfa?

Or how should i fetch the records?

rgds,

Madhuri

3 REPLIES 3
Read only

Former Member
0 Likes
592

Hi Madhuri

First check the no. of entries in the internal table you have used in FOR ALL ENTRIES. If ur internal table is empty then the select query will fetch all the records from table VBFA. Hence before executing select query write a if condition as

IF NOT t_bill_list is initial.

Select query

ENDIF.

Second option is try using inner join and measure the performanace.. Compare the performance for Inner join and For all entries. The one which takes less time would be the best option.

Read only

0 Likes
592

Hi Pratiksha,

Thanks for help.

My problem got solved. i am fetching the records from the vbrp table instead of vbfa table.

the notes I referred are :191492,187906,185530.

basically, the query which i have written was giving 100% good performance in development server becoz the data was less. but was not at all running in Quality becoz of the large amount of data.so i used the table vbrp where i can get the invoice and delivery no link.

rgds

Madhuri

Read only

Madhurivs23
Participant
0 Likes
592

My problem got solved. i am fetching the records from the vbrp table instead of vbfa table.

the notes I referred are :191492,187906,185530.

basically, the query which i have written was giving 100% good performance in development server becoz the data was less. but was not at all running in Quality becoz of the large amount of data.so i used the table vbrp where i can get the invoice and delivery no link.

rgds

Madhuri