‎2008 Jul 29 2:09 PM
Hi People, someone can give a light about performance issue?
I'trying to select table VBRP with registers os BSID using VBELN like this:
SELECT vbeln
posnr
matnr
prctr
FROM vbrp
INTO TABLE tg_vbrp
FOR ALL ENTRIES IN tg_bsid
WHERE vbeln = tg_bsid-vbeln.
It's works, but too slow...I tried put PRCTR in where condition, but still slow...
Any idea to increase performance in this select?
Thanks a lot!
‎2008 Jul 29 3:00 PM
Hi,
*Simply take the another internal table of type tg_bsid and hit your query as below.
data: gt_temp like table of tg_bsid occurs 0 with header line.
gt_temp[ ] = tg_bsid[ ].
sort gt_temp by vbeln posnr.
// This helps when there are more records and to reduce the load on server.
delete adjacent duplicates from gt_temp comparing vbeln posnr.
SELECT vbeln
posnr
matnr
prctr
FROM vbrp
INTO TABLE tg_vbrp
FOR ALL ENTRIES IN gt_temp
WHERE vbeln = gt_temp-vbeln
AND posnr = gt_temp-posnr.
Try like this.
Edited by: Ravi Kumar on Jul 29, 2008 4:34 PM
‎2008 Jul 29 2:13 PM
hi,
Use dummy ranges to pass the entire key of VBRP table ...
i.e,
ranges : r_posnr for vbrp-posnr.
if not tg_bsid[] is initial.
SELECT vbeln
posnr
matnr
prctr
FROM vbrp
INTO TABLE tg_vbrp
FOR ALL ENTRIES IN tg_bsid
WHERE vbeln = tg_bsid-vbeln and
posnr in r_posnr.
endif.
‎2008 Jul 29 2:22 PM
Check id not tg_bsid[] is initial.
SELECT vbeln
posnr
matnr
prctr
FROM vbrp
INTO TABLE tg_vbrp
FOR ALL ENTRIES IN tg_bsid
WHERE vbeln = tg_bsid-vbeln.
‎2008 Jul 29 2:23 PM
Hi,
You can do some to improve performance:
1. Sort your internal table by the field VBELN (and possibly other additional fields).
2. Make sure you have selected data from BSID where the field VBELN is NOT empty.
3. Make sure that the table VBRP is fully active (sometimes its only partial activated).
4. Make sure that the primary index (VBRP~0) is also fully active.
5. Try to reorganize the table VBRP (ask the system guys/girls).
6. Try modifying the code:
RANGES: r_posnr FOR vbrp-posnr.
IF NOT ( tg_bsid[] IS INITIAL ).
SELECT vbeln
posnr
matnr
prctr
FROM vbrp
INTO TABLE tg_vbrp FOR ALL ENTRIES IN tg_bsid
WHERE vbeln EQ tg_bsid-vbeln
AND posnr IN r_posnr.
ENDIF.Mostly this table contains invoice positions and it is very normal, that a huge amount (multiple millions) is inside. When this is the case, you will need to use parallel processing techniques.
Regards,
Rob.
‎2008 Jul 29 2:53 PM
Hi..
Why can you go for Database Index methodology..
Create a index for BSID table.
I think thi smay helpful.
Regards:
Sridhar
‎2008 Jul 29 3:00 PM
Hi,
*Simply take the another internal table of type tg_bsid and hit your query as below.
data: gt_temp like table of tg_bsid occurs 0 with header line.
gt_temp[ ] = tg_bsid[ ].
sort gt_temp by vbeln posnr.
// This helps when there are more records and to reduce the load on server.
delete adjacent duplicates from gt_temp comparing vbeln posnr.
SELECT vbeln
posnr
matnr
prctr
FROM vbrp
INTO TABLE tg_vbrp
FOR ALL ENTRIES IN gt_temp
WHERE vbeln = gt_temp-vbeln
AND posnr = gt_temp-posnr.
Try like this.
Edited by: Ravi Kumar on Jul 29, 2008 4:34 PM
‎2008 Jul 29 3:34 PM
Thanks for answers! I tried all of this things, but maybe I have to do an paralel task...
‎2008 Jul 29 3:38 PM
Wc,
if you problem is solved than please close this thread.
Amit.