05-21-2015 5:33 AM
Hello All,
This is regarding VBFA table performance,
Iam using VBFA to Get Delivery numbers from Shipment and Invoice numbers from Delivery.
1st Select Statement on VBFA
By using Shipment iam getting Deliveries ,it is taking time to get the data.
here iam using all key fields in select Query.
Average Records is around 10K
2nd Select Statement on VBFA.
By using Deliveries which we get above statement am getting Billing documents.
this is taking too much time almost 30 to 40min .
here also average records around 10+K.
how to resolve this?,Please suggest is there any FM to get data from VBFA or to increase performance of select query.
Regards
Surendra.
05-21-2015 5:38 AM
Hi,
1. create secondary index on VBFA.
OR
best way to get deliveries and billing numbers as follows.
1. Join LIKP,LIPS get LIKP-VBELN, LIPS-POSNR add your where condition
2. Join VBRK,VBRP and pass LIKP-VBELN to VBRP-VGBEL and LIPS-POSNR to VBRP-VGPOS
and get VBRK-VBELN and VBRP-POSNR .
Regards,
Chandu
05-21-2015 5:45 AM
Hello Chandra Mohan,
Thanks for Reply.
We cannot create Index as we like ,and to get Deliveries from Shipments we have to use sale flow(VBFA) not LIKP or LIPS .
05-21-2015 5:56 AM
05-21-2015 6:45 AM
Did you read and apply suggestion of 185530 - Performance: Customer developments in SD?
c) Search for invoices with delivery number (preceding document, field VBRP-VGBEL):
Incorrect: SELECT FROM vbrp WHERE vgbel = ...
Correct: SELECT FROM vbfa WHERE vbtyp_n = 'M'
AND vbelv = ...
SELECT FROM vbrp WHERE vbeln = vbfa-vbeln
AND posnr = vbfa-posnn
Else can you post SQL actual statement and trace Access plan explanation from ST05?
Regards,
Raymond
05-21-2015 7:54 AM
Dear Surendra,
Do not use select statements with VBFA table since it is a time consuming query.
Please use function module 'RV_ORDER_FLOW_INFORMATION' to get the document flow (ie: Get Delivery numbers from Shipment and Invoice numbers from Delivery) .
// Result table is 'VBFA_TAB'
// You can identify the relevant document using VBTYP_N and VBTYP_V fields
Regards
Praveen