TIME-OUT error in BSAK select query(Progress Indicator is also used)

Hi,
    In my report program one select query is there on BSAK table, which is as follows --
       SELECT BUKRS                                                     
                     BELNR
                    GJAHR
                    SHKZG
                    BSCHL
                    UMSKZ
                    LIFNR
                    EBELN
                    EBELP
                    WRBTR
                    DMBTR
                    XZAHL
                    REBZG
                   AUGBL
                   BLART
                   AUFNR
                   AUGDT
                   BUZEI FROM BSAK
                              INTO TABLE IT_BSAK
                              FOR ALL ENTRIES IN IT_BKPF1
                               WHERE BUKRS = IT_BKPF1-BUKRS
                                            AND AUGDT = IT_BKPF1-BUDAT
                                            AND AUGBL = IT_BKPF1-BELNR
                                            AND BSCHL IN ('31' , '29', '26', '39', '25').
I used Progress Indicator befor running this query and after this query also. But still It's giving me TIME-OUT error in this select query only.
  I run the same query for 10 records in IT_BKPF1 table, it runs perfectly. But when I run it for 1000 records it giving dump.
And in actual bussiness my records are always more than 100 only.
I also check the indexing. It having secondary indexing on this BUKRS, AUGDT, AUGBL fields. Then also it's giving error.
so, How can I solve this dump..?? What could be the reason..??
Thanks in advance...!!
Regards,
Poonam.

Hi Poonam Patil,
Try to provide BELNR and GJAHR in where condition...
BKPF-DBBLG ==> BSAK-BELNR
Also check
BKPF-BLDAT ==> BSAK-AUGDT
Check out above relation...
If data is there in these fields of the table and both are matching then you can pass it and as they are in primary key of BSAK it will improve the performance...
Hope it will solve your problem..
Thanks & Regards
ilesh 24x7
ilesh Nandaniya

