Quantcast
Channel: SCN : Unanswered Discussions - ABAP Testing and Troubleshooting
Viewing all articles
Browse latest Browse all 430

Need help with this SELECT against BSIS

$
0
0

I have a Web Dynpro app that calls an RFC to do some asynchronous processing to avoid the 1-minute time-out I'd otherwise run into.  The RFC is a bunch of SELECT statements against BSIS that are all very similar to each other with slight differences.  I write the data out to a zTable.  Once the RFC ends and the Action fires back in my WDA application, I read the data in from my zTable and continue processing.

 

The problem I'm running into is that the SELECT statement just "hangs", and I think it's probably due to the large numbers of parameters in my WHERE...IN internal table.  But I'm also not sure about the >= and <= I have in this statement, nor am I sure I've created the best index.  So, I'm going to provide as much information up front as I can, and I'm hoping that someone out there can give me some ideas on how to get this -- and the related -- BSIS queries running in a somewhat-timely fashion.

 

Here's the query:

 

SELECT hkont

          geber

          budat

          shkzg

          dmbtr

          fipos

     FROM bsis

     INTO CORRESPONDING FIELDS OF TABLE lt_bsis_cash_in

     WHERE geber IN lt_geber     AND

           bukrs = 'PUR'         AND

           hkont >= '0000400000' AND

           hkont <= '0000499999' AND

           budat IN lt_budat.

 

When I enter a range of WBS Elements in my WDA app, I get the corresponding GEBER values, sort and de-dupe, and pass it into this query via internal table LT_GEBER.  At 1,000 entries, LT_GEBER has 984 entries.  At 2,000 entries, LT_GEBER has 1,948.  Both of these run pretty quickly (a minute or so).  But when I go up to 2,500 entries and LT_GEBER has 2,440 entries, the query just "hangs" during processing.  In every instance, LT_BUDAT has "I BT 19920101 20150214" (so I'm selecting on budat between 1/1/92 and 2/14/15).  We just have one company code here, so the BUKRS = 'PUR' could probably be removed.

 

As you might have guessed, my other queries are different in the ranges of HKONT that I'm selecting.  In the example above, our "Cash In" records are in the range of 400000-499999.

 

When the query runs with 1,000 or 2,000 WBS Elements selected, ST05 looks like this:

 

4 FILTER

  Filter Predicates

 

  3 INLIST ITERATOR

 

    2 TABLE ACCESS BY INDEX ROWID BSIS

 

      1 INDEX RANGE SCAN BSIS~Z4

 

Index Z4, which I built for these queries, looks like this (I've added #Distinct values based on a sampling of 653,408 rows; the entire BSIS table has just over 65,000,000 records):

 

MANDT (1)

BUKRS (1)
GEBER (12,895)

HKONT (1,532)

BUDAT (2,791)

 

So at this point, I'm not sure what to do.  A better index?  Restructuring the query to do less in the WHERE clause and do more by looping through the table and deleting records that don't match my criteria there?  Something else?

 

This is all on ECC 6.0.  If you need additional information, please let me know.  Any information folks can provide is GREATLY appreciated.  Thanks so much for your time.

 

Dave


Viewing all articles
Browse latest Browse all 430

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>