‎2008 Feb 16 7:07 PM
Hi All,
I would like to know what would be alternate table or optimal way to make the following queries work in a more efficient manner.
1) select sfakn from vbrk into table tl_sfakn for all entries in tl_vbrp WHERE sfakn = tl_vbrp-vbeln.
2) SELECT vbeln FROM vbrp INTO TABLE tl_vbrp FOR ALL ENTRIES IN tl_vbap[] WHERE vgbel = tl_vbap-vbeln.
any help would be appreciated.
thanks
vijay
‎2008 Feb 25 8:52 AM
Dear Friend i could see that you are working on mainly on VBRP and VBRK.
Please try with the following Views for a better results.
WB2_V_VBRK_VBRP
Data Selection from Customer Billing Document
WB2_V_VBRK_VBRP2
Data Selection from Customer Billing Documents (w/o WBGT
Regards,
Lijo Joseph
‎2008 Feb 25 9:45 AM
Hello Vijay,
How doing?. plz find my suggestions
1. fetch vgbel ( sales document) also into tl_vbrp in previous select. Now make use of document flow as shown
select vbeln from vbfa
into table tl_vbfa for all entries in tl_vbrp
where vbelv EQ t_vbrp-vgbel and
VBTYP_N IN ('M','N','O','P'). "billing docs
if tl_vbfa[] is not inital.
select vbeln sfakn
into table tl_sfakn
from vbrk for all entries in tl_vbfa
where vbeln EQ tl_vbfa-vbeln.
if sy-subrc EQ 0.
delete tl_sfakn where sfakn is initial.
endif.
endif.
2. u can use VBFA as shown above , use preceding and subsequent document category appropriately
thanks
sreejith