Similar Messages

  • Time out error 1.6 million internal table fields are computed using FMs

    Hi , All ...
    The Report running fine in server with less 300 record but ...production server which has 1.6 million record it  gives error as time-out error and takes hell amount of time.
    Please suggest ugently ..
    I have tried few things
    Internal table having 1.6 lacs ... fields to compute .. i have token in a batch
    loop at i_cinfo into s_cinfo from 1 to  100000.
    and so on ...also applied all the performace related .. like indexs, work areas , deleting adjacent duplicates , for all entries ..wherever applicable.
    Please Suggest .
    Report is as below
    REPORT  ZUSOTCBD_CREDIT_REPORT .
    TABLES : KNA1,    " General Data Customer Master
             KNB1,    " Customer Master (Company Code)
             KNC1,    " Customer master (transaction figures)
             KNKK,    " Customer master credit management: Control area data
             T009,    " Fiscal Year Variants P
             T009Y,   " Shortened fiscal years in Asset Accounting P
             T001,    " Co. Codes
             T001CM,  " Permitted Credit Control Areas per Company Code
             RF42B,   " Structure to hold credit data.
             RF035,   " Structure to hold credit managment fields
             RF02L,   " Structure to hold credit data.
             TRAS,    " Interval for Days in Arrears P
             T000CM.  " Data for DSO calculation.
    Types
    TYPES:
      BEGIN OF type_final,
        string(50) TYPE c,                            " String Value for Title
      END OF type_final.
    data:wa_final     TYPE type_final.                " Work Area to hold Title Data
    DATA:    RASID    TYPE RF035-RASID value 'R03N'. " For Days in interval
    DATA:    MONAT(2) TYPE N.
    DATA:    GJAHR    TYPE  KNC1-GJAHR.
    DATA:    LD_PERIODS(32) TYPE N
                           VALUE '01020304050607080910111213141516'.
    DATA     sytabix type sy-tabix.
    DATA     LAND      TYPE KNA1-LAND1 VALUE 'US'.   " Country Key
    DATA:   LD_PERIOD    TYPE BSID-MONAT,            " Fiscal Year Variant
            LD_GJAHR   TYPE KNC1-GJAHR,
            LD_COUNTER TYPE SY-TABIX.
    Internal Tables
    Internal table to hold Title Data                                   *
    DATA:
      i_final    TYPE STANDARD TABLE OF type_final.
    **Internal Table Permitted Credit Control Areas per Company Code
    DATA:    BEGIN OF TCMTAB OCCURS 10.
            INCLUDE STRUCTURE T001CM.
    DATA:    END   OF TCMTAB.
    *Internal table to store Customer no.
    DATA :  BEGIN OF ICUST OCCURS 0,
               KUNNR             TYPE KNA1-KUNNR,    " Customer No.
            END   OF ICUST.
    DATA:    BEGIN OF BUKTAB OCCURS 20,
               KKBER             LIKE T001-KKBER,    " Credit Control Area
               BUKRS             LIKE T001-BUKRS,    " Co. Code
               WAERS             LIKE T001-WAERS,    " Currency
               PERIV             LIKE T001-PERIV,    " Fiscal Year Variant
               BUTXT             LIKE T001-BUTXT,
             END   OF BUKTAB.
    Internal Table to store Fiscal year Data .
    DATA:    BEGIN OF GJATAB OCCURS 5,
               PERIV             LIKE T001-PERIV,    " Fiscal Year Variant
               GJAHR             LIKE KNC1-GJAHR,    " Fiscal Year
               MONAT             LIKE T009-ANZBP,    "
               ANZBP             LIKE T009-ANZBP,    " Number of posting periods
             END   OF GJATAB.
    *Main Output internal table to be used to store credit history Information
    DATA : BEGIN OF I_CINFO occurs 0,
                 KUNNR TYPE   KNB1-KUNNR,     " Customer
                 KNKLI TYPE   KNKK-KNKLI,     " Customer's account number with credit limit reference
                 KKBER TYPE   KNKK-KKBER,     " Credit Control Area
                 CTLPC TYPE   KNKK-CTLPC,     " Risk Category
                 KLIMK TYPE   KNKK-KLIMK,     " Credit Limit
                 SBGRP TYPE   KNKK-SBGRP,     " Credit representative group for credit management
                 ERDAT TYPE   KNKK-ERDAT,     " Created On
                 DTREV TYPE   KNKK-DTREV,     " Last Internal Review
                 REVDB TYPE   KNKK-REVDB,     " Last External Review
                 SALDO TYPE   RF42B-SALDO,    " Balance
                 DSOIN TYPE   RF02L-DSOIN,    " DSO
                 H06SA TYPE   RF035-H06SA,    " Highest Balance at the end of 6 Months
                 H06JA TYPE   RF035-H06JA,    " Year highest Balance 6 Months
                 H06MO TYPE   RF035-H06MO,    " Month OF hihest Balance 6 Months
                 H12SA TYPE   RF035-H12SA,    " Highest Balance at the end of 12 Months
                 H12JA TYPE   RF035-H12JA,    " Year highest Balance 12 Months
                 H12MO TYPE   RF035-H12MO,    " Month OF hihest Balance 12 Months
                 UMP2U TYPE   RF42B-UMP2U,    " Sales from the current Year
                 UMP1U TYPE   RF42B-UMP1U,    " Sales from the Previous Year
                 SFAEL TYPE   RF035-SFAEL,    " Total Past Due Open Item
                 SFAE1 TYPE   RF035-SFAE1,    " Aging buckets 0-15
                 SFAE2 TYPE   RF035-SFAE2,    " Aging buckets 16-30
                 SFAE3 TYPE   RF035-SFAE3,    " Aging buckets 31-60
                 SFAE4 TYPE   RF035-SFAE4,    " Aging buckets 60-90
                 SFAE5 TYPE   RF035-SFAE5,    " Aging buckets Over 90
          END Of I_CINFO.
    DATA : BEGIN OF S_CINFO ,
                 KUNNR TYPE   KNB1-KUNNR,     " Customer
                 KNKLI TYPE   KNKK-KNKLI,     " Customer's account number with credit limit reference
                 KKBER TYPE   KNKK-KKBER,     " Credit Control Area
                 CTLPC TYPE   KNKK-CTLPC,     " Risk Category
                 KLIMK TYPE   KNKK-KLIMK,     " Credit Limit
                 SBGRP TYPE   KNKK-SBGRP,     " Credit representative group for credit management
                 ERDAT TYPE   KNKK-ERDAT,     " Created On
                 DTREV TYPE   KNKK-DTREV,     " Last Internal Review
                 REVDB TYPE   KNKK-REVDB,     " Last External Review
                 SALDO TYPE   RF42B-SALDO,    " Balance
                 DSOIN TYPE   RF02L-DSOIN,    " DSO
                 H06SA TYPE   RF035-H06SA,    " Highest Balance at the end of 6 Months
                 H06JA TYPE   RF035-H06JA,    " Year highest Balance 6 Months
                 H06MO TYPE   RF035-H06MO,    " Month OF hihest Balance 6 Months
                 H12SA TYPE   RF035-H12SA,    " Highest Balance at the end of 12 Months
                 H12JA TYPE   RF035-H12JA,    " Year highest Balance 12 Months
                 H12MO TYPE   RF035-H12MO,    " Month OF hihest Balance 12 Months
                 UMP2U TYPE   RF42B-UMP2U,    " Sales from the current Year
                 UMP1U TYPE   RF42B-UMP1U,    " Sales from the Previous Year
                 SFAEL TYPE   RF035-SFAEL,    " Total Past Due Open Item
                 SFAE1 TYPE   RF035-SFAE1,    " Aging buckets 0-15
                 SFAE2 TYPE   RF035-SFAE2,    " Aging buckets 16-30
                 SFAE3 TYPE   RF035-SFAE3,    " Aging buckets 31-60
                 SFAE4 TYPE   RF035-SFAE4,    " Aging buckets 60-90
                 SFAE5 TYPE   RF035-SFAE5,    " Aging buckets Over 90
          END Of s_cinfo.
    *Internal table to hold month-wise balance.
    DATA:    BEGIN OF SALTAB OCCURS 12,
               LNUMM(2)     TYPE N,             " Month
               SALDO        LIKE RF42B-SALDO,   " Balance
             END   OF SALTAB.
    *Internal table used for computing the Balance fields
    DATA:    BEGIN OF SALDO,
               UML01             LIKE KNC1-UM01S,
               UML02             LIKE KNC1-UM01S,
               UML03             LIKE KNC1-UM01S,
               UML04             LIKE KNC1-UM01S,
               UML05             LIKE KNC1-UM01S,
               UML06             LIKE KNC1-UM01S,
               UML07             LIKE KNC1-UM01S,
               UML08             LIKE KNC1-UM01S,
               UML09             LIKE KNC1-UM01S,
               UML10             LIKE KNC1-UM01S,
               UML11             LIKE KNC1-UM01S,
               UML12             LIKE KNC1-UM01S,
             END   OF SALDO.
    Structure to hold Bal fields ------ -------
    DATA:    BEGIN OF SKNKK,
               KUNNR             LIKE KNA1-KUNNR,  " Customer Number 1: Debitor
               KONTO             LIKE KNKK-KUNNR,
               SFAE1             LIKE RF035-SFAE1, " Aging buckets 0-15
               SFAE2             LIKE RF035-SFAE2, " Aging buckets 16-30
               SFAE3             LIKE RF035-SFAE3, " Aging buckets 30-60
               SFAE4             LIKE RF035-SFAE4, " Aging buckets 60-90
               SFAE5             LIKE RF035-SFAE5, " Aging buckets Over 90
               SFAEL             LIKE RF035-SFAEL, " Total Due of Items
               UML01             LIKE KNC1-UM01S,
               UML02             LIKE KNC1-UM01S,
               UML03             LIKE KNC1-UM01S,
               UML04             LIKE KNC1-UM01S,
               UML05             LIKE KNC1-UM01S,
               UML06             LIKE KNC1-UM01S,
               UML07             LIKE KNC1-UM01S,
               UML08             LIKE KNC1-UM01S,
               UML09             LIKE KNC1-UM01S,
               UML10             LIKE KNC1-UM01S,
               UML11             LIKE KNC1-UM01S,
               UML12             LIKE KNC1-UM01S,
               UMP1U             LIKE RF42B-UMP1U, " Sales from the Previous Year
               UMP2U             LIKE RF42B-UMP2U, " Sales from the current Year
               SALDO             LIKE RF42B-SALDO, " Balance
             END   OF SKNKK.
    DATA :  BEGIN OF ICUST1 OCCURS 0,
               KUNNR             TYPE KNA1-KUNNR,    "For Customer Filter.
            END   OF ICUST1.
    **Internal table to hold fiscal varriants
    DATA: BEGIN OF LT_PERIODS OCCURS 12,
             PERIOD LIKE BSID-MONAT,
             GJAHR  LIKE KNC1-GJAHR,
           END OF LT_PERIODS.
    **Constants
    constants :  BUKRS1 TYPE KNB1-BUKRS VALUE '1000',
                 BUKRS2 TYPE KNB1-BUKRS VALUE '1031',
                 Recs   Type i value '200',
                 B_count type i value '2'.
          INITIALIZATION
    INITIALIZATION.
      IF RASID IS INITIAL.
        SELECT * FROM TRAS.
          EXIT.
        ENDSELECT.
        IF SY-SUBRC = 0.
          RASID = TRAS-RASID.
        ENDIF.
      ENDIF.
    SELECTION-SCREEN
      parameters : p_path type rlgrap-filename default 'C:\Documents and Settings\C890971\Desktop\Credit_history.XLS'.
    Start of selection processing
    START-OF-SELECTION.
    **Get Customers for Co. Code 1000 & 1031.
      PERFORM GET_CUST.
    Get  / Compute Credit Information data for Company Codes 1000 & 1031.
      PERFORM GET_CREDIT_DATA.
    End of selection processing
    *END-OF-SELECTION.
    Listing Credit History Data
      PERFORM DOWNLOAD_CREDIT_DATA.
    S U B R O U T I N E S
    *&      Form  GET_CUST
          text
    -->  p1        text
    <--  p2        text
    FORM GET_CUST .
    Get US only Customers.
      Refresh icust.
      Select kunnr from kna1 appending table icust
                                   where Land1 = land.
    **Delete duplicate records
      Delete Adjacent duplicates from icust comparing kunnr.
      if icust[] is not initial.
       Limit the selection some more to Co. Code 1000 & 1031
      As join will cost overhead as compared.
      Select kunnr from knb1 into table icust1
                                  for all entries in icust
                                  where kunnr = icust-kunnr
                                  and   bukrs = bukrs1
                                  OR    bukrs = bukrs2.
    **Delete duplicate records
      Delete Adjacent duplicates from icust1 comparing kunnr.
       endif.
    **Free memory.
      Free icust.
    Credit Control Area
      select * from T001CM into table TCMTAB
                           where bukrs = bukrs1 OR
                                 bukrs = bukrs2.
    ENDFORM.                    " GET_CUST
    *&      Form  GET_CREDIT_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM GET_CREDIT_DATA .
      DATA : L_TEXT(60) TYPE C ,
             Ltext1(50) type C value 'Computing Credit-History Data For',
             Ltext2(10) type C value 'Customers',
             L_PCT type i value '10',
             L_recs type i,
             l_batch_recs type i,
             l_s_rec type i value 1,
             l_recs1(7) type N.
    ***Fetch data from KNKK table
      PERFORM GET_KNKK_DATA  .
    ***Computing Crredit Fields
    **Number of Customers For whom Deatils needed.
      Describe table I_CINFO lines l_recs.
      l_recs1 = l_recs.
      Concatenate Ltext1 l_recs1 Ltext2 into l_text separated by ' '.
      PERFORM GET_PGRESS_INDICATOR USING l_text l_pct.
    ***If records are more than 200000, should be processed  batch-wise
      If l_recs > recs.
        l_batch_recs = abs( l_recs / b_count ).
        Do b_count times.
          loop at i_cinfo INTO S_CINFO from l_S_REC to l_batch_recs.
    **Remember the row
            sytabix = sy-tabix.
    **Compute DSO
            PERFORM GET_DSO_FIELD .
    Compute rest credit history data.
            PERFORM COMPUTE_SFIELDS.
          endloop.
          l_S_REC = l_S_REC + l_batch_recs.
          l_batch_recs = l_batch_recs + l_batch_recs.
          IF l_batch_recs ge l_recs.
            l_batch_recs = l_recs.
          eNDIF.
    Commit up to here to release the DB locks.
          Commit work.
        enddo.
      else.
        loop at i_cinfo INTO S_CINFO.
    **Remember the row
          sytabix = sy-tabix.
    **Compute DSO
          PERFORM GET_DSO_FIELD .
    Compute rest credit history data.
          PERFORM COMPUTE_SFIELDS.
        endloop.
      Endif.
    ENDFORM.                    " GET_CREDIT_DATA
    *&      Form  GET_KNKK_DATA
          text
         -->P_ICUST_KUNNR  text
    FORM GET_KNKK_DATA .
      if icust1[] is not initial.
      SELECT   KUNNR KNKLI KKBER  CTLPC KLIMK
               SBGRP ERDAT DTREV REVDB
               from KNKK into corresponding fields of table I_Cinfo
               for all entries in icust1
               where kunnr = icust1-kunnr.
      Delete Adjacent duplicates from i_cinfo comparing kunnr.
      endif.
    **Free Memory for internal table icust1.
      Free icust1.
    ENDFORM.                    " GET_KNKK_DATA
    **&      Form  GET_DSO_FIELD
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DSO_FIELD .
    ***Determine DSO Parameter
      PERFORM DSO_PARAMETER.
    ***Compute DSO
      CALL FUNCTION 'CUSTOMER_DSO_CALCULATION'
        EXPORTING
          I_KKBER       = s_cinfo-kkber
          I_KUNNR       = s_cinfo-kunnr
          I_ANZBUPER    = T000CM-DSOPP
          I_XCHILDS     = T000CM-DSOCH
          I_ACTBALANCE  = T000CM-DSOAB
        IMPORTING
          E_DSOIN       = RF02L-DSOIN
        EXCEPTIONS
          ERROR_MESSAGE = 1.
    ENDFORM.                    " GET_DSO_FIELD
    *&      Form  DSO_PARAMETER
          text
    -->  p1        text
    <--  p2        text
    FORM DSO_PARAMETER.
      IF T000CM-DSOPP IS INITIAL.
        SELECT SINGLE * FROM T000CM.
        IF SY-SUBRC     EQ 0.
          IF T000CM-DSOPP IS INITIAL.
            T000CM-DSOPP = '003'.
          ENDIF.
        ELSE.
          T000CM-DSOPP = '003'.
          T000CM-DSOCH = ' '.
          T000CM-DSOAB = 'X'.
        ENDIF.
      ENDIF.
    ENDFORM.                    " DSO_PARAMETER
    -->  p1        text
    <--  p2        text
    FORM PERIODE_ERMITTELN_EXC USING
                P03_BUDAT    LIKE SYST-DATUM
                P03_GJAHR    LIKE KNC1-GJAHR
                P03_MONAT    LIKE MONAT.
      CALL FUNCTION 'FI_PERIOD_DETERMINE'
           EXPORTING
                I_BUDAT = P03_BUDAT
                I_PERIV = T001-PERIV
              I_BUKRS = T001-BUKRS
                I_GJAHR = P03_GJAHR
                I_MONAT = P03_MONAT
           IMPORTING
                E_GJAHR = P03_GJAHR
                E_MONAT = P03_MONAT
           EXCEPTIONS
                ERROR_MESSAGE = 1.
    ENDFORM.                    "PERIODE_ERMITTELN_EXC
    *&      Form  COMPUTE_SFIELDS
          text
    -->  p1        text
    <--  p2        text
    FORM COMPUTE_SFIELDS .
    **Compute Balance
      PERFORM GET_SFIELDS .
      S_CINFO-DSOIN = RF02L-DSOIN.
      S_CINFO-SALDO = RF035-SALDO.
      S_CINFO-H06SA = RF035-H06SA.
      S_CINFO-H06JA = RF035-H06JA.
      S_CINFO-H06MO = RF035-H06MO.
      S_CINFO-H12SA = RF035-H12SA.
      S_CINFO-H12JA = RF035-H12JA.
      S_CINFO-H12MO = RF035-H12MO.
      S_CINFO-UMP2U = RF42B-UMP2U.
      S_CINFO-UMP1U = RF42B-UMP1U.
      S_CINFO-SFAEL = RF035-SFAEL.
      S_CINFO-SFAE1 = RF035-SFAE1.
      S_CINFO-SFAE2 = RF035-SFAE2.
      S_CINFO-SFAE3 = RF035-SFAE3.
      S_CINFO-SFAE4 = RF035-SFAE4.
      S_CINFO-SFAE5 = RF035-SFAE5.
    modify..
      MODIFY I_CINFO FROM S_CINFO INDEX sytabix.
      CLEAR: S_CINFO,RF035,RF02L, RF42B.
    ENDFORM.                    " COMPUTE_SFIELDS
          text
         -->P_C_INFO_KUNNR  text
    FORM GET_CUST_BAL_INFO.
      LOOP AT TCMTAB.
        CALL FUNCTION 'FI_COMPANY_CODE_DATA'
          EXPORTING
            I_BUKRS       = TCMTAB-BUKRS
          IMPORTING
            E_T001        = T001
          EXCEPTIONS
            ERROR_MESSAGE = 1.
        IF SY-SUBRC = 0.
          MOVE-CORRESPONDING T001 TO BUKTAB.
          BUKTAB-KKBER = TCMTAB-KKBER.
          COLLECT BUKTAB.
        ENDIF.
      ENDLOOP.
      LOOP AT BUKTAB WHERE PERIV NE SPACE.
        GJATAB-PERIV = BUKTAB-PERIV.
        COLLECT GJATAB.
      ENDLOOP.
      CLEAR: MONAT.
      LOOP AT GJATAB.
        T001-PERIV = GJATAB-PERIV.
        CLEAR: GJAHR, MONAT.
        PERFORM PERIODE_ERMITTELN_EXC USING SY-DATLO GJAHR MONAT.
        CHECK SY-SUBRC = 0.
        GJATAB-GJAHR = GJAHR.
        GJATAB-MONAT = MONAT.
        SELECT SINGLE * FROM T009 WHERE PERIV = GJATAB-PERIV.
        IF SY-SUBRC = 0.
          GJATAB-ANZBP = T009-ANZBP.
        ENDIF.
        MODIFY GJATAB.
      ENDLOOP.
      LOOP AT BUKTAB.
        CHECK NOT ( BUKTAB-PERIV IS INITIAL ).
        READ TABLE GJATAB WITH KEY BUKTAB-PERIV.
        CHECK SY-SUBRC = 0
          AND NOT ( GJATAB-GJAHR IS INITIAL ).
        CALL FUNCTION 'CUSTOMER_BALANCE'
          EXPORTING
            KUNNR      = S_cinfo-kunnr
            BUKRS      = BUKTAB-BUKRS
            GJAHR      = GJATAB-GJAHR
            MONAT      = GJATAB-MONAT
            PERIV      = GJATAB-PERIV
            ANZBP      = GJATAB-ANZBP
            XH6MON     = 'X'
            XH12MON    = 'X'
          IMPORTING
            UMP2U      = RF42B-UMP2U
            VMP2U      = RF42B-UMP1U
            SALDO      = RF035-SALDO
            UML01      = SALDO-UML01
            UML02      = SALDO-UML02
            UML03      = SALDO-UML03
            UML04      = SALDO-UML04
            UML05      = SALDO-UML05
            UML06      = SALDO-UML06
            UML07      = SALDO-UML07
            UML08      = SALDO-UML08
            UML09      = SALDO-UML09
            UML10      = SALDO-UML10
            UML11      = SALDO-UML11
            UML12      = SALDO-UML12
          EXCEPTIONS
            NO_BALANCE = 4.
        IF SY-SUBRC = 0.
          SKNKK-UMP1U = SKNKK-UMP1U + RF42B-UMP1U.
          SKNKK-UMP2U = SKNKK-UMP2U + RF42B-UMP2U.
          SKNKK-SALDO = SKNKK-SALDO + RF035-SALDO.
          SKNKK-UML01 = SKNKK-UML01 + SALDO-UML01.
          SKNKK-UML02 = SKNKK-UML02 + SALDO-UML02.
          SKNKK-UML03 = SKNKK-UML03 + SALDO-UML03.
          SKNKK-UML04 = SKNKK-UML04 + SALDO-UML04.
          SKNKK-UML05 = SKNKK-UML05 + SALDO-UML05.
          SKNKK-UML06 = SKNKK-UML06 + SALDO-UML06.
          SKNKK-UML07 = SKNKK-UML07 + SALDO-UML07.
          SKNKK-UML08 = SKNKK-UML08 + SALDO-UML08.
          SKNKK-UML09 = SKNKK-UML09 + SALDO-UML09.
          SKNKK-UML10 = SKNKK-UML10 + SALDO-UML10.
          SKNKK-UML11 = SKNKK-UML11 + SALDO-UML11.
          SKNKK-UML12 = SKNKK-UML12 + SALDO-UML12.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "
    *&      Form  GET_SFIELDS
          text
    -->  p1        text
    <--  p2        text
    FORM GET_SFIELDS .
      sknkk-kunnr = S_CINFO-KUNNR.
    **Clear target to store computed values
      CLEAR: RF035.
    **Compute Balance fields
      PERFORM GET_CUST_BAL_INFO.
      REFRESH: SALTAB.
      SALTAB-LNUMM = '01'. SALTAB-SALDO = SKNKK-UML01. APPEND SALTAB.
      SALTAB-LNUMM = '02'. SALTAB-SALDO = SKNKK-UML02. APPEND SALTAB.
      SALTAB-LNUMM = '03'. SALTAB-SALDO = SKNKK-UML03. APPEND SALTAB.
      SALTAB-LNUMM = '04'. SALTAB-SALDO = SKNKK-UML04. APPEND SALTAB.
      SALTAB-LNUMM = '05'. SALTAB-SALDO = SKNKK-UML05. APPEND SALTAB.
      SALTAB-LNUMM = '06'. SALTAB-SALDO = SKNKK-UML06. APPEND SALTAB.
      SALTAB-LNUMM = '07'. SALTAB-SALDO = SKNKK-UML07. APPEND SALTAB.
      SALTAB-LNUMM = '08'. SALTAB-SALDO = SKNKK-UML08. APPEND SALTAB.
      SALTAB-LNUMM = '09'. SALTAB-SALDO = SKNKK-UML09. APPEND SALTAB.
      SALTAB-LNUMM = '10'. SALTAB-SALDO = SKNKK-UML10. APPEND SALTAB.
      SALTAB-LNUMM = '11'. SALTAB-SALDO = SKNKK-UML11. APPEND SALTAB.
      SALTAB-LNUMM = '12'. SALTAB-SALDO = SKNKK-UML12. APPEND SALTAB.
      READ TABLE SALTAB INDEX 1.
      RF035-H06SA = SALTAB-SALDO.
      RF035-H06MO = SALTAB-LNUMM.
      RF035-H12SA = SALTAB-SALDO.
      RF035-H12MO = SALTAB-LNUMM.
    ------ SALTAB ---------------------------------------------
      LOOP AT SALTAB.
        IF  SALTAB-SALDO > RF035-H06SA
        AND SY-TABIX     < 7.
          RF035-H06SA = SALTAB-SALDO.
          RF035-H06MO = SALTAB-LNUMM.
        ENDIF.
        IF  SALTAB-SALDO > RF035-H12SA
        AND SY-TABIX     < 13.
          RF035-H12SA = SALTAB-SALDO.
          RF035-H12MO = SALTAB-LNUMM.
        ENDIF.
      ENDLOOP.
    ------ Period--------------------
      REFRESH LT_PERIODS.
      CLEAR LD_COUNTER.
      READ TABLE BUKTAB INDEX 1.
      IF SY-SUBRC = 0.
        READ TABLE GJATAB WITH KEY BUKTAB-PERIV.
        DO GJATAB-MONAT TIMES
           VARYING LD_PERIOD FROM LD_PERIODS(2) NEXT LD_PERIODS+2(2)
                                                     RANGE LD_PERIODS.
          LT_PERIODS-GJAHR  = GJATAB-GJAHR.
          LT_PERIODS-PERIOD = LD_PERIOD.
          LD_COUNTER = LD_COUNTER + 1.
          APPEND LT_PERIODS.
        ENDDO.
        IF LD_COUNTER LT 12.
          LD_GJAHR = GJATAB-GJAHR - 1.
          CLEAR T009Y.
          SELECT SINGLE * FROM T009Y WHERE PERIV = GJATAB-PERIV
                                       AND GJAHR = LD_GJAHR.
          DO GJATAB-ANZBP TIMES
             VARYING LD_PERIOD FROM LD_PERIODS(2) NEXT LD_PERIODS+2(2)
                                                       RANGE LD_PERIODS.
            IF T009Y-ANZBP > 0.
              CHECK SY-INDEX <= T009Y-ANZBP.
            ENDIF.
            LD_COUNTER = LD_COUNTER + 1.
            LT_PERIODS-GJAHR  = LD_GJAHR.
            LT_PERIODS-PERIOD = LD_PERIOD.
            APPEND LT_PERIODS.
          ENDDO.
        ENDIF.
        IF LD_COUNTER LT 12.
          LD_GJAHR = LD_GJAHR - 1.
          DO GJATAB-ANZBP TIMES
             VARYING LD_PERIOD FROM LD_PERIODS(2) NEXT LD_PERIODS+2(2)
                                                       RANGE LD_PERIODS.
            LD_COUNTER = LD_COUNTER + 1.
            LT_PERIODS-GJAHR  = LD_GJAHR.
            LT_PERIODS-PERIOD = LD_PERIOD.
            APPEND LT_PERIODS.
          ENDDO.
        ENDIF.
        SORT LT_PERIODS BY GJAHR ASCENDING PERIOD ASCENDING.
        LD_COUNTER = LD_COUNTER - 12.
        DO LD_COUNTER TIMES.
          DELETE LT_PERIODS INDEX 1.
        ENDDO.
        SORT LT_PERIODS BY GJAHR DESCENDING PERIOD DESCENDING.
        READ TABLE LT_PERIODS INDEX RF035-H06MO.
        RF035-H06MO = LT_PERIODS-PERIOD.
        RF035-H06JA = LT_PERIODS-GJAHR.
        READ TABLE LT_PERIODS INDEX RF035-H12MO.
        RF035-H12MO = LT_PERIODS-PERIOD.
        RF035-H12JA = LT_PERIODS-GJAHR.
      ENDIF.
    **Compute Due Dates fields
      PERFORM GET_AGING_BUCKETS .
      RF035-SFAE1 = SKNKK-SFAE1.
      RF035-SFAE2 = SKNKK-SFAE2.
      RF035-SFAE3 = SKNKK-SFAE3.
      RF035-SFAE4 = SKNKK-SFAE4 .
      RF035-SFAE5 = SKNKK-SFAE5.
    ENDLOOP.
    ENDFORM.                    " GET_BALANCE_SFIELDS
    *&      Form  GET_AGING_BUCKETS
          text
    -->  p1        text
    <--  p2        text
    FORM GET_AGING_BUCKETS .
      DATA: BEGIN OF LT_BUKRS OCCURS 0,
              BUKRS LIKE T001-BUKRS,
            END OF LT_BUKRS.
      DATA: BEGIN OF LT_BUKTAB OCCURS 0,
              BUKRS LIKE T001-BUKRS,
              WAERS LIKE T001-WAERS,
              KKBER LIKE T014-KKBER,
            END OF LT_BUKTAB.
      DATA: LD_LINES LIKE SY-TABIX.
    *...performance optimization: for more than one company codes check....*
    *...if balances exist and avoid selection of open items, if they don't.*
    *...exist..............................................................*
      REFRESH LT_BUKRS.
      REFRESH LT_BUKTAB.
      DESCRIBE TABLE BUKTAB LINES LD_LINES.
      IF LD_LINES GT 1.
        SELECT DISTINCT BUKRS APPENDING CORRESPONDING FIELDS
                                        OF TABLE LT_BUKRS
                              FROM KNC1 FOR ALL ENTRIES IN BUKTAB
                        WHERE BUKRS = BUKTAB-BUKRS AND
                              KUNNR = Sknkk-KUNNR.
        SELECT DISTINCT BUKRS APPENDING CORRESPONDING FIELDS
                                        OF TABLE LT_BUKRS
                              FROM KNC3 FOR ALL ENTRIES IN BUKTAB
                        WHERE BUKRS = BUKTAB-BUKRS AND
                              KUNNR = Sknkk-KUNNR.
        SORT LT_BUKRS.
        DELETE ADJACENT DUPLICATES FROM LT_BUKRS.
        LOOP AT LT_BUKRS.
          LOOP AT BUKTAB WHERE BUKRS = LT_BUKRS-BUKRS.
            MOVE-CORRESPONDING BUKTAB TO LT_BUKTAB.
            APPEND LT_BUKTAB.
          ENDLOOP.
        ENDLOOP.
      ELSE.
        READ TABLE BUKTAB INDEX 1.
        MOVE-CORRESPONDING BUKTAB TO LT_BUKTAB.
        APPEND LT_BUKTAB.
      ENDIF.
    *...process company codes for customer given by interface..........*
      LOOP AT LT_BUKTAB WHERE KKBER = s_cinfo-KKBER.
        CALL FUNCTION  'CUSTOMER_DUE_DATE_ANALYSIS'
             EXPORTING  BUKRS   = LT_BUKTAB-BUKRS
                       KKBER   = ' '
                        KKBER   = s_cinfo-KKBER
                        KUNNR   = Sknkk-KUNNR
                        RASID   = RASID
             IMPORTING  SFAE1   = RF035-SFAE1
                        SFAE2   = RF035-SFAE2
                        SFAE3   = RF035-SFAE3
                        SFAE4   = RF035-SFAE4
                        SFAE5   = RF035-SFAE5
                        SFAEL   = RF035-SFAEL
             EXCEPTIONS NO_OPEN_ITEMS = 4.
        IF SY-SUBRC = 0.
    *--  RF035 -
          SKNKK-SFAE1 = SKNKK-SFAE1 + RF035-SFAE1.
          SKNKK-SFAE2 = SKNKK-SFAE2 + RF035-SFAE2.
          SKNKK-SFAE3 = SKNKK-SFAE3 + RF035-SFAE3.
          SKNKK-SFAE4 = SKNKK-SFAE4 + RF035-SFAE4.
          SKNKK-SFAE5 = SKNKK-SFAE5 + RF035-SFAE5.
          SKNKK-SFAE5 = SKNKK-SFAE5 + RF035-SFAE5.
          SKNKK-SFAEL = SKNKK-SFAEL + RF035-SFAEL.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " GET_AGING_BUCKETS
    *&      Form  header
    This Subroutine gets data for displaying title                     *
    There are no interface parameters to be passed to this subroutine. *
    FORM header .
      wa_final-string = text-000.  APPEND wa_final TO i_final.
      wa_final-string = text-001.  APPEND wa_final TO i_final.
      wa_final-string = text-002.  APPEND wa_final TO i_final.
      wa_final-string = text-003.  APPEND wa_final TO i_final.
      wa_final-string = text-004.  APPEND wa_final TO i_final.
      wa_final-string = text-005.  APPEND wa_final TO i_final.
      wa_final-string = text-006.  APPEND wa_final TO i_final.
      wa_final-string = text-007.  APPEND wa_final TO i_final.
      wa_final-string = text-008.  APPEND wa_final TO i_final.
      wa_final-string = text-009.  APPEND wa_final TO i_final.
      wa_final-string = text-010.  APPEND wa_final TO i_final.
      wa_final-string = text-011.  APPEND wa_final TO i_final.
      wa_final-string = text-012.  APPEND wa_final TO i_final.
      wa_final-string = text-013.  APPEND wa_final TO i_final.
      wa_final-string = text-014.  APPEND wa_final TO i_final.
      wa_final-string = text-015.  APPEND wa_final TO i_final.
      wa_final-string = text-016.  APPEND wa_final TO i_final.
      wa_final-string = text-017.  APPEND wa_final TO i_final.
      wa_final-string = text-018.  APPEND wa_final TO i_final.
      wa_final-string = text-019.  APPEND wa_final TO i_final.
      wa_final-string = text-020.  APPEND wa_final TO i_final.
      wa_final-string = text-021.  APPEND wa_final TO i_final.
      wa_final-string = text-022.  APPEND wa_final TO i_final.
      wa_final-string = text-023.  APPEND wa_final TO i_final.
      wa_final-string = text-024.  APPEND wa_final TO i_final.
    ENDFORM.                               " header
    *&      Form  DOWNLOADCREDITDATA
          text
         -->P_P_PATH  text
    FORM DOWNLOADCREDITDATA  USING P_PATH.
      DATA:
          lw_file2 TYPE string .           " File Path
      lw_file2 = p_PATH.
      CALL FUNCTION 'GUI_DOWNLOAD'
         EXPORTING
      BIN_FILESIZE                    = BIN_FILESIZE
           filename                        = lw_file2
           filetype                        = 'DBF'
      APPEND                          = ' '
       write_field_separator           = ' '
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = 'X'
      WRITE_LF                        = 'X'
       COL_SELECT                      = 'X'
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = 'X'
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = '0'
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      = FILELENGTH
         TABLES
           data_tab                        = I_CINFO
           fieldnames                      = i_final
         EXCEPTIONS
           file_write_error                = 1
           no_batch                        = 2
           gui_refuse_filetransfer         = 3
           invalid_type                    = 4
           no_authority                    = 5
           unknown_error                   = 6
           header_not_allowed              = 7
           separator_not_allowed           = 8
           filesize_not_allowed            = 9
           header_too_long                 = 10
           dp_error_create                 = 11
           dp_error_send                   = 12
           dp_error_write                  = 13
           unknown_dp_error                = 14
           access_denied                   = 15
           dp_out_of_memory                = 16
           disk_full                       = 17
           dp_timeout                      = 18
           file_not_found                  = 19
           dataprovider_exception          = 20
           control_flush_error             = 21
      IF sy-subrc <> 0.
    Messege
      ENDIF.                               " IF sy-subrc EQ 0
    ENDFORM.                    " DOWNLOADCREDITDATA
    *&      Form  DOWNLOAD_CREDIT_DATA
          text
    -->  p1        text
    <--  p2        text
    FORM DOWNLOAD_CREDIT_DATA .
      PERFORM HEADER.
      PERFORM DOWNLOADCREDITDATA USING P_PATH.
    ENDFORM.                    " DOWNLOAD_CREDIT_DATA
    *&      Form  GET_PGRESS_INDICATOR
          text
         -->P_L_TEXT  text
         -->P_L_PCT  text
    FORM GET_PGRESS_INDICATOR  USING    L_TEXT
                                        L_PCT.
      CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
        EXPORTING
          PERCENTAGE = l_pct
          TEXT       = l_TEXT.
    ENDFORM.                    " GET_PGRESS_INDICATOR

    If you are just Downloading to a Flat file then why dont you have logic in place for the program to dump the data read into  the file to that point depending on any criteria like accounts or customer then clear the internal table and run it in the back ground.
    try to use cursor to read the records from the table which will make it a bit more efficient than plain select stement.

  • Time out error while executing BW query from SRST

    Hello Experts,
    While running a query from SRST t-code im getting time out dump.
    Is there any possibility to run the query in background to avoid dumps, apart from taking the report and executing from SE 38
    Regards,
    Arjun Reddy.

    Hi,
    Your target may have huge and report may be trying to extract whole data.
    please try to your report with some selections/filters and check it.
    it may work.
    Thanks

  • Time out error in POWL query

    Hello Experts,
    The user selected Purchase Order  ALL and ran the query with wild search, it contains around 40K POs showing in Active query list.  When he wants to access these POs by cliking on hyper link ALL (40451).  Its going to Time out error, because requestor number is missing.
    Kindly throgh some light how to clear this filter.
    Highly appreciated for prompt responses.
    Regards,
    Suneel Kumar

    Hi Poonam Patil,
    Try to provide BELNR and GJAHR in where condition...
    BKPF-DBBLG ==> BSAK-BELNR
    Also check
    BKPF-BLDAT ==> BSAK-AUGDT
    Check out above relation...
    If data is there in these fields of the table and both are matching then you can pass it and as they are in primary key of BSAK it will improve the performance...
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • Select count(*) cause time out error

    I invoke the following statement:
    select count(*) as total from table1
    where table1 is large(30000 rows), total size of the database is more than 20GB.
    The above statement will cause time out error. How to solve the problem?

    Hallo chcw,
    a timeout in a table with 30.000 records is very unusual (for a simple SELECT COUNT). From my point of view Dan is on the right way and you will have a typical blocking scenario.
    1. if you have LOBs they won't be part of a SELECT COUNT (either its a heap of a clustered index)
    2. Microosft SQL Server will ALWAYS use the smallest index for such a simple SELECT
    3. if it is a heap you will run into a blocking scenario if someone is updating records and transaction has not committed.
    4. Check the isolation level of the transactions - but I expect the standard which is "read committed".
    Just a demonstration of "SELECT COUNT" will work whether it is a clustered index or a heap. The next script will create a heap with a LOB and additional attributes:
    CREATE TABLE dbo.foo
    Id INT NOT NULL IDENTITY(1,1),
    n1 INT NOT NULL,
    n2 SMALLINT NULL,
    c1 CHAR(250) NOT NULL,
    c2 CHAR(250) NULL,
    c3 VARCHAR(MAX) NOT NULL DEFAULT (REPLICATE('A', 15000))
    GO
    Now we enter 30,000 records into the table
    SET NOCOUNT ON;
    DECLARE @i INT = 1;
    WHILE @i <= 30000
    BEGIN
    INSERT INTO dbo.foo (n1, c1) VALUES (@i, 'Just a filler');
    SET @i += 1;
    END
    GO
    Keep in mind that we have a HEAP and NO indexes! To check the IO i use the following command befor any of the following examples:
    SET STATISTICS IO ON;
    GO
    Let's start with a first try and you will check as a result the produced IO depending on the affected table partitions:
    -- USE SELECT in a HEAP
    SELECT COUNT(*) FROM dbo.foo;
    GO
    Output:
    Table 'foo'. Scan count 1, logical reads 2508, ..., lob logical reads 0,
    As you can see from the result the LOB-data won't be attached only the "in-row-data" are affected (which are stored in 2508 pages. The reason is a quite simple one: Microsoft SQL Server uses different allocation units for in-row-data and LOB
    SELECT p.object_id, p.index_id, p.rows, au.total_pages
    FROM sys.partitions AS P INNER JOIN sys.allocation_units AS AU
    ON(p.partition_id = au.container_id)
    WHERE object_id = OBJECT_ID('dbo.foo');
    Now I create a simple index on the column n1 which is an INT-datatype
    SELECT p.object_id, p.index_id, p.rows, au.total_pages
    FROM sys.partitions AS P INNER JOIN sys.allocation_units AS AU
    ON(p.partition_id = au.container_id)
    WHERE object_id = OBJECT_ID('dbo.foo');
    and run the SELECT COUNT again with the following IO-output:
    Table 'foo'. Scan count 1, logical reads 69, ...
    WOW - only 69 pages have to be read. The explanation is a quite simple one - now we have an index which is quite small. Microsoft SQL Server WILL use the smallest index of a table to scan the number of records. Let's try it again with n2 which is a smallint
    (2 bytes)
    CREATE NONCLUSTERED INDEX ix_foo_n2 ON dbo.foo (n2);
    GO
    The IO will be 62 (or less) because MORE index records a fitting to one data page!
    Conclusion is that either you have small record size or long record size - The query optimizer will always use the smallest index for the execution (that's maybe why Visahk has asked for the execution plan).
    I don't believe it is because of the "huge amount of data" but - as Dan has pointed out - it HAS TO BE a blocking scenario which can have multiple reasons. For demonstration of a blocking scenario open SSMS and start in the query windows with the following
    command(s):
    BEGIN TRANSACTION
    UPDATE dbo.foo
    SET c1 = 'This is my name'
    WHERE Id = 10000;
    -- What locks do we have now in the database
    SELECT resource_description,
    resource_associated_entity_id,
    request_mode,
    request_type
    FROM sys.dm_tran_locks AS DTL
    WHERE resource_database_id = DB_ID() AND
    resource_type != 'DATABASE';
    Your result should look like that (with differences in the entity_id and resource descriptions :)
    The above pic demonstrates the "locking chain". As you can see the slot 7 on PAGE 82400 has an exclusive lock. This means that NO OTHER request can currently obtain another lock to it!
    Now open a second query window and run a SELECT COUNT... - it will not finish!
    The reason is that the second requests has to wait for the release of the locked resources by the first transaction! Leave the statement and change back to the first transaction and finish the transaction by cancellation of the query. In the moment the locks
    have been released the second query will finish immediate.
    So - from my point of view - Dan has given the correct answer. Against wide spreaded statements a heap won't block the whole table exclusivly but - as in a cluster, too - only the row itself (see the 7 which is the slot where the record exists).
    MCM - SQL Server 2008
    MCSE - SQL Server 2012
    db Berater GmbH
    SQL Server Blog (german only)

  • Transaction Time out error in EJB while using Websphere Application Server.

    Hi All,
    I am using Websphere Application server and getting the transaction time out error. By default the transaction time out is 120 second. I am using session bean for doing a set of transaction. These set are dynamically generated. Is there any way to set the transaction time out for only this session bean to infinite ?
    Thanks in advance
    Vivek

    Hi,
    According to WAS 6 , every opened connection has to be commited (or rolledback) explicitly (didnt try autocommit) before closing. Even if all you have done with that connection is a SELECT Query.
    This has apparently solved the same problem I was getting. implement it and see whether it helps you.

  • Time Out error problem when i run the report for the whole plant

    Dear all,
    pls find the below coding, when i execute this report for the whole plant , it gives me time out error since it has to process huge database. pls suggest me in which part of my below coding i can improvise or any other better way to fetch the same result.
    pls note that
    i m using Views for querying.pls also note the comments given in Bold to understand the reason behind the coding.
    Views used in are - ZVPOD and ZVPRDCONF.
    START-OF-SELECTION.
      Data: zstat type jest-stat.
      data: stklocaf type mska-lgort.
      data: stklocas type mska-lgort.
    <u><b>To collect the status of the production order by joining the ZVPOD and JEST table.</b></u>
      CLEAR it_ZVPRODDET.
      SELECT DISTINCT ZVPOD~bukrs ZVPOD~aufnr ZVPOD~objnr
      jest~stat ZVPOD~werks ZVPOD~arbpl ZVPOD~J_3AKORD2
      FROM  ZVPOD
      INNER JOIN jest ON ZVPOD~objnr = jest~objnr
      INTO CORRESPONDING FIELDS OF wa_ZVPRODDET where
      plnbez in FGM and arbpl in wc and werks in plant
      and SSAVD in eldate
      and J_3AKORD2 in cups and jest~inact ne 'X'.
        APPEND wa_ZVPRODDET TO it_ZVPRODDET.
      ENDSELECT.
      SORT it_ZVPRODDET BY aufnr stat.
    <u><b>Loop thru Itab to check and delete the records from itab for the specified status.</b></u>
      LOOP AT it_ZVPRODDET INTO wa_ZVPRODDET.
        IF wa_ZVPRODDET-stat = 'I0045' .  " TECO - compl
          DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr.
        ELSEIF wa_ZVPRODDET-stat = 'I0009' .  " CNF - Confirmed
          DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr.
        ELSEIF wa_ZVPRODDET-stat = 'I0012' .  " DLV - Delivered
          DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr.
        ELSEIF wa_ZVPRODDET-stat = 'I0046' .  " CLSD - Closed
          DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr.
        ELSEIF wa_ZVPRODDET-stat = 'I0076' .  " DLFL - Del Flag
          DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr.
        ELSEIF wa_ZVPRODDET-stat = 'E0003' .  " SCLS - Short Close
          CLEAR tj30t.
          SELECT SINGLE txt04
          FROM tj30t INTO tj30t-txt04
          WHERE stsma = 'PRDHOLD' AND
                estat = 'E0003' AND
                txt04 = 'SCLS' AND
                spras = 'EN'.
          IF sy-subrc = 0.
            DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr.
          ENDIF.
        ENDIF.
    *      Condition for Prod Order released - REL
        IF wa_ZVPRODDET-stat = 'I0002'.
          mreleased = 'Y'.
        else.
          mreleased = 'N'.
        endif.
        zstat = wa_ZVPRODDET-stat.
        IF mreleased = 'N'.
          DELETE it_ZVPRODDET WHERE aufnr = wa_ZVPRODDET-aufnr
          and stat = zstat.
        ENDIF.
      ENDLOOP.
    <u><b>Loop thru the filtered ITAB to get all the production order details for the production order number specified in the where clause( zaufnr ) and populate another internal table.</b></u>
          LOOP AT it_ZVPRODDET INTO wa_ZVPRODDET.
            zaufnr = wa_zvproddet-aufnr.
            zarbid = wa_zvproddet-arbid.
            at new aufnr.
              SELECT DISTINCT * INTO CORRESPONDING FIELDS OF  walnpln
              FROM zvpod where plnbez in FGM and arbpl in wc and SSAVD in
             eldate and werks in plant and J_3AKORD2 in cups and aufnr = zaufnr.
                APPEND walnpln TO itablnpln.
              endselect.
            endat.
          endloop.
          clear walnpln.
    <u><b>
    Looping thru Internal table and performs all the following calculations and inner loop
    and also relevant querying.</b></u>
    <u><b>Assume that ITABLNPLN holds appox. 8000 records.</b></u>
    LOOP AT itablnpln  INTO walnpln.
            contot = 0.
            SELECT distinct * INTO CORRESPONDING FIELDS OF TABLE itablnp
            FROM zvprdconf where aufnr = walnpln-aufnr and
            j_3asize = walnpln-j_3akordx and stzhl ne '2' and stokz ne 'X'.
            clear zvprdconf.
            SELECT single isdd
            FROM zvprdconf into  zvprdconf-isdd
            where aufnr = walnpln-aufnr and
            j_3asize = walnpln-j_3akordx and stzhl ne '2' and stokz ne 'X'.
            SELECT single isdz
            FROM zvprdconf into  zvprdconf-isdz
            where aufnr = walnpln-aufnr and
            j_3asize = walnpln-j_3akordx and stzhl ne '2' and stokz ne 'X'.
            IF sy-subrc EQ 0.
              <u><b>Assume that ITABLNP  holds appox. 30 records.</b></u>
              loop at itablnp into walnp.
                contot = contot + walnp-J_3ALMNGA.
                move walnp-J_3ASIZE to walnpln-J_3ASIZE.
                move zvprdconf-isdd to walnpln-zdate.
                move zvprdconf-isdz to walnpln-ztime.
              endloop.
              walnpln-output = contot.
            endif.
            walnpln-wip = walnpln-menge - contot.
            if walnpln-werks = '1000'.
              stklocaf = '1050'.
              stklocas = '1060'.
            elseif walnpln-werks = '2000'.
              stklocaf = '2150'.
              stklocas = '2160'.
            endif.
           select single kunnr into walnpln-ship from vbpa where
           vbeln = walnpln-KDAUF and PARVW = 'WE'.
            zship = walnpln-ship.
            move zship to walnpln-ship.
            select  single kalab into walnpln-zactqty from mska
            where matnr = walnpln-plnbez
            and j_3asize = walnpln-J_3AKORDX and LGORT = stklocaf.
            condense walnpln-kdauf.
            zsales = walnpln-kdauf.
            concatenate zsales 'S' into zso.
            select single kalab into walnpln-zsndqty from mska
            where matnr = walnpln-plnbez
            and j_3asize = walnpln-J_3AKORDX and LGORT = stklocas
            and J_4KSCAT = zso.
            zmatn = walnpln-plnbez.
            zsale = walnpln-KDAUF.
            walnpln-kdauf = zsale.
            walnpln-plnbez = zmatn.
            zcust = walnpln-kunnr.
            walnpln-kunnr = zcust.
            select single bezei into walnpln-season from TVV2T where
            kvgr2 = walnpln-kvgr2 and SPRAS = 'E'.
            select single bezei into walnpln-shipmode from T173T where
            vsart = walnpln-vsart and SPRAS = 'E'.
            STRL = strlen( walnpln-j_3akord2 ).
            if  strl = 4.
              move walnpln-j_3akord2 to walnpln-j_3akord3.
              clear walnpln-j_3akord2.
            endif.
            move zremk to walnpln-remk.
            MODIFY itablnpln FROM  walnpln.
            contot = 0.
            clear itablnp.
          ENDLOOP.
          PERFORM build_fieldcatalog.
          PERFORM build_layout.
          PERFORM display_alv_report.

    Hi raja,
    Plese go through the suggessitions.
    1.avoide the select ...endselect. write the below select
    CLEAR IT_ZVPRODDET.
    SELECT DISTINCT
         ZVPOD~BUKRS
         ZVPOD~AUFNR
         ZVPOD~OBJNR
         JEST~STAT
         ZVPOD~WERKS
         ZVPOD~ARBPL
         ZVPOD~J_3AKORD2
      FROM ZVPOD
      INNER JOIN JEST ON ZVPOD~OBJNR = JEST~OBJNR
      INTO CORRESPONDING FIELDS TABLE  IT_ZVPRODDET
      WHERE PLNBEZ IN FGM AND
            ARBPL IN WC AND
            WERKS IN PLANT AND
            SSAVD IN ELDATE AND
            J_3AKORD2 IN CUPS AND
            JEST~INACT NE 'X'.
      IF SY-SUBRC = 0.
        SORT TABLE IT_ZVPRODDET.
      ENDIF.
    2..first of all dont delete a record inside the loop. instead use the Field symobols.
    have u obsereved you code in the loop!!!!. wht u r doing..
    u r removing the same record which u in the loop..
    If u wanto delete the entires with check to<b> stat</b>... <b>then.. why dont u put the STAT field in Wher e condition..?</b> by this you reduce the data base select time..
    Now the select query is like the below....
    CLEAR IT_ZVPRODDET.
    SELECT DISTINCT
         ZVPOD~BUKRS
         ZVPOD~AUFNR
         ZVPOD~OBJNR
         JEST~STAT
         ZVPOD~WERKS
         ZVPOD~ARBPL
         ZVPOD~J_3AKORD2
      FROM ZVPOD
      INNER JOIN JEST ON ZVPOD~OBJNR = JEST~OBJNR
      INTO CORRESPONDING FIELDS TABLE  IT_ZVPRODDET
      WHERE PLNBEZ IN FGM AND
            ARBPL IN WC AND
            WERKS IN PLANT AND
            SSAVD IN ELDATE AND
            J_3AKORD2 IN CUPS AND
            JEST~INACT NE 'X' AND
            ( STAT <> 'I0045' AND
              STAT <> 'I0045' AND
              STAT <> 'I0009' AND
              STAT <> 'I0012' AND
              STAT <> 'I0046' AND
              STAT <> 'I0076' AND
              STAT <> 'E0003' ).
      IF SY-SUBRC = 0.
        SORT TABLE IT_ZVPRODDET.
      ENDIF.
    <b>3.</b> WHT IS MEANING OF THE SELECT
    <b>  CLEAR TJ30T.
      SELECT SINGLE TXT04
      FROM TJ30T INTO TJ30T-TXT04
      WHERE STSMA = 'PRDHOLD' AND
            ESTAT = 'E0003' AND
            TXT04 = 'SCLS' AND
            SPRAS = 'EN'.
      IF SY-SUBRC = 0.
        DELETE IT_ZVPRODDET WHERE AUFNR = WA_ZVPRODDET-AUFNR.
      ENDIF.</b>....... IN WHERE CONDION U R GIven all are constant values right?..
    why u need select it inside the loop.. u can write before the SELECT from ZVPOD..
    that why first checke this field then go for fur thure selects..
    <b>now u r code looks like this....</b>
    CLEAR TJ30T.
    SELECT SINGLE TXT04
      FROM TJ30T INTO TJ30T-TXT04
    WHERE STSMA = 'PRDHOLD' AND
          ESTAT = 'E0003' AND
          TXT04 = 'SCLS' AND
          SPRAS = 'EN'.
    IF SY-SUBRC = 0.
      CLEAR IT_ZVPRODDET.
      SELECT DISTINCT
           ZVPOD~BUKRS
           ZVPOD~AUFNR
           ZVPOD~OBJNR
           JEST~STAT
           ZVPOD~WERKS
           ZVPOD~ARBPL
           ZVPOD~J_3AKORD2
        FROM ZVPOD
        INNER JOIN JEST ON ZVPOD~OBJNR = JEST~OBJNR
        INTO CORRESPONDING FIELDS TABLE  IT_ZVPRODDET
        WHERE PLNBEZ IN FGM AND
              ARBPL IN WC AND
              WERKS IN PLANT AND
              SSAVD IN ELDATE AND
              J_3AKORD2 IN CUPS AND
              JEST~INACT NE 'X' AND
              JEST~STAT <> 'I0045' AND
              JEST~STAT <> 'I0045' AND
              JEST~STAT <> 'I0009' AND
              JEST~STAT <> 'I0012' AND
              JEST~STAT <> 'I0046' AND
              JEST~STAT <> 'I0076' AND
              JEST~STAT <> 'E0003' ).
        IF SY-SUBRC = 0.
          SORT TABLE IT_ZVPRODDET.
        ENDIF.
      ENDIF.
    there are so many select inside the loop...... please Delete all of them.... write them be for the loop.......using the FOR ALL ENTRIES.....
    THEN LOOP THE TABLE USING THE WHERE CONDITIONS.
    <b>Plese write u updated code here again</b>..

  • Time out error while fetching records from table BKPF

    Hi,
    I am fetching records from table BKPF using BUKRS & AWKEY in where clause. Query is as follows:
        SELECT BELNR  XBLNR  AWKEY
        FROM   BKPF
        INTO TABLE L_I_BKPF_TEMP
        PACKAGE SIZE 500
        WHERE BUKRS LIKE L_C_EG
        AND   AWKEY IN L_R_AWKEY .
          APPEND LINES OF L_I_BKPF_TEMP TO I_BKPF .
        ENDSELECT .
    Program is giving time out error. There are 25628 records in range L_R_AWKEY , i m fetching 500 records at a time using  PACKAGE SIZE. But the execution of prog stops on this query.
    Please suggest something to overcome this problem.

    Hi
    Rui is right,
    if you need to get the data by  operation parameters u have to use the fields AWTYP and AWKEY.
    In this selection u can omit the company code.
    SELECT BELNR XBLNR AWKEY FROM BKPF
           INTO TABLE L_I_BKPF_TEMP
                 PACKAGE SIZE 500
                      WHERE   AWTYP = <......> "<------------
                             AND AWKEY IN L_R_AWKEY .
           APPEND LINES OF L_I_BKPF_TEMP TO I_BKPF .
    ENDSELECT .
    Max

  • Time Out error : Its urgent

    Hi ,
    The scenario is that I am running a Process chain in which there is a loading process . In that process if data loading takes more than 1 hour it gives time out error . in ST22  , but in Sm37 it is active. Moreover in scheduler , the time is set to 2 hrs.
    What is happening ? can any one please explain . what should I do to get rid of time out error ? can we set time in update rule as in scheduler ?
    Please help me ...

    Hi Rajib,
    In your case even if you set the time out time in scheduler it takes the default work process settings.  Which you can see in the Parameter rdisp/max_wprun_time
    at RZ10 transaction and select Instance profile.  Even if the job is in active in sm37 it doesn't progress further when there is a timeout recorded.  Try to get intouch with you BASIS guys and get the parameter settings to 2 hours.  which may require server reboot.
    Hope it helps.
    Regards,
    Srikanth.

  • Report Taking Long time Results time out error.

    Hi Gurus.
    We have a report called Material Variances...
    When my user is executing the report its taking morethan 40 mins and resulting in error " Time Out Error ".
    But when we executing the report with same selections its opening in 5 mins.
    can any one has faced the same issue...
    Thanks in advance for your replies.
    Regards.
    Cna

    Hi,
    You can check InfoCube 0TCT_C02. It will provide information about the execution of the query.
    Right click on Infocube -> Display data -> input the query you want to check in field Query runtime Object->Input the user that executed the query and faces problems
    The Infocube will display information about the query execution like how long the database selection took, how long the OLAP processor lasted, etc.
    Important:
    BI Statistics have to be activeted in the system in order fot the Infocube to display data
    Regards,

  • Performance issue in Report (getting time out error)

    Hi experts,
    I am doing Performance for a Report (getting time out error)
    Please see the code below and .
    while looping internal table IVBAP after 25 minutes its showing  time out error at this poit ->
    SELECT MAX( ERDAT ) .
    please send alternate code for this .
    Advance thanks
    from
    Nagendra
    Get Sales Order Details
    CLEAR IVBAP.
    REFRESH IVBAP.
    SELECT VBELN POSNR MATNR NETWR KWMENG WERKS FROM VBAP
       INTO CORRESPONDING FIELDS OF TABLE IVBAP
         FOR ALL ENTRIES IN IVBAK
           WHERE VBELN =  IVBAK-VBELN
           AND   MATNR IN Z_MATNR
           AND   WERKS IN Z_WERKS
           AND   ABGRU = ' '.
    Check for Obsolete Materials - Get Product Hierarhy/Mat'l Description
      SORT IVBAP BY MATNR WERKS.
      CLEAR: WK_MATNR, WK_WERKS, WK_PRDHA, WK_MAKTX,
             WK_BLOCK, WK_MMSTA, WK_MSTAE.
      LOOP AT IVBAP.
          CLEAR WK_INVDATE.                                   "I6677.sn
          SELECT MAX( ERDAT ) FROM VBRP INTO WK_INVDATE WHERE
          AUBEL EQ IVBAP-VBELN AND
          AUPOS EQ IVBAP-POSNR.
          IF SY-SUBRC = 0.
              MOVE WK_INVDATE TO IVBAP-INVDT.
              MODIFY IVBAP.
          ENDIF.                                               "I6677.e n
          SELECT SINGLE * FROM MBEW WHERE             "I6759.sn
          MATNR EQ IVBAP-MATNR AND
          BWKEY EQ IVBAP-WERKS AND
          BWTAR EQ SPACE.
          IF SY-SUBRC = 0.
             MOVE MBEW-STPRS TO IVBAP-STPRS.
             IVBAP-TOT = MBEW-STPRS * IVBAP-KWMENG.
             MODIFY IVBAP.
          ENDIF.                                      "I6759.en
        IF IVBAP-MATNR NE WK_MATNR OR IVBAP-WERKS NE WK_WERKS.
          CLEAR: WK_BLOCK, WK_MMSTA, WK_MSTAE, WK_PRDHA, WK_MAKTX.
          MOVE IVBAP-MATNR TO WK_MATNR.
          MOVE IVBAP-WERKS TO WK_WERKS.
          SELECT SINGLE MMSTA FROM MARC INTO MARC-MMSTA
            WHERE MATNR = WK_MATNR
            AND   WERKS = WK_WERKS.
          IF NOT MARC-MMSTA IS INITIAL.
            MOVE '*' TO WK_MMSTA.
          ENDIF.
          SELECT SINGLE LVORM PRDHA MSTAE MSTAV FROM MARA
            INTO (MARA-LVORM, MARA-PRDHA, MARA-MSTAE, MARA-MSTAV)
            WHERE MATNR = WK_MATNR.
          IF ( NOT MARA-MSTAE IS INITIAL ) OR
             ( NOT MARA-MSTAV IS INITIAL ) OR
             ( NOT MARA-LVORM IS INITIAL ).
             MOVE '*' TO WK_MSTAE.
          ENDIF.
          MOVE MARA-PRDHA TO WK_PRDHA.
          SELECT SINGLE MAKTX FROM MAKT INTO WK_MAKTX
            WHERE MATNR = WK_MATNR
              AND SPRAS = SY-LANGU.
        ENDIF.
        IF Z_BLOCK EQ 'B'.
          IF WK_MMSTA EQ ' ' AND WK_MSTAE EQ ' '.
            DELETE IVBAP.
            CONTINUE.
          ENDIF.
        ELSEIF Z_BLOCK EQ 'U'.
          IF WK_MMSTA EQ '' OR WK_MSTAE EQ ''.
            DELETE IVBAP.
            CONTINUE.
          ENDIF.
        ELSE.
          IF WK_MMSTA EQ '' OR WK_MSTAE EQ ''.
            MOVE '*' TO WK_BLOCK.
          ENDIF.
        ENDIF.
        IF WK_PRDHA IN Z_PRDHA.                                    "I4792
          MOVE WK_BLOCK TO IVBAP-BLOCK.
          MOVE WK_PRDHA TO IVBAP-PRDHA.
          MOVE WK_MAKTX TO IVBAP-MAKTX.
          MODIFY IVBAP.
        ELSE.                                                     "I4792
          DELETE IVBAP.                                           "I4792
        ENDIF.                                                    "I4792
        IF NOT Z_ALNUM[] IS INITIAL.                              "I9076
          SELECT SINGLE * FROM MAEX                               "I9076
            WHERE MATNR = IVBAP-MATNR                             "I9076
              AND ALNUM IN Z_ALNUM.                               "I9076
          IF SY-SUBRC <> 0.                                       "I9076
            DELETE IVBAP.                                         "I9076
          ENDIF.                                                  "I9076
        ENDIF.                                                    "I9076
      ENDLOOP.

    Hi Nagendra!
    Get Sales Order Details
    CLEAR IVBAP.
    REFRESH IVBAP.
    check ivbak is not initial
    SELECT VBELN POSNR MATNR NETWR KWMENG WERKS FROM VBAP
    INTO CORRESPONDING FIELDS OF TABLE IVBAP
    FOR ALL ENTRIES IN IVBAK
    WHERE VBELN = IVBAK-VBELN
    AND MATNR IN Z_MATNR
    AND WERKS IN Z_WERKS
    AND ABGRU = ' '.
    Check for Obsolete Materials - Get Product Hierarhy/Mat'l Description
    SORT IVBAP BY MATNR WERKS.
    CLEAR: WK_MATNR, WK_WERKS, WK_PRDHA, WK_MAKTX,
    WK_BLOCK, WK_MMSTA, WK_MSTAE.
    avoid select widin loop. instead do selection outside loop.u can use read statement......and then loop if required.
    LOOP AT IVBAP.
    CLEAR WK_INVDATE. "I6677.sn
    SELECT MAX( ERDAT ) FROM VBRP INTO WK_INVDATE WHERE
    AUBEL EQ IVBAP-VBELN AND
    AUPOS EQ IVBAP-POSNR.
    IF SY-SUBRC = 0.
    MOVE WK_INVDATE TO IVBAP-INVDT.
    MODIFY IVBAP.
    ENDIF. "I6677.e n
    SELECT SINGLE * FROM MBEW WHERE "I6759.sn
    MATNR EQ IVBAP-MATNR AND
    BWKEY EQ IVBAP-WERKS AND
    BWTAR EQ SPACE.
    IF SY-SUBRC = 0.
    MOVE MBEW-STPRS TO IVBAP-STPRS.
    IVBAP-TOT = MBEW-STPRS * IVBAP-KWMENG.
    MODIFY IVBAP.
    ENDIF. "I6759.en
    IF IVBAP-MATNR NE WK_MATNR OR IVBAP-WERKS NE WK_WERKS.
    CLEAR: WK_BLOCK, WK_MMSTA, WK_MSTAE, WK_PRDHA, WK_MAKTX.
    MOVE IVBAP-MATNR TO WK_MATNR.
    MOVE IVBAP-WERKS TO WK_WERKS.
    SELECT SINGLE MMSTA FROM MARC INTO MARC-MMSTA
    WHERE MATNR = WK_MATNR
    AND WERKS = WK_WERKS.
    IF NOT MARC-MMSTA IS INITIAL.
    MOVE '*' TO WK_MMSTA.
    ENDIF.
    SELECT SINGLE LVORM PRDHA MSTAE MSTAV FROM MARA
    INTO (MARA-LVORM, MARA-PRDHA, MARA-MSTAE, MARA-MSTAV)
    WHERE MATNR = WK_MATNR.
    IF ( NOT MARA-MSTAE IS INITIAL ) OR
    ( NOT MARA-MSTAV IS INITIAL ) OR
    ( NOT MARA-LVORM IS INITIAL ).
    MOVE '*' TO WK_MSTAE.
    ENDIF.
    MOVE MARA-PRDHA TO WK_PRDHA.
    SELECT SINGLE MAKTX FROM MAKT INTO WK_MAKTX
    WHERE MATNR = WK_MATNR
    AND SPRAS = SY-LANGU.
    ENDIF.
    IF Z_BLOCK EQ 'B'.
    IF WK_MMSTA EQ ' ' AND WK_MSTAE EQ ' '.
    DELETE IVBAP.
    CONTINUE.
    ENDIF.
    ELSEIF Z_BLOCK EQ 'U'.
    IF WK_MMSTA EQ '' OR WK_MSTAE EQ ''.
    DELETE IVBAP.
    CONTINUE.
    ENDIF.
    ELSE.
    IF WK_MMSTA EQ '' OR WK_MSTAE EQ ''.
    MOVE '*' TO WK_BLOCK.
    ENDIF.
    ENDIF.
    IF WK_PRDHA IN Z_PRDHA. "I4792
    MOVE WK_BLOCK TO IVBAP-BLOCK.
    MOVE WK_PRDHA TO IVBAP-PRDHA.
    MOVE WK_MAKTX TO IVBAP-MAKTX.
    MODIFY IVBAP.
    ELSE. "I4792
    DELETE IVBAP. "I4792
    ENDIF. "I4792
    IF NOT Z_ALNUM[] IS INITIAL. "I9076
    SELECT SINGLE * FROM MAEX "I9076
    WHERE MATNR = IVBAP-MATNR "I9076
    AND ALNUM IN Z_ALNUM. "I9076
    IF SY-SUBRC 0. "I9076
    DELETE IVBAP. "I9076
    ENDIF. "I9076
    ENDIF. "I9076
    endloop.
    U have used many select queries widin loop-endloop which is a big hindrance as far as performance is concerned.Avoid such practice.
    Thanks
    Deepika

  • Time Taking while firing a select Query

    i am unable to access the table "X" in ABC schema
    its taking toooooooooo much time while firing just a select query
    how to resolve it
    "SELECT digital_signing_cert
    FROM X"

    could be due to huge table size,crosscheck this from user_segments view.
    select bytes/1024/1024 "MB" from user_segments where segment_name='X';
    also check database alert log for any error.

  • How do I trap a time out error on DataFinder

    Greetings
    I need to trap a time out error coming from datafinder.
    I tried vbs "On Error" but the Err.Description I get is  "The  operation Search was timed out".
    If I manually set the same query  on the GUI I get results back, but when using code on a long list of queries, sometimes I get a time out error and it stops the process.
    I want to capture this error and proceed to the next query but I would also like to have some more details.
    I am aware that I can tweak the timeout settings on the datafinder to increase the time, but the real problem I am chasing is a linear time increase I am observing on a list of thousands of queries.
    They start fast but I am observing a small increment of time added on each subsequent query and eventually it adds up to the point it returns the timeout error. 
    The process takes many hours before I get an error, if any, so I would like to get as many details as possible. 
    Is there any other way than using  "On Error Resume Next" that would give me more details?
    Also, has this linear time increase been observed before?
    Thank you
    Jose A Rafols
    ETS - Software Engineer
    Honeywell Aerospace of Puerto Rico Inc.
    San Antonio Industrial Park
    Road #110 North Km. 5.9
    Aguadilla, PR 00604

    Hi Jose,
    This isn't an answer to the question you're asking, but it might still help.  DIAdem 2015, which is in Beta right now, has a new query mode that returns only the desired property columns from a query-- not all properties (and parent properties) regardless of what's displayed.  This new query mechanism enables you to greatly exceed the old 32000 search result limit, and it generally runs something like 5x to 10x faster than the regular query method.  It's possible that with this new approach you could avoid altogether the timeouts you're currently struggling to trap.
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments

  • How to avoid time out error in abap program

    How to avoid time out error in abap program
    based on performance wise i want please help

    Timeout occurs when a statement exceeds its time limit.To avoid this we need to tune the statements.
    I can give give you few tips for tune a select stament.
    1.The order of the feilds in the select statement should be same as the order of fields in the database table.
    2.It is always advisible to use the key fields when you are using the where clause.
    3. Sort the internal table while using the for all entreis statements.
    4.Use index in where clause if necessary.
    5.When you have a read statement user binary search but before this a sort statement should be there.
    6. Check your program with the Tcode ST05 and check which statement takes much time based on that tune that.

  • Time out error in production server  for alv grid report

    hi. i have developed alv grid report using nested select statments. when i testing in development  server it is giving the output but in production server if i give 4 months then it is showing time out error.please help me out..its urgent.
    Thanks in advance.

    Hi Manu,
    Don't use Nested selected statements.
    Use the Following  Performance Tuning Options that i have given below so that your problem can be solved.
    1)  Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
    2) Avoid for all entries in JOINS
    3) Try to avoid joins and use FOR ALL ENTRIES.
    4)   Try to restrict the joins to 1 level only ie only for tables
    5)   Avoid using Select *.
    6)   Avoid having multiple Selects from the same table in the same object.
    7)  Try to minimize the number of variables to save memory.  
    8)   The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
    9)   Avoid creation of  index as far as possible
    10) Avoid operators like  <>, > , < & like % in where clause conditions
    11) Avoid select/select single statements in loops.
    12) Try to use 'binary search' in READ internal table. Ensure table is sorted before using   BINARY SEARCH.
    13) Avoid using aggregate functions  (SUM, MAX etc) in selects ( GROUP BY , HAVING,)  
    14) Avoid using  ORDER  BY in selects
    15) Avoid Nested Selects
    16) Avoid Nested Loops of Internal Tables
    17) Try  to  use FIELD SYMBOLS.
    18) Try to avoid into Corresponding Fields of
    19) Avoid using Select  Distinct, Use DELETE ADJACENT
    <b>
    Reward Points for sure if you find it useful. </b>
    Regards
    Babu

