Application Development 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: 

Inner join on BKPF / BSIS giving time out dump / background job hangging

Former Member
0 Kudos

Hello,

I am using inner join on BKPF and BSIS as follows. But it does not work due to high volume of data ( Nearly 200,000 records in BKPF). I tried to select data separately and then combine using nested loop on itabs, but it also gives same error.

I do not have BELNR, but I am using XBLNR because the config is such that accouting document number is not same as VBELN in VBRK. VBRK-VBELN is copied in BKPF-XBLNR, not in BKPF-BELNR.

Please advice me other options to fetch data.

My code:-

SELECT abukrs abelnr agjahr awaers abudat amonat aawtyp aawkey a~xblnr bbuzei bwrbtr bshkzg bhkont b~zuonr b~sgtxt INTO CORRESPONDING FIELDS OF TABLE ft_itab FROM bkpf AS a INNER JOIN bsis AS b ON ( abukrs = bbukrs AND abelnr = bbelnr AND agjahr = bgjahr ) FOR ALL ENTRIES IN ft_itab1 WHERE a~bukrs EQ p_bukrs AND a~xblnr EQ ft_itab1-xblnr AND a~gjahr EQ fp_gjahr AND a~blart IN s_blart AND a~monat IN so_peri AND b~hkont EQ p_achknt.

Thanks,

Rupali.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

For your issue. you can fetch data individualy form each table. and while fetching data you can use Index.

In BKPF first index is available which is for referance document no (XBELNR).

In BSIS table also you can find one index, if possible use that one also.

If still you are not able to solve your problem then you can use OPEN CURSOR and CLOSE CURSOR functionality to fethc data in

blocks instead of in one go.

This might solve your problem.

2 REPLIES 2

former_member182566
Active Contributor
0 Kudos

Hi,

If you only have 200,000 in BKPF then it's definetely not a high number.

1) how many records do you have in ft_itab1?

2) how is this table filled?

3) do a trace in st05, and post the explain plan here.

Former Member
0 Kudos

Hi,

For your issue. you can fetch data individualy form each table. and while fetching data you can use Index.

In BKPF first index is available which is for referance document no (XBELNR).

In BSIS table also you can find one index, if possible use that one also.

If still you are not able to solve your problem then you can use OPEN CURSOR and CLOSE CURSOR functionality to fethc data in

blocks instead of in one go.

This might solve your problem.