03-23-2009 11:23 AM
Hi Gurus,
Please Help me on this Issue..
I want to retrieve data from vbfa table..while making query to retrieve data from vbfa tabl,its making performance issue on production server.
SELECT vbelv
vbeln
INTO TABLE i_ref_data
FROM vbfa FOR ALL ENTRIES IN i_billing_main
WHERE
vbelv EQ i_billing_main-vbeln AND
vbtyp_n EQ c_vbtyp_n.
so i have tried to retrieve data using functiom module "RV_ORDER_FLOW_INFORMATION" .in this function i was not able to pass multiple document no to this function module so put this function module inside the loop but this option also making performance issue..
LOOP AT i_billing_main_temp INTO wa_billing_main.
CLEAR : wa_comwa,wa_vbfa.
REFRESH i_vbfa.
wa_comwa-vbeln = wa_billing_main-vbeln.
This function module used for retrieving document flow data from VBFA
CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
EXPORTING
comwa = wa_comwa
TABLES
vbfa_tab = i_vbfa.
SORT i_vbfa BY vbelv vbeln vbtyp_n.
DELETE ADJACENT DUPLICATES FROM i_vbfa COMPARING vbelv vbeln vbtyp_n.
SORT i_vbfa BY vbtyp_n.
READ TABLE i_vbfa
INTO wa_vbfa
WITH KEY vbtyp_n = c_vbtyp_n
BINARY SEARCH.
IF sy-subrc EQ 0.
wa_ref_data-vbeln = wa_vbfa-vbeln.
wa_ref_data-vbelv = wa_billing_main-vbeln.
APPEND wa_ref_data TO i_ref_data.
ENDIF.
ENDLOOP.
so kindly give me the solution for improving performance of this issue.
Is it having any function module to pass multiple inputs to the function module.?
Regards
P.Senthil Kumar
Edited by: senthil kumar on Mar 23, 2009 12:23 PM
03-23-2009 11:28 AM
try like this..
SELECT vbelv
vbeln
INTO TABLE i_ref_data
FROM vbfa FOR ALL ENTRIES IN i_billing_main
WHERE
vbelv EQ i_billing_main-vbeln AND
posnv EQ i_billing_main-posnn AND
vbtyp_n EQ c_vbtyp_n.
in where condition you should have to match the line item number..
03-23-2009 11:28 AM
try like this..
SELECT vbelv
vbeln
INTO TABLE i_ref_data
FROM vbfa FOR ALL ENTRIES IN i_billing_main
WHERE
vbelv EQ i_billing_main-vbeln AND
posnv EQ i_billing_main-posnn AND
vbtyp_n EQ c_vbtyp_n.
in where condition you should have to match the line item number..
03-23-2009 11:39 AM
Hi Arunima Rudra,
I have tried to put posnv filed in where conditon also in my program but my team lead informed to use only function module.Is it have any function module to pass multiple vbeln data.??
Thanks & Regards
P.Senthil Kumar
03-23-2009 11:43 AM
check this function module...
SPP01_SALESORDER_GETLIST
SD_VBFA_SELECT
WB2_VBFA_READ_WITH_VBELV
WB2_VBFA_READ_WITH_VBELN
READ_VBFA
Edited by: Arunima Rudra on Mar 23, 2009 5:13 PM
Edited by: Arunima Rudra on Mar 23, 2009 5:19 PM
03-23-2009 11:52 AM
Hi Arunima Rudra,
"SPP01_SALESORDER_GETLIST" its not available in ECC5.0..is it BAPI_SALESORDER_GETLIST"..???
In this function module we can't pass document number..
my intension is to pass invoice numbers to VBFA table and based on that i have to get sub sequent invoice numbers.
Regards
P.Senthil Kumar
03-23-2009 12:00 PM
Hi Arunima Rudra ,
I was tried these function modules also in my program but these are having only one input value (VBELN).So i was forced me to use these function modules inside the loop so its afftecting performance of the program.So please help me on this issue..
SD_VBFA_SELECT
WB2_VBFA_READ_WITH_VBELV
WB2_VBFA_READ_WITH_VBELN
READ_VBFA
Regards
P.Senthil Kumar
03-23-2009 12:04 PM
03-23-2009 12:26 PM
Hi Arunima Rudra ,
I have seen " SHP_VBFA_SELECT_02 ".its working fine.thanks Arunima..
I saw the coding for this function module its also like a Query i gave early in this forum.
SELECT vbelv
vbeln
INTO TABLE i_ref_data
FROM vbfa FOR ALL ENTRIES IN i_billing_main
WHERE
vbelv EQ i_billing_main-vbeln AND
vbtyp_n EQ c_vbtyp_n.
Will u give some other function module.???
Thanks & Regards
P.Senthil Kumar
03-23-2009 11:28 AM
Please add check condition to check internal table is blank.
if not i_billing_main[] is initial.
SELECT vbelv
vbeln
INTO TABLE i_ref_data
FROM vbfa FOR ALL ENTRIES IN i_billing_main
WHERE
vbelv EQ i_billing_main-vbeln AND
vbtyp_n EQ c_vbtyp_n.
endif.
This is the best possible way to retrive data from VBFA table.
Other method you adopted will take more time since you are calling the FM in loop.
Please check ST05 trace for your above query to see if primary index is being used. Else contact Basis to help you out.
03-23-2009 11:31 AM
hi
check this fm RV_ORDER_FLOW_INFORMATION.
hope this helps
regards
Aakash Banga
03-23-2009 11:36 AM