‎2007 Sep 16 10:40 AM
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
‎2007 Sep 16 4:56 PM
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.
‎2007 Sep 17 3:47 AM
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
‎2007 Sep 17 3:47 AM
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