Skip to Content
author's profile photo Former Member
Former Member

Extend execution time

HI Experts,

My Zreport takes long time to execute & coz of that I get Time-out error on PRD Server. Is it possible to extend the time alloted to execute the report in SAP. Urgent.

Thanks

Khan

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on May 17, 2008 at 08:06 PM

    First of all, replace the first SELECT and LOOP AT customer with a single SELECT, JOINing KNA1 and KNVP. I have no idea why you do three SELECTs on the same tables in that LOOP.

    Also, It looks like you don't need BKPF in the other group of SELECTs. Try using just BSID and BSAD.

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 15, 2008 at 08:02 AM

    Hi Khan,

    do like this.

    set in transaction RZ10 in instance profile parameter rdisp\max_wprun_time.

    set number of seconds you want to run ABAP programs in dialog. Default is 600 sec. (10 min.)

    You have to restart application server to make it working.

    or,

    How long is your program taking to execute?

    Do you get timeout error in ST22?

    If so goto SE38 execute the job in background. Or goto SM36 and scedule the job in background.

    You can change the max_wp_runtime but if you Program runs for more than 10mins it should really be run in background to improve dialog performance.

    Regards

    Kiran Sure

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 15, 2008 at 08:02 AM

    Hi Khan,

    You can fine tune the program to avoid it ... so paste the piece of code where it is getting timed out ... You can even contact your basis consultant for increasing the memory....

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Restructure your code:

      SELECT KUNNR INTO CORRESPONDING FIELDS OF TABLE CUSTOMER
             FROM KNA1 WHERE KUNNR IN S_KUNNR.
      DEL = SY-SUBRC .
      IF DEL  NE  0.
        EXIT. "RETURN.
      ENDIF.
      
      DELETE ADJACENT DUPLICATES FROM CUSTOMER.
      
      
      SELECT A~BELNR A~BUDAT A~GJAHR B~KUNNR B~SHKZG B~DMBTR 
             INTO CORRESPONDING FIELDS OF TABLE ITABO_BSID
             FROM BKPF AS A INNER JOIN BSID AS B ON A~BELNR = B~BELNR 
                AND A~GJAHR EQ B~GJAHR
                AND A~MANDT = B~MANDT 
                AND A~BUKRS = B~BUKRS
             WHERE A~BUDAT < S_DATE-LOW   "??? 
             AND A~BUKRS EQ P_BUKRS
             AND ( B~UMSKZ EQ SPACE OR B~UMSKZ EQ 'A')
             AND B~ZUMSK EQ SPACE
             AND B~KUNNR IN S_KUNNR .
      SORT ITABO_BSID BY KUNNR.  "Sort
      
      SELECT A~BELNR A~BUDAT A~GJAHR B~KUNNR B~SHKZG B~DMBTR
            INTO CORRESPONDING FIELDS OF TABLE ITABO_BSAD
            FROM BKPF AS A INNER JOIN BSAD AS B ON A~BELNR = B~BELNR
                AND A~GJAHR EQ B~GJAHR
                AND A~MANDT = B~MANDT 
                AND A~BUKRS = B~BUKRS
             WHERE A~BUDAT <  S_DATE-LOW    "???
             AND A~BUKRS EQ P_BUKRS
             AND ( B~UMSKZ EQ SPACE OR B~UMSKZ EQ 'A')
             AND B~ZUMSK EQ SPACE
             AND B~KUNNR IN S_KUNNR .
      SORT ITABO_BSAD BY KUNNR.  "Sort
      
      
      
      LOOP AT CUSTOMER.
        SELECT SINGLE A~NAME1 INTO CUSTOMER-NAMESO 
          FROM KNA1 AS A INNER JOIN KNVP  AS B ON A~KUNNR = B~KUNN2
          WHERE B~KUNNR = CUSTOMER-KUNNR AND B~PARVW = 'ZA'.
      
        SELECT SINGLE A~NAME1 INTO CUSTOMER-NAMEAM 
          FROM KNA1 AS A INNER JOIN KNVP AS B ON A~KUNNR = B~KUNN2
          WHERE B~KUNNR = CUSTOMER-KUNNR AND B~PARVW = 'ZB'.
      
        SELECT SINGLE A~NAME1 INTO CUSTOMER-NAMERM 
          FROM KNA1 AS A INNER JOIN KNVP AS B ON A~KUNNR = B~KUNN2
          WHERE B~KUNNR = CUSTOMER-KUNNR AND B~PARVW = 'ZC'.
      
        MODIFY CUSTOMER INDEX SY-TABIX.
      "  CLEAR CUSTOMER.
      
      
      * Change this select to be a read on the ITABO_BSID table
      SELECT A~BELNR A~BUDAT A~GJAHR B~KUNNR B~BUZEI 
      B~SHKZG B~SGTXT B~ZFBDT B~ZUONR B~DMBTR B~PSWSL 
      B~ZTERM B~VBELN
      INTO CORRESPONDING FIELDS OF ITAB_BSID
      FROM BKPF AS A INNER JOIN BSID AS B ON A~BELNR = B~BELNR 
      AND A~GJAHR EQ B~GJAHR
      AND A~MANDT = B~MANDT AND A~BUKRS = B~BUKRS
      FOR ALL ENTRIES IN CUSTOMER   "??? Internal table not header line!
      WHERE A~BUDAT IN S_DATE
      AND A~BUKRS EQ P_BUKRS
      AND ( B~UMSKZ EQ SPACE OR B~UMSKZ EQ 'A')
      AND B~KUNNR IN S_KUNNR. 
      AND B~KUNNR = CUSTOMER-KUNNR.
      
      ITAB_BSID-NAMESO = CUSTOMER-NAMESO.
      ITAB_BSID-NAMEAM = CUSTOMER-NAMEAM.
      ITAB_BSID-NAMERM = CUSTOMER-NAMERM.
      APPEND ITAB_BSID.
      CLEAR ITAB_BSID.
      ENDSELECT.
      
      * Change this select to be a read on the ITABO_BSAD table
      SELECT A~BELNR A~BUDAT A~GJAHR B~KUNNR B~BUZEI B~SHKZG 
      B~SGTXT B~ZFBDT B~ZUONR B~DMBTR B~PSWSL B~ZTERM B~VBELN
      INTO CORRESPONDING FIELDS OF ITAB_BSAD
      FROM BKPF AS A INNER JOIN BSAD AS B ON A~BELNR = B~BELNR 
      AND A~GJAHR EQ B~GJAHR
      AND A~MANDT = B~MANDT AND A~BUKRS = B~BUKRS
      WHERE A~BUDAT IN S_DATE
      AND A~BUKRS EQ P_BUKRS
      AND ( B~UMSKZ EQ SPACE OR B~UMSKZ EQ 'A')
      AND B~ZUMSK EQ SPACE
      AND B~KUNNR IN S_KUNNR. 
      AND B~KUNNR = CUSTOMER-KUNNR.
      ITAB_BSAD-NAMESO = CUSTOMER-NAMESO.
      ITAB_BSAD-NAMEAM = CUSTOMER-NAMEAM.
      ITAB_BSAD-NAMERM = CUSTOMER-NAMERM.
      
      APPEND ITAB_BSAD.
      CLEAR ITAB_BSAD.
      ENDSELECT.
      
      ENDLOOP.

      This way you loop through CUSTOMER only once.

      Do not use S_DATE-LOW, A) have you read the table in to the header line. B) is the select-option sign equal to E (exclude)?

      As you have got the data from BKPF + BSID / BSAD use that instead of another select. Therefore READ the intenal table(s).

      There is a stray FOR ALL ENTRIES being used which will look at the internal table, not the header line. A good reason to use different names for header line and table body.

      MattG.

      Edited by: gifford matthew on May 18, 2008 2:14 PM

      Comment out CLEAR CUSTOMER

  • author's profile photo Former Member
    Former Member
    Posted on May 15, 2008 at 02:31 PM

    Run it in background. Batch process do not time out.

    -RK

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 16, 2008 at 11:08 AM

    Hi,

    Changing the timeout settings is not a solution right,

    Hope your program is taking much time in the sence problem with performance of your report.

    make the changes where ever it is taking the time.

    1.make a count for selecting instead of selecting all the records

    2.avoid the select statement in the loop.

    3.Use the read statement with binary search make sure that yoru internal table is sorted before using the read statement with binary search

    4.Use the sequence of the select satement and fetch the required data only

    5. Delete unncessary data records after using for selections.

    Aviod much loops for processing.

    6 . Use proper index in selections.

    Other wise set the backgrond job for the same in production and go for SM66 you can see where exactly it is taking much time for process.

    Regards,

    madan.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.