Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Performance problem with VBRP

Former Member
0 Likes
1,239

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!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,013

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

7 REPLIES 7
Read only

Former Member
0 Likes
1,013

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.

Read only

Former Member
0 Likes
1,013
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.
Read only

Former Member
0 Likes
1,013

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.

Read only

Former Member
0 Likes
1,013

Hi..

Why can you go for Database Index methodology..

Create a index for BSID table.

I think thi smay helpful.

Regards:

Sridhar

Read only

Former Member
0 Likes
1,014

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

Read only

Former Member
0 Likes
1,013

Thanks for answers! I tried all of this things, but maybe I have to do an paralel task...

Read only

0 Likes
1,013

Wc,

if you problem is solved than please close this thread.

Amit.