‎2009 Mar 29 9:17 PM
Hi Gurus,
please can you tell me how to speed up the performance of a query where I used a custom field (NUMEROBOLLA) with a search coded as below:
clear NUMEROBOLLA.
select single XABLN from LIKP into NUMEROBOLLA
where vbeln = CONSEGNA.
CONSEGNA is another custom field where I retrive SD Delivery number.
Thank you very much
Kind Regards
Andrea
‎2009 Mar 30 2:24 AM
HI,
If you are writing the SELECT Statement in the LOOP..ENDLOOP statement then it can be a performance issue. You can this select statement outside the Loop using SELECT ..FOR ALL ENTRIES and read the table for the XABLN in the Loop.
‎2009 Mar 30 5:31 AM
Hi:
To avoid this type of dilemna, i would advice to use function module like C1CE_LIKP_READ
Regards
Shashi
‎2009 Mar 30 8:41 AM
Avoid using select single in loop.
If possible try to use all the key fields in where condition.
for eg.
CONSTANTS: c_vbeln TYPE vbfa-vbeln VALUE IS INITIAL,
c_posnn TYPE vbfa-posnn VALUE IS INITIAL,
c_vbtyp_n TYPE vbfa-vbtyp_n VALUE IS INITIAL,
CASE1:
SELECT vbelv posnv vbeln posnn vbtyp_n rfmng meins
INTO TABLE i_vbfa FROM vbfa
WHERE vbelv IN so_vbeln
AND posnv IN so_posnv.
CASE2:
SELECT vbelv posnv vbeln posnn vbtyp_n rfmng meins
INTO TABLE i_vbfa FROM vbfa
WHERE vbelv IN so_vbeln
AND posnv IN so_posnv
AND vbeln GE c_vbeln
AND posnn GE c_posnn
AND vbtyp_n GE c_vbtyp_n.
This will definitely improve the performance to a considerable extent.
Edited by: harsh bhalla on Mar 30, 2009 1:11 PM
‎2009 Mar 30 11:55 AM
VBELN is the primary key of LIKP, so there is no problem with your query.
Thomas
‎2009 Mar 31 9:30 AM
You use key field in the search so this sql does not have problem.
But you need to check if this kind of sql is used inside the LOOP.
Also you need to check NUMEROBOLLA is the same type of XABLN.
‎2009 Apr 02 10:21 AM
Please try to include some more conditions in where .
This will provide slight improvement in performance.
Also , if possible replace Select single from Database table to Read statement on the internal table.
‎2009 Apr 04 10:35 AM
"Please try to include some more conditions in where. This will provide slight improvement in performance."
How can someone say this things? Why don't you answer only if you know what you are saying?
And how can you give points to this? Please read what Thomas said ... that's your correct answer.
Regards and good luck!
Valter Oliveira.