Maybe you are looking for

  • Ducking not working in imovie

    Hi... running the lastest version of imovie.  All up to date. Ducking does not work when selecting on a video clip.  i.e. I want the background music to fade and keep audio on clip up. I have tried with several different songs, close and restarted im

  • Sending a return value without pass/fail message

    Hi, I'm using the COM adapter to talk TestComplete application. I have a string value test step to evaluate a return value and determine if it's pass or fail (e.g. return 0 = pass, return 1 = fail).  This works perfectly. However, I have added anothe

  • Profiling Error after Upgrade to OWB 10.2.0.2

    Hello, I upgraded a 10.2.0.1 OWB installation to 10.2.0.2 and the database used for design to 10.2.0.3 with the respective OWB- and DB-patch-sets. At first everything looked fine, but when I tested the data profiling I ran into an error. Here's the e

  • [svn] 3685: -Branch 3.0.x (@ rev.

    Revision: 3685 Author: [email protected] Date: 2008-10-16 10:18:39 -0700 (Thu, 16 Oct 2008) Log Message: -Branch 3.0.x (@ rev. 3643) to 3.2.0 -3.0.x will be renamed to 3.x Added Paths: flex/sdk/branches/3.2.0/

  • I can't get my Mackbook Pro to print on 11 x 17 paper. Help?

    I can't get my Mackbook Pro to print on 11 x 17 paper to a wireless printer. It will print on 8.5 x 11, even when I select 11 x 17 Help? I am smart, smrt.