07-08-2010 11:09 AM
Dear Friends,
I'm trying to fetch the invoice number form BSEG table.
The query is
loop at IT_BSEG2 INTO WA_BSEG2.
SELECT SINGLE BELNR FROM bseg INTO invoice
where BUKRS = WA_BSEG2-BUKRS and
GJAHR = WA_BSEG2-GJAHR and
BUZEI = '001' and
AUGBL = WA_BSEG2-BELNR and
KOART = 'K' and
SHKZG = 'H' and
lifnr = wa_bseg2-lifnr .
-
-
endloop.
but its making performance issue. How i can increase the performance of this code.
Kindly give your valuable guidance.
regards,
BAB
07-08-2010 11:12 AM
Hi,
The BSEG is a cluster table. Although the data retrival from this table will be slow. Beyond that you are using the BSEG in the LOOP statement. It will give the Performance Issue.
While fetching the data from the BSEG try to use all the key fields of the BSEG and dont use the BSEG inside the LOOP.
Next time onwards try to post this thread in the Appropriate Forum
With Regards,
Sumodh.P
07-08-2010 11:21 AM
hi,
Even if inside or out side loop BSEG giving Performance issue..
Well, actually what i need means, to get Payment document wise Invoice number. From which table i'll get this invoice number.
Eg. Payment document number is 15 Series and Invoice number started with 50 series.
So i passed this 15 series in BSEG-AUGBL field and getting BELNR number (Invoice number). Rather than this any other way to get the Invoice number.
Regards,
Bab
07-08-2010 11:24 AM
The answer again lies in searching the forums. This question has been asked and answered many times already.
pk
07-08-2010 11:12 AM
Search the forums for Tips to improve performance and the first tip you find will help improve the performance of your "code" to a great extent.
pk