Skip to Content
Former Member
Oct 01, 2009 at 04:44 PM

Performance Issue, Unable to pull all production Orders in given statuses


HI All,

I have a requirement to pull all production orders that are in the created or released status and then action some different things in the program such as adjusting dates, etc. The issue I'm having is that as the volume of production orders grows the select statement stops being able to complete and pull these production orders. I've tweaked this before and it was able to work for a few weeks but has now reached it's limit again. I tried using the trace and SE30 to analyze the program as I've read suggested here, however it's been difficult to try adjustments as the program runs in about 3 second in the development environment. Our quality environment, which has roughly half the volume of the production system ran in about 15 seconds. So I am unable to duplicate the issue until the program is moved to production.

Here is the select statement:

  SELECT k~aufnr
    FROM aufk as k INNER JOIN afko as f ON f~aufnr = k~aufnr
      INNER JOIN jest as j ON k~objnr = j~objnr
    WHERE k~aufnr IN s_aufnr     "Order Number select option
      AND k~werks IN s_werks             "Plant select option
      AND k~auart EQ u2018PP01u2019              "PP01 std orders only
      AND k~kokrs EQ u20181000u2019              "Seneca Controlling Area
      AND k~autyp EQ u201810u2019                "PP Production Order
      AND k~loekz EQ space                 "Deletion indicator
      AND ( j~stat EQ u2018I001u2019             "CTRD, created status
        OR  j~stat EQ u2018I002u2019 )           "REL, released status
      AND j~inact EQ space.              "status not inactive

There are a couple thoughts I have to try, but I don't know of any good way to verify if helping given the volume differences until in production so am looking for feedback. Here's the ideas:

1. Use the field IDAT2 in AUFK to determine if an order is not TECO'd , rather than using the JEST table. Testing this in Dev had increased run time versus how I have it written now, but may be helpful with larger volume and/or if an index is put on this field. Thoughts?

2. Separate the select statements to read AUFK and JEST separately and instead use the FOR ALL ENTRIES command. Seems to be a lot of conflicting thoughts on which works better, thoughts on this particular case?

Also, there is another program that pulls only production orders in Created status, and it doesn't have this same issue.

Thanks in advance for any help,


Edited by: Kyndal Copley on Oct 1, 2009 6:46 PM