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 vbfa table :

Madhurivs23
Participant
0 Likes
730

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
652

if not t_bill_list[] is initial.

sort t_bill_list by vbeln.

select 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_n = 'M'

and vbtyp_v = 'J'.

endif.

Read only

0 Likes
652

Hi Prashant,

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
652

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