Comma Separated Value Taking too Much Time to Execute

Hi,
select ES_DIAGNOSIS_CODE DC from ecg_study WHERE PS_PROTOCOL_ID LIKE 'H6L-MC-LFAN'
The above query returns comma separated value from the above query.
I am using the query below to split the comma separated value but the below query is taking lot of time to return the data.
SELECT
select DC from (
with t as ( select ES_DIAGNOSIS_CODE DC from ecg_study WHERE PS_PROTOCOL_ID LIKE 'H6L-MC-LFAN' )
select REGEXP_SUBSTR (DC, '[^,]+', 1, level) DC from t
connect by level <= length(regexp_replace(DC,'[^,]*'))+1 )
Please suggest me is there any alternative way to do this comma separated value.
Thanks
Sudhir

Nikolay Savvinov wrote:
Hi BluShadow,
I know that this function is fast with varchar2 strings from several years of using it. With CLOBs one may need something faster, but the OP didn't menion CLOBs.
Best regards,
NikolayJust because you perceive it to be fast doesn't mean it's faster than doing it in SQL alone.
For starters you are context switching from the SQL engine to PL/SQL to call it.
Then in your code you are doing this...
select substr(v_str,v_last_break+1, decode(v_nxt_break,0,v_length, v_nxt_break-v_last_break-1)) into v_result from dual;which is context switching back from the PL/SQL engine to the SQL engine for each entry in the string.
Why people do that I don't know... when PL/SQL alone could do it without a context switch e.g.
v_result := substr(v_str,v_last_break+1, case when v_nxt_break = 0 then v_length else v_nxt_break-v_last_break-1 end);So, if you still think it's faster than pure SQL (which is what the OP is using), please go ahead and prove it to us.

Similar Messages

  • Owb job taking too much time to execute

    While creating a job in OWB, I am using three tables,a joiner and an aggregator which are all joined through another joiner to load into the final table. The output is coming correct but the sql query generated is very complex having so many sub-queries. So, its taking so much time to execute. Pls help me in reducing the cost.
    -KC

    It depends on what kind of code it generates at each stage. The first step would be collect stats for all the tables used and check the SQL generated using EXPLAIN PLAN. See which sub-query or inline view creates the most cost.
    Generate SQL at various stages and see if you can achieve the same with a different operator.
    The other option would be passing HINTS to the tables selected.
    - K

  • BW Loading filter values taking too much time

    Hi
      Loading filter values of characteristics from Bex taking more time (annoying users), for example for sales document types when wants to select filter values to loads couple of around 30 it is taking more than 3-4 minutes.
      Infoobject -> Business explorer->Query Def. Filter Value Selection is "M" (values in master data table) is active. Please let me know any reasons for this performance problems? We are getting similar problems with almost all characteristics, we thought it is trying to read from info provider, though we indicated to read from master data table.
    Thanks
    Reddy

    One better way could be
    Infoobject -> Business explorer->Filter value Repr.At Query Execution = Dropdown box
    As you have only few entries, this may not annoy users.

  • My ALV Report is taking too much time to execute

    Hi Friends,
    My ALV Report is taking long time for execution(more than 1.5 Hrs).Pls suggest the changes to be done to improove the performance.Its very urgent.Pls respond as soon as possible.
    Thanks & Regards,
    Sunil Maurya
    Report is as follows :
    REPORT  YSEG_PROFIT.
    TABLES : ZSEGMENT, coep.
    TYPE-POOLS: slis.
    DATA : BEGIN OF I_COEP OCCURS 0,
             BELNR  LIKE COEP-BELNR,
             BUZEI  LIKE COEP-BUZEI,
             PERIO  LIKE COEP-PERIO,
             WOGBTR LIKE COEP-WOGBTR,
             OBJNR  LIKE COEP-OBJNR,
             KSTAR  LIKE COEP-KSTAR,
             PAOBJNR LIKE COEP-PAOBJNR,
             KVGR5  LIKE ZSEGMENT-KVGR5,
             KAUFN  LIKE CE4KBL1_ACCT-KAUFN,
           END OF I_COEP.
    DATA : BEGIN OF I_SECTOR OCCURS 0,
            KVGR5  LIKE ZSEGMENT-KVGR5,
          END OF I_SECTOR.
    DATA : BEGIN OF I_AUFK OCCURS 0,
            OBJNR LIKE AUFK-OBJNR,
            PSPEL LIKE AUFK-PSPEL,
            KDAUF LIKE AUFK-KDAUF,
            KDPOS LIKE AUFK-KDPOS,
           END OF I_AUFK.
    DATA : BEGIN OF I_VBAKP OCCURS 0,
            OBJNR LIKE VBAP-OBJNR,
            KVGR5 LIKE VBAK-VBELN,
          END OF I_VBAKP.
    DATA : BEGIN OF I_PRPS OCCURS 0,
            OBJNR LIKE PRPS-OBJNR,
            PSPHI LIKE PRPS-PSPHI,
            ASTNR LIKE PROJ-ASTNR,
          END OF I_PRPS.
    DATA : BEGIN OF I_OUTPUT OCCURS 0,
             KSTAR LIKE COEP-KSTAR,
             MCTXT LIKE CSKU-MCTXT,
             S01   LIKE COEP-WOGBTR,
             S02   LIKE COEP-WOGBTR,
             S03   LIKE COEP-WOGBTR,
             S04   LIKE COEP-WOGBTR,
             S05   LIKE COEP-WOGBTR,
             S06   LIKE COEP-WOGBTR,
             S07   LIKE COEP-WOGBTR,
             S08   LIKE COEP-WOGBTR,
             S09   LIKE COEP-WOGBTR,
             OTH   like COEP-WOGBTR,
             TOTAL LIKE COEP-WOGBTR,
          END OF I_OUTPUT.
    DATA : BEGIN OF I_AFVC OCCURS 0,
            OBJNR LIKE AFVC-OBJNR,
            PROJN LIKE AFVC-PROJN,
            PROJ LIKE   PROJ-PSPID,
            PSPNR LIKE PROJ-PSPNR,
           END OF I_AFVC.
    DATA : BEGIN OF I_PROJ OCCURS 0,
            PSPNR LIKE PROJ-PSPNR,
            ASTNR LIKE PROJ-ASTNR,
           END OF I_PROJ.
    DATA : I_NP LIKE STANDARD TABLE OF I_COEP WITH HEADER LINE.
    DATA : I_NV LIKE STANDARD TABLE OF I_COEP WITH HEADER LINE.
    DATA : I_DETAIL LIKE STANDARD TABLE OF I_COEP WITH HEADER LINE.
    DATA : I_WB LIKE STANDARD TABLE OF I_COEP WITH HEADER LINE.
    DATA : I_PR LIKE STANDARD TABLE OF I_COEP WITH HEADER LINE.
    data : t_fieldcat_sum_rep TYPE slis_t_fieldcat_alv.
    data : t_fieldcat_det_rep TYPE slis_t_fieldcat_alv.
    DATA: k_fieldcat    TYPE slis_fieldcat_alv.
    Declaration by Sunil Maurya for sorting
    DATA : GT_SORT TYPE SLIS_T_SORTINFO_ALV,
           GS_SORT TYPE SLIS_SORTINFO_ALV.
    DATA : GT_SORT1 TYPE SLIS_T_SORTINFO_ALV,
           GS_SORT1 TYPE SLIS_SORTINFO_ALV.
    *data : it_sortcat type slis_t_sortinfo_alv.
    *DATA : k_sortcat  like line of it_sortcat.
    **data : wa_sort like line of it_sortcat.
    Declaration by Sunil Maurya for sorting
    constants :  c_user_command TYPE char30 VALUE 'USER_COMMAND'.
    *Selection screen
    SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-001.
    PARAMETER : P_PERIO1   LIKE COEP-PERIO obligatory,
               P_PERIO2   LIKE COEP-PERIO MODIF ID D1,
                P_GJAHR    LIKE COEP-GJAHR obligatory.
    select-options :  P_KSTAR  for COEP-KSTAR,
                      P_GSBER  FOR COEP-GSBER.
    SELECT-OPTIONS : S_KVGR5 FOR ZSEGMENT-KVGR5 MODIF ID D1.
    SELECTION-SCREEN END OF BLOCK A.
    INITIALIZATION.
       S_KVGR5-OPTION = 'BT' .
       S_KVGR5-LOW = 'S01'.
       S_KVGR5-HIGH = 'S09'.
       APPEND S_KVGR5.
    AT SELECTION-SCREEN OUTPUT.
        LOOP AT SCREEN.
          IF SCREEN-GROUP1 = 'D1'.
             SCREEN-INPUT = '0'.
             MODIFY SCREEN.
          ENDIF.
        ENDLOOP.
    START-OF-SELECTION.
      PERFORM GET_SECTORS.
      PERFORM GET_DATA_COEP.
      PERFORM VALIDATE_SECTOR.
      PERFORM GROUP_OUTPUT.
    PERFORM BUILD_SORTCAT. " Inserted by by Sunil Maurya for sorting
      PERFORM BUILD_CATLOG.
      PERFORM DISPLAY_OUTPUT.
    *&      Form  GET_DATA_COEP
          text
    -->  p1        text
    <--  p2        text
    FORM GET_DATA_COEP .
    SELECT BELNR BUZEI PERIO WOGBTR OBJNR KSTAR PAOBJNR
    FROM COEP INTO TABLE I_COEP WHERE
            KOKRS = 'KBL' AND
           PERIO >= P_PERIO1 AND
           PERIO <= P_PERIO2 AND
            PERIO = P_PERIO1 AND
            GJAHR = P_GJAHR AND
            KSTAR NE '' AND
            OBJNR NE '' AND
            KSTAR in P_KSTAR AND
            GSBER IN P_GSBER. "AND
           BELNR = '0103991827' .
      SORT I_COEP BY OBJNR.
      DELETE I_COEP WHERE OBJNR+0(2) <> 'VB' AND
                          OBJNR+0(2) <> 'PR' AND
                          OBJNR+0(2) <> 'NV' AND
                          OBJNR+0(2) <> 'NP' AND
                          OBJNR+0(2) <> 'AO'.
      SORT I_COEP BY KSTAR.
      DELETE I_COEP WHERE KSTAR+0(5) <> '00003' AND
                          KSTAR+0(5) <> '00004'.
      LOOP AT I_COEP WHERE OBJNR+0(2) = 'NP'.
        MOVE I_COEP TO I_NP.
        APPEND I_NP.
        CLEAR : I_NP, I_COEP.
      ENDLOOP.
      LOOP AT I_COEP WHERE OBJNR+0(2) = 'NV'.
        MOVE I_COEP TO I_NV.
        APPEND I_NV.
        CLEAR : I_NV, I_COEP.
      ENDLOOP.
      LOOP AT I_COEP WHERE OBJNR+0(2) = 'VB' .
        MOVE I_COEP TO I_WB.
        APPEND I_WB.
        CLEAR : I_WB, I_COEP.
      ENDLOOP.
      LOOP AT I_COEP WHERE OBJNR+0(2) = 'PR' .
        MOVE I_COEP TO I_PR.
        APPEND I_PR.
        CLEAR : I_PR, I_COEP.
      ENDLOOP.
    *Inserted by Sunil Maurya for PAOBJNR = "AO....."
    Data : ind type sy-tabix.
    loop at i_coep where OBJNR+0(2) = 'AO'.
    ind = sy-tabix.
    select single KAUFN into i_coep-KAUFN from CE4KBL1_ACCT where PAOBJNR =
    i_coep-PAOBJNR.
    select single KVGR5 into i_coep-kvgr5 from vbak where vbeln =
    i_coep-kaufn.
    modify i_coep index ind.
    clear i_coep.
    endloop.
    *Inserted by Sunil Maurya for PAOBJNR = "AO....."
    *LOOP AT I_COEP WHERE OBJNR+0(2) = 'AO' .
       MOVE I_COEP TO I_AO.
       APPEND I_AO.
       CLEAR : I_AO, I_COEP.
    *ENDLOOP.
    ENDFORM.                    " GET_DATA_COEP
    *&      Form  GET_SECTORS
          text
    -->  p1        text
    <--  p2        text
    FORM GET_SECTORS .
      DATA : L_FR TYPE I,
             L_TO TYPE I.
      DATA :  L_CH1(1).
      LOOP AT S_KVGR5.
        IF S_KVGR5-OPTION = 'EQ'.
          I_SECTOR-KVGR5 = S_KVGR5-LOW.
          APPEND I_SECTOR.
          CLEAR : I_SECTOR.
          CONCATENATE '5' S_KVGR5-LOW+1(2) INTO I_SECTOR-KVGR5.
          APPEND I_SECTOR.
          CLEAR : I_SECTOR.
        ENDIF.
        IF S_KVGR5-OPTION = 'BT'.
          L_FR = S_KVGR5-LOW+1(2).
          L_TO = S_KVGR5-HIGH+1(2).
          WHILE L_FR <= L_TO.
            L_CH1 = L_FR.
            CONCATENATE 'S0' L_CH1 INTO I_SECTOR-KVGR5.
            APPEND I_SECTOR.
            CONCATENATE '50' L_CH1 INTO I_SECTOR-KVGR5.
            APPEND I_SECTOR.
            CLEAR : I_SECTOR, L_CH1.
            L_FR = L_FR + 1.
          ENDWHILE.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    " GET_SECTORS
    *&      Form  VALIDATE_SECTOR
          text
    -->  p1        text
    <--  p2        text
    FORM VALIDATE_SECTOR .
    *get data from AUFK for NP & NV type intab
    IF I_NP[] IS NOT INITIAL.
      SELECT OBJNR PSPEL KDAUF KDPOS FROM AUFK
      INTO TABLE I_AUFK
      FOR ALL ENTRIES IN I_NP
      WHERE OBJNR = I_NP-OBJNR.
    *Push this data in I_WB where order no exist in AUFK
      LOOP AT I_AUFK WHERE KDAUF NE ''.
        I_WB-OBJNR = I_AUFK-OBJNR.
        APPEND I_WB.
        CLEAR : I_AUFK, I_WB.
      ENDLOOP.
    *Push this data in I_PR where order no exist in AUFK
      LOOP AT I_AUFK WHERE PSPEL NE ''.
        I_PR-OBJNR = I_AUFK-OBJNR.
        APPEND I_PR.
        CLEAR : I_AUFK, I_PR.
      ENDLOOP.
    ENDIF.
      SELECT BOBJNR AKVGR5 FROM VBAK AS A INNER JOIN VBAP AS B
      ON AVBELN = BVBELN
      INTO TABLE I_VBAKP
      FOR ALL ENTRIES IN I_WB
      WHERE B~VBELN = I_WB-OBJNR+2(10).
      SORT I_VBAKP BY OBJNR.
      SORT I_COEP BY OBJNR.
      LOOP AT I_WB.
        READ TABLE I_VBAKP WITH KEY OBJNR = I_WB-OBJNR.
        IF SY-SUBRC = 0.
          READ TABLE I_SECTOR WITH KEY KVGR5 = I_VBAKP-KVGR5.
          IF SY-SUBRC <> 0.
           DELETE I_COEP WHERE OBJNR = I_WB-OBJNR.
             loop at i_coep where objnr = i_wb-objnr.
                  i_coep-kvgr5 = 'OTH'.
                  modify i_coep.
                  clear : i_coep.
             endloop.
          ELSE.
         READ TABLE I_COEP WITH KEY BELNR = I_WB-BELNR BUZEI = I_WB-BUZEI.
           READ TABLE I_COEP WITH KEY OBJNR = I_WB-OBJNR.
            IF SY-SUBRC = 0.
              I_COEP-KVGR5 = I_SECTOR-KVGR5.
              MODIFY I_COEP INDEX SY-TABIX.
              LOOP AT I_COEP WHERE OBJNR = I_WB-OBJNR.
                I_COEP-KVGR5 = I_SECTOR-KVGR5.
                MODIFY I_COEP.
                CLEAR : I_COEP.
              ENDLOOP.
            ENDIF.
          ENDIF.
        ELSE.
         DELETE I_COEP WHERE OBJNR = I_WB-OBJNR.
             loop at i_coep where objnr = i_wb-objnr.
                  i_coep-kvgr5 = 'OTH'.
                  modify i_coep.
                  clear : i_coep.
             endloop.
        ENDIF.
        CLEAR : I_VBAKP, I_SECTOR, I_COEP.
      ENDLOOP.
    IF I_PR[] IS NOT INITIAL.
      SELECT AOBJNR APSPHI B~ASTNR
      FROM PRPS AS A INNER JOIN PROJ AS B
      ON APSPHI = BPSPNR
      INTO TABLE I_PRPS
      FOR ALL ENTRIES IN I_PR
      WHERE A~OBJNR = I_PR-OBJNR.
    ENDIF.
      IF I_NV[] IS NOT INITIAL.
        SELECT OBJNR PROJN FROM AFVC INTO TABLE I_AFVC
        FOR ALL ENTRIES IN I_NV
        WHERE OBJNR = I_NV-OBJNR AND
              PROJN <> ''  .
        LOOP AT I_AFVC.
          CALL FUNCTION 'CONVERSION_EXIT_ABPSP_OUTPUT'
            EXPORTING
              INPUT         = I_AFVC-PROJN
           IMPORTING
             OUTPUT        = I_AFVC-PROJ
            I_AFVC-PROJ = I_AFVC-PROJ+0(9).
            CALL FUNCTION 'CONVERSION_EXIT_KONPD_INPUT'
              EXPORTING
                INPUT           = I_AFVC-PROJ
             IMPORTING
               OUTPUT          =  I_AFVC-PSPNR.
            MODIFY I_AFVC.
            CLEAR : I_AFVC.
        ENDLOOP.
        SELECT PSPNR ASTNR FROM PROJ INTO TABLE I_PROJ
        FOR ALL ENTRIES IN I_AFVC
        WHERE PSPNR = I_AFVC-PSPNR.
        LOOP AT I_NV.
           I_PRPS-OBJNR = I_NV-OBJNR.
           READ TABLE I_AFVC WITH KEY OBJNR = I_NV-OBJNR.
           IF SY-SUBRC = 0.
             READ TABLE I_PROJ WITH KEY PSPNR = I_AFVC-PSPNR.
             IF SY-SUBRC = 0.
               I_PRPS-ASTNR = I_PROJ-ASTNR.
             ENDIF.
           ENDIF.
            APPEND I_PRPS.
            I_PR-OBJNR = I_NV-OBJNR.
            APPEND I_PR.
            CLEAR : I_NV, I_AFVC, I_PROJ, I_PR.
        ENDLOOP.
      ENDIF.
      SORT I_PRPS BY OBJNR.
      LOOP AT I_PR.
        READ TABLE I_PRPS WITH KEY OBJNR = I_PR-OBJNR.
        IF SY-SUBRC = 0.
          READ TABLE I_SECTOR WITH KEY KVGR5 = I_PRPS-ASTNR+5(3).
          IF SY-SUBRC <> 0.
           DELETE I_COEP WHERE OBJNR = I_PR-OBJNR.
             loop at i_coep where objnr = i_pr-objnr.
                  i_coep-kvgr5 = 'OTH'.
                  modify i_coep.
                  clear : i_coep.
             endloop.
          ELSE.
            READ TABLE I_COEP WITH KEY OBJNR = I_PR-OBJNR.
            IF SY-SUBRC = 0.
              CONCATENATE 'S' I_SECTOR-KVGR5+1(2) INTO I_COEP-KVGR5.
              MODIFY I_COEP INDEX SY-TABIX.
              LOOP AT I_COEP WHERE OBJNR = I_PR-OBJNR.
                CONCATENATE 'S' I_SECTOR-KVGR5+1(2) INTO I_COEP-KVGR5.
                MODIFY I_COEP.
                CLEAR : I_COEP.
              ENDLOOP.
            ENDIF.
          ENDIF.
        ELSE.
         DELETE I_COEP WHERE OBJNR = I_PR-OBJNR.
            loop at i_coep where objnr = i_pr-objnr.
                  i_coep-kvgr5 = 'OTH'.
                  modify i_coep.
                  clear : i_coep.
             endloop.
        ENDIF.
        CLEAR : I_PR, I_PRPS, I_SECTOR, I_COEP.
      ENDLOOP.
    ENDFORM.                    " VALIDATE_SECTOR
    *&      Form  GROUP_OUTPUT
          text
    -->  p1        text
    <--  p2        text
    FORM GROUP_OUTPUT .
      LOOP AT I_COEP.
        I_OUTPUT-KSTAR = I_COEP-KSTAR.
        IF I_COEP-KVGR5 = 'S01'.
          I_OUTPUT-S01 = I_COEP-WOGBTR.
        ENDIF.
        IF I_COEP-KVGR5 = 'S02'.
          I_OUTPUT-S02 = I_COEP-WOGBTR.
        ENDIF.
        IF I_COEP-KVGR5 = 'S03'.
          I_OUTPUT-S03 = I_COEP-WOGBTR.
        ENDIF.
        IF I_COEP-KVGR5 = 'S04'.
          I_OUTPUT-S04 = I_COEP-WOGBTR.
        ENDIF.
        IF I_COEP-KVGR5 = 'S05'.
          I_OUTPUT-S05 = I_COEP-WOGBTR.
        ENDIF.
        IF I_COEP-KVGR5 = 'S06'.
          I_OUTPUT-S06 = I_COEP-WOGBTR.
        ENDIF.
        IF I_COEP-KVGR5 = 'S07'.
          I_OUTPUT-S07 = I_COEP-WOGBTR.
        ENDIF.
        IF I_COEP-KVGR5 = 'S08'.
          I_OUTPUT-S08 = I_COEP-WOGBTR.
        ENDIF.
        IF I_COEP-KVGR5 = 'S09'.
          I_OUTPUT-S09 = I_COEP-WOGBTR.
        ENDIF.
        IF I_COEP-KVGR5 = 'OTH' OR I_COEP-KVGR5 = ''.
          I_OUTPUT-OTH = I_COEP-WOGBTR.
        ENDIF.
        COLLECT I_OUTPUT.
        CLEAR : I_COEP, I_OUTPUT.
      ENDLOOP.
      LOOP AT I_OUTPUT.
        SELECT SINGLE MCTXT FROM CSKU
        INTO I_OUTPUT-MCTXT
        WHERE KTOPL = 'KBL' AND
              SPRAS = SY-LANGU AND
              KSTAR = I_OUTPUT-KSTAR.
        I_OUTPUT-TOTAL = I_OUTPUT-S01 + I_OUTPUT-S02 + I_OUTPUT-S03
                        + I_OUTPUT-S04 + I_OUTPUT-S05 + I_OUTPUT-S06
                        + I_OUTPUT-S07 + I_OUTPUT-S08 + I_OUTPUT-S09
                        + I_OUTPUT-OTH.
        MODIFY I_OUTPUT.
        CLEAR : I_OUTPUT.
      ENDLOOP.
    ENDFORM.                    " GROUP_OUTPUT
    *&      Form  BUILD_CATLOG
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_CATLOG .
      CLEAR k_fieldcat.
      k_fieldcat-fieldname = 'KSTAR'.
      k_fieldcat-seltext_l  = text-002.
      k_fieldcat-hotspot   = 'X'.
      APPEND k_fieldcat TO t_fieldcat_sum_rep.
      CLEAR k_fieldcat.
      k_fieldcat-fieldname = 'MCTXT'.
      k_fieldcat-seltext_l  = text-003.
      k_fieldcat-hotspot   = 'X'.
      APPEND k_fieldcat TO t_fieldcat_sum_rep.
      READ TABLE I_SECTOR WITH KEY KVGR5 = 'S01'.
      IF SY-SUBRC = 0.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'S01'.
        k_fieldcat-seltext_l  = text-004.
        k_fieldcat-hotspot   = 'X'.
        k_fieldcat-do_sum    = 'X'. "Statement inserted by Sunil Maurya
        APPEND k_fieldcat TO t_fieldcat_sum_rep.
      ENDIF.
      READ TABLE I_SECTOR WITH KEY KVGR5 = 'S02'.
      IF SY-SUBRC = 0.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'S02'.
        k_fieldcat-seltext_l  = text-005.
        k_fieldcat-hotspot   = 'X'.
        k_fieldcat-do_sum    = 'X'. "Statement inserted by Sunil Maurya
        APPEND k_fieldcat TO t_fieldcat_sum_rep.
      ENDIF.
      READ TABLE I_SECTOR WITH KEY KVGR5 = 'S03'.
      IF SY-SUBRC = 0.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'S03'.
        k_fieldcat-seltext_l  = text-006.
        k_fieldcat-hotspot   = 'X'.
        k_fieldcat-do_sum    = 'X'. "Statement inserted by Sunil Maurya
        APPEND k_fieldcat TO t_fieldcat_sum_rep.
      ENDIF.
      READ TABLE I_SECTOR WITH KEY KVGR5 = 'S04'.
      IF SY-SUBRC = 0.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'S04'.
        k_fieldcat-seltext_l  = text-007.
        k_fieldcat-hotspot   = 'X'.
        k_fieldcat-do_sum    = 'X'. "Statement inserted by Sunil Maurya
        APPEND k_fieldcat TO t_fieldcat_sum_rep.
      ENDIF.
      READ TABLE I_SECTOR WITH KEY KVGR5 = 'S05'.
      IF SY-SUBRC = 0.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'S05'.
        k_fieldcat-seltext_l  = text-008.
        k_fieldcat-hotspot   = 'X'.
        k_fieldcat-do_sum    = 'X'. "Statement inserted by Sunil Maurya
        APPEND k_fieldcat TO t_fieldcat_sum_rep.
      ENDIF.
      READ TABLE I_SECTOR WITH KEY KVGR5 = 'S06'.
      IF SY-SUBRC = 0.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'S06'.
        k_fieldcat-seltext_l  = text-009.
        k_fieldcat-hotspot   = 'X'.
        k_fieldcat-do_sum    = 'X'. "Statement inserted by Sunil Maurya
        APPEND k_fieldcat TO t_fieldcat_sum_rep.
      ENDIF.
      READ TABLE I_SECTOR WITH KEY KVGR5 = 'S07'.
      IF SY-SUBRC = 0.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'S07'.
        k_fieldcat-seltext_l  = text-010.
        k_fieldcat-hotspot   = 'X'.
        k_fieldcat-do_sum    = 'X'. "Statement inserted by Sunil Maurya
        APPEND k_fieldcat TO t_fieldcat_sum_rep.
      ENDIF.
      READ TABLE I_SECTOR WITH KEY KVGR5 = 'S08'.
      IF SY-SUBRC = 0.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'S08'.
        k_fieldcat-seltext_l  = text-011.
        k_fieldcat-hotspot   = 'X'.
        k_fieldcat-do_sum    = 'X'. "Statement inserted by Sunil Maurya
        APPEND k_fieldcat TO t_fieldcat_sum_rep.
      ENDIF.
      READ TABLE I_SECTOR WITH KEY KVGR5 = 'S09'.
      IF SY-SUBRC = 0.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'S09'.
        k_fieldcat-seltext_l  = text-012.
        k_fieldcat-hotspot   = 'X'.
        k_fieldcat-do_sum    = 'X'. "Statement inserted by Sunil Maurya
        APPEND k_fieldcat TO t_fieldcat_sum_rep.
      ENDIF.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'OTH'.
        k_fieldcat-seltext_l  = text-019.
        k_fieldcat-hotspot   = 'X'.
        k_fieldcat-do_sum    = 'X'. "Statement inserted by Sunil Maurya
        APPEND k_fieldcat TO t_fieldcat_sum_rep.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'TOTAL'.
        k_fieldcat-seltext_l  = text-020.
        k_fieldcat-do_sum    = 'X'. "Statement inserted by Sunil Maurya
        APPEND k_fieldcat TO t_fieldcat_sum_rep.
    *=======================================================================
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'BELNR'.
        k_fieldcat-seltext_l  = text-013.
        APPEND k_fieldcat TO t_fieldcat_det_rep.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'BUZEI'.
        k_fieldcat-seltext_l  = text-014.
        APPEND k_fieldcat TO t_fieldcat_det_rep.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'PERIO'.
        k_fieldcat-seltext_l  = text-015.
        APPEND k_fieldcat TO t_fieldcat_det_rep.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'WOGBTR'.
        k_fieldcat-seltext_l  = text-016.
        APPEND k_fieldcat TO t_fieldcat_det_rep.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'OBJNR'.
        k_fieldcat-seltext_l  = text-018.
        APPEND k_fieldcat TO t_fieldcat_det_rep.
        CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'KSTAR'.
        k_fieldcat-seltext_l  = text-002.
        APPEND k_fieldcat TO t_fieldcat_det_rep.
         CLEAR k_fieldcat.
        k_fieldcat-fieldname = 'KVGR5'.
        k_fieldcat-seltext_l  = text-017.
        APPEND k_fieldcat TO t_fieldcat_det_rep.
    *==============================================================
           Statements inserted by Sunil Maurya for sorting
    CLEAR GS_SORT.
    GS_SORT-FIELDNAME = 'KSTAR'.
    GS_SORT-SPOS      = 1.
    GS_SORT-UP        = 'X'.
    APPEND GS_SORT TO GT_SORT.
    CLEAR GS_SORT1.
    GS_SORT1-FIELDNAME = 'KSTAR'.
    GS_SORT1-SPOS      = 1.
    GS_SORT1-UP        = 'X'.
    GS_SORT1-SUBTOT    = 'X'.
    APPEND GS_SORT1 TO GT_SORT1.
    *CLEAR GS_SORT1.
    *GS_SORT1-FIELDNAME = 'WOGBTR'.
    *GS_SORT1-SPOS      = 2.
    *GS_SORT1-UP        = 'X'.
    *GS_SORT1-SUBTOT    = 'X'.
    *APPEND GS_SORT1 TO GT_SORT1.
       FORM build_sortcat.
       k_sortcat-spos = 1.
       k_sortcat-fieldname = 'KSTAR'.
       k_sortcat-up      = 'X'.
      k_sortcat-down      = 'X'.
       APPEND k_sortcat TO it_sortcat.
    clear k_sortcat.
       ENDFORM.
       Statements inserted by Sunil Maurya for sorting
    ENDFORM.                    " BUILD_CATLOG
    *&      Form  DISPLAY_OUTPUT
          text
    -->  p1        text
    <--  p2        text
    FORM DISPLAY_OUTPUT .
      DATA l_repid TYPE syrepid.
      l_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program      = l_repid
          it_fieldcat             = t_fieldcat_sum_rep
          i_callback_user_command = c_user_command
          i_save                  = 'A'
          it_sort                 = GT_SORT[] "Statements inserted by Sunil
        TABLES
          t_outtab                = I_OUTPUT
        EXCEPTIONS
          program_error           = 1
          OTHERS                  = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    " DISPLAY_OUTPUT
    *&      Form  user_command
          text
    FORM user_command USING r_ucomm     LIKE sy-ucomm
                            rs_selfield TYPE slis_selfield.
      DATA: l_repid TYPE syrepid.
      l_repid = sy-repid.
      CASE r_ucomm.
        WHEN '&IC1'.
          clear : i_detail. refresh : i_detail.
          LOOP AT I_COEP WHERE KVGR5 = rs_selfield-fieldname.
              MOVE i_coep to i_detail.
              append i_detail.
              clear : i_detail, i_coep.
          endloop.
          CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
              i_callback_program      = l_repid
              it_fieldcat             = t_fieldcat_det_rep
              i_callback_user_command = c_user_command
              i_save                  = 'A'
              it_sort                 = GT_SORT1[] "Inserted by Sunil
            TABLES
              t_outtab                = i_detail
            EXCEPTIONS
              program_error           = 1
              OTHERS                  = 2.
          IF sy-subrc <> 0.
            MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
          ENDIF.
      ENDCASE.
      ENDFORM.

    Run the SE30 with internal tables, then examine the top lines.
    see
    SE30
    The ABAP Runtime Trace (SE30) -  Quick and Easy
    Define you tables as sorted tables or use at least binary search, otherwise this sorts are useless
    and the nested loop is slow.
    SORT I_VBAKP BY OBJNR.
    SORT I_COEP BY OBJNR.
    LOOP AT I_WB.
    READ TABLE I_VBAKP WITH KEY OBJNR = I_WB-OBJNR.
    IF SY-SUBRC = 0.
    READ TABLE I_SECTOR WITH KEY KVGR5 = I_VBAKP-KVGR5.
    IF SY-SUBRC 0.
    DELETE I_COEP WHERE OBJNR = I_WB-OBJNR.
    loop at i_coep where objnr = i_wb-objnr.
    i_coep-kvgr5 = 'OTH'.
    modify i_coep.
    clear : i_coep.
    endloop.
    ELSE.
    READ TABLE I_COEP WITH KEY BELNR = I_WB-BELNR BUZEI = I_WB-BUZEI.
    READ TABLE I_COEP WITH KEY OBJNR = I_WB-OBJNR.
    IF SY-SUBRC = 0.
    I_COEP-KVGR5 = I_SECTOR-KVGR5.
    MODIFY I_COEP INDEX SY-TABIX.
    LOOP AT I_COEP WHERE OBJNR = I_WB-OBJNR.
    I_COEP-KVGR5 = I_SECTOR-KVGR5.
    MODIFY I_COEP.
    CLEAR : I_COEP.
    ENDLOOP.
    This is all very slow.
    Read my blog on internal tables:
    Measurements on internal tables: Reads and Loops:
    Runtimes of  Reads and Loops on Internal Tables
    If you really wnat to identify all bugs, then try this
    Z_SE30_COMPARE
    A Tool to Compare Runtime Measurements: Z_SE30_COMPARE
    Nonlinearity Check
    Nonlinearity Check Using the Z_SE30_COMPARE
    It needs at bit of experience but then it is very powerful!!!
    That is also a waste of time, but not a nested loop. You sort and resort the same table,
    but the sort is useless the deletes are still sequential on standard tables.
    Put all the stuff into ONE loop on I_COEP.
    SORT I_COEP BY OBJNR.
    DELETE I_COEP WHERE OBJNR+0(2) <> 'VB' AND
    OBJNR+0(2) <> 'PR' AND
    OBJNR+0(2) <> 'NV' AND
    OBJNR+0(2) <> 'NP' AND
    OBJNR+0(2) <> 'AO'.
    SORT I_COEP BY KSTAR.
    DELETE I_COEP WHERE KSTAR+0(5) <> '00003' AND
    KSTAR+0(5) <> '00004'.
    LOOP AT I_COEP WHERE OBJNR+0(2) = 'NP'.
    MOVE I_COEP TO I_NP.
    APPEND I_NP.
    CLEAR : I_NP, I_COEP.
    ENDLOOP.
    LOOP AT I_COEP WHERE OBJNR+0(2) = 'NV'.
    MOVE I_COEP TO I_NV.
    APPEND I_NV.
    CLEAR : I_NV, I_COEP.
    ENDLOOP.
    LOOP AT I_COEP WHERE OBJNR+0(2) = 'VB' .
    MOVE I_COEP TO I_WB.
    APPEND I_WB.
    CLEAR : I_WB, I_COEP.
    ENDLOOP.
    LOOP AT I_COEP WHERE OBJNR+0(2) = 'PR' .
    MOVE I_COEP TO I_PR.
    APPEND I_PR.
    CLEAR : I_PR, I_COEP.
    ENDLOOP.
    There is probably more. BBut with the compare tool you can find everything.
    Siegfried

  • Logic taking too much time to execute

    Dear Friends,
    My i_bkpf internal table has approx. 3 lakh records another table i_del has 2 lakh records. I have to delete these 2 lakh records of i_del from i_bkpf.
    I'd written the following piece of code for the same but it takes hell lot of time and ultimately I encounter a timeout.
    Kindly have a look at the following code and suggest how can I improve it.
    sort i_bkpf by belnr.
    sort i_del by belnr.
    loop at i_del.
    DELETE I_BKPF WHERE   BELNR  = I_DEL-BELNR  AND
                                           GJAHR = I_DEL-GJAHR AND
                                          BUKRS  = I_DEL-BUKRS.
    ENDLOOP.
    Regards,
    Alok.

    Hi
    do like this
    sort i_bkpf by bukrs belnr gjahr.
    sort i_del by  bukrs belnr gjahr.
    loop at i_del.
    read table  I_BKPF With key BUKRS = I_DEL-BUKRS
                                               BELNR = I_DEL-BELNR
                                                GJAHR = I_DEL-GJAHR
                                              binary search.
    if sy-subrc  = 0.
      delete i_bkpf index sy-tabix.
    endif..
    ENDLOOP.
    <b>Reward points for useful Answers</b>
    Regards
    Anji

  • Taking too much time using BufferedWriter to write to a file

    Hi,
    I'm using the method extractItems() which is given below to write data to a file. This method is taking too much time to execute when the number of records in the enumeration is 10000 and above. To be precise it takes around 70 minutes. The writing pauses intermittently for 20 seconds after writing a few lines and sometimes for much more. Has somebody faced this problem before and if so what could be the problem. This is a very high priority work and it would be really helpful if someone could give me some info on this.
    Thanks in advance.
    public String extractItems() throws InternalServerException{
    try{
                   String extractFileName = getExtractFileName();
                   FileWriter fileWriter = new FileWriter(extractFileName);
                   BufferedWriter bufferWrt = new BufferedWriter(fileWriter);
                   CXBusinessClassIfc editClass = new ExploreClassImpl(className, mdlMgr );
    System.out.println("Before -1");
                   CXPropertyInfoIfc[] propInfo = editClass.getClassPropertyInfo(configName);
    System.out.println("After -1");
              PrintWriter out = new PrintWriter(bufferWrt);
    System.out.println("Before -2");
              TemplateHeaderInfo.printHeaderInfo(propInfo, out, mdlMgr);
    System.out.println("After -2");
    XDItemSet itemSet = getItemsForObjectIds(catalogEditDO.getSelectedItems());
    Enumeration allitems = itemSet.allItems();
    System.out.println("the batch size : " +itemSet.getBatchSize());
    XDForm frm = itemSet.getXDForm();
    XDFormProperty[] props = frm.getXDFormProperties();
    System.out.println("Before -3");
    bufferWrt.newLine();
    long startTime ,startTime1 ,startTime2 ,startTime3;
    startTime = System.currentTimeMillis();
    System.out.println("time here is--before-while : " +startTime);
    while(allitems.hasMoreElements()){
    String aRow = "";
    XDItem item = (XDItem)allitems.nextElement();
    for(int i =0 ; i < props.length; i++){
         String value = item.getStringValue(props);
         if(value == null || value.equalsIgnoreCase("null"))
              value = "";
                             if(i == 0)
                                  aRow = value;
                             else
                                  aRow += ("\t" + value);
    startTime1 = System.currentTimeMillis();
    System.out.println("time here is--before-writing to buffer --new: " +startTime1);
    bufferWrt.write(aRow.toCharArray());
    bufferWrt.flush();//added by rosmon to check extra time taken for extraction//
    bufferWrt.newLine();
    startTime2 = System.currentTimeMillis();
    System.out.println("time here is--after-writing to buffer : " +startTime2);
    startTime3 = System.currentTimeMillis();
    System.out.println("time here is--after-while : " +startTime3);
                   out.close();//added by rosmon to check extra time taken for extraction//
    bufferWrt.close();
    fileWriter.close();
    System.out.println("After -3");
    return extractFileName;
    catch(Exception e){
                   e.printStackTrace();
    throw new InternalServerException(e.getMessage());

    Hi fiontan,
    Thanks a lot for the response!!!
    Yeah!! I kow it's a lotta code, but i thought it'd be more informative if the whole function was quoted.
    I'm in fact using the PrintWriter to wrap the BufferedWriter but am not using the print() method.
    Does it save any time by using the print() method??
    The place where the delay is occurring is the wile loop shown below:
                while(allitems.hasMoreElements()){
                String aRow = "";
                    XDItem item = (XDItem)allitems.nextElement();
                    for(int i =0 ; i < props.length; i++){
                         String value = item.getStringValue(props);
         if(value == null || value.equalsIgnoreCase("null"))
              value = "";
                             if(i == 0)
                                  aRow = value;
                             else
                                  aRow += ("\t" + value);
    startTime1 = System.currentTimeMillis();
    System.out.println("time here is--before-writing to buffer --out.flush() done: " +startTime1);
    bufferWrt.write(aRow.toCharArray());
    out.flush();//added by rosmon to check extra time taken for extraction//
    bufferWrt.flush();//added by rosmon to check extra time taken for extraction//
    bufferWrt.newLine();
    startTime2 = System.currentTimeMillis();
    System.out.println("time here is--after-writing to buffer : " +startTime2);
    What exactly happens is that after a few loops it just seems to sleep for around 20 seconds and then again starts off and ............it goes on till the records are done.
    Please do lemme know if you have any idea as to why this is happening !!!!! This bug is giving me the scare.
    thanks in advance

  • Code  taking too much time to output

    Following  code is taking too much time to execute . (some time giving Time_out )
    ind = sy-tabix.
        SELECT SINGLE * FROM mseg INTO mseg
           WHERE bwart = '102' AND
                 lfbnr = itab-mblnr AND
                 ebeln = itab-ebeln AND
                 ebelp = itab-ebelp.
        IF sy-subrc = 0.
          DELETE itab INDEX ind.
          CONTINUE.
    Is there any other way to write this code to reduce the output time.
    Thanks

    Hi,
    I think you are executing this code in a loop which is causing the problem. The rule is "Never put SELECT statements inside a loop".
    Try to rewrite the code as follows:
    * Outside the loop
    SELECT *
    from MSEG
    into table lt_mseg
    for all entries in itab
    where bwart = '102' AND
    lfbnr = itab-mblnr AND
    ebeln = itab-ebeln AND
    ebelp = itab-ebelp.
    Then inside the loop, do a READ on the internal table
    Loop at itab.
    read table lt_mseg with key bwart = '102'. "plus other conditions
    if sy-subrc ne 0.
    delete itab. "index is automatically determined here from SY-TABIX
    endif.
    endloop.
    I think this should optimise performance. You can check your code's performance using SE30 or ST05.
    Hope this helps! Please revert if you need anything else!!
    Cheers,
    Shailesh.
    Always provide feedback for helpful answers!

  • Taking too much time to load application

    Hi,
    I have deployed a j2ee application on oracle 10g version 10.1.2.0.2. But the application is taking too much time to load. After loading ,everything works fast.
    I have another 10g server (same version) in which the same application is loading very fast.
    When I checked the apache error logs found this :-
    [Thu Apr 26 09:17:31 2007] [warn] [client 10.1.20.9] oc4j_socket_recvfull timed out
    [Thu Apr 26 09:17:31 2007] [error] [client 10.1.20.9] [ecid: 89128867058,1] (4)Interrupted system call: MOD_OC4J_0038: Receiving data from oc4j exceeded the configured "Timeout" value and the error code is 4.
    [Thu Apr 26 09:17:31 2007] [error] [client 10.1.20.9] [ecid: 89128867058,1] MOD_OC4J_0054: Failed to call network routine to receive an ajp13 message from oc4j.
    [Thu Apr 26 09:17:31 2007] [error] [client 10.1.20.9] [ecid: 89128867058,1] MOD_OC4J_0033: Failed to receive an ajp13 message from oc4j.
    [Thu Apr 26 09:17:31 2007] [warn] [client 10.1.20.9] [ecid: 89128867058,1] MOD_OC4J_0078: Network connection errors happened to host: lawdb.keralalawsect.org and port: 12501 while receiving the first response from oc4j. This request is recoverable.
    [Thu Apr 26 09:17:31 2007] [error] [client 10.1.20.9] [ecid: 89128867058,1] MOD_OC4J_0121: Failed to service request with network worker: home_15 and it is not recoverable.
    [Thu Apr 26 09:17:31 2007] [error] [client 10.1.20.9] [ecid: 89128867058,1] MOD_OC4J_0013: Failed to call destination: home's service() to service the request.
    [Thu Apr 26 11:36:36 2007] [notice] FastCGI: process manager initialized (pid 21177)
    [Thu Apr 26 11:36:37 2007] [notice] Oracle-Application-Server-10g/10.1.2.0.2 Oracle-HTTP-Server configured -- resuming normal operations
    [Thu Apr 26 11:36:37 2007] [notice] Accept mutex: fcntl (Default: sysvsem)
    [Thu Apr 26 11:36:37 2007] [warn] long lost child came home! (pid 9124)
    [Thu Apr 26 11:39:51 2007] [error] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0015: recv() returns 0. There has no message available to be received and oc4j has gracefully (orderly) closed the connection.
    [Thu Apr 26 11:39:51 2007] [error] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0054: Failed to call network routine to receive an ajp13 message from oc4j.
    [Thu Apr 26 11:39:51 2007] [error] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0033: Failed to receive an ajp13 message from oc4j.
    [Thu Apr 26 11:39:51 2007] [warn] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0078: Network connection errors happened to host: lawdb.keralalawsect.org and port: 12501 while receiving the first response from oc4j. This request is recoverable.
    [Thu Apr 26 11:39:51 2007] [warn] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0184: Failed to find an oc4j process for destination: home
    [Thu Apr 26 11:39:51 2007] [error] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0145: There is no oc4j process (for destination: home) available to service request.
    [Thu Apr 26 11:39:51 2007] [error] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0119: Failed to get an oc4j process for destination: home
    [Thu Apr 26 11:39:51 2007] [error] [client 10.1.20.9] [ecid: 80547835731,1] MOD_OC4J_0013: Failed to call destination: home's service() to service the request.
    [Thu Apr 26 11:46:33 2007] [notice] FastCGI: process manager initialized (pid 21726)
    [Thu Apr 26 11:46:34 2007] [notice] Oracle-Application-Server-10g/10.1.2.0.2 Oracle-HTTP-Server configured -- resuming normal operations
    [Thu Apr 26 11:46:34 2007] [notice] Accept mutex: fcntl (Default: sysvsem)
    [Thu Apr 26 11:46:34 2007] [warn] long lost child came home! (pid 21182)
    [Thu Apr 26 11:53:32 2007] [warn] [client 10.1.20.9] oc4j_socket_recvfull timed out
    [Thu Apr 26 11:53:32 2007] [error] [client 10.1.20.9] [ecid: 89138452752,1] (4)Interrupted system call: MOD_OC4J_0038: Receiving data from oc4j exceeded the configured "Timeout" value and the error code is 4.
    [Thu Apr 26 11:53:32 2007] [error] [client 10.1.20.9] [ecid: 89138452752,1] MOD_OC4J_0054: Failed to call network routine to receive an ajp13 message from oc4j.
    [Thu Apr 26 11:53:32 2007] [error] [client 10.1.20.9] [ecid: 89138452752,1] MOD_OC4J_0033: Failed to receive an ajp13 message from oc4j.
    [Thu Apr 26 11:53:32 2007] [warn] [client 10.1.20.9] [ecid: 89138452752,1] MOD_OC4J_0078: Network connection errors happened to host: lawdb.keralalawsect.org and port: 12501 while receiving the first response from oc4j. This request is recoverable.
    [Thu Apr 26 11:53:32 2007] [error] [client 10.1.20.9] [ecid: 89138452752,1] MOD_OC4J_0121: Failed to service request with network worker: home_15 and it is not recoverable.
    [Thu Apr 26 11:53:32 2007] [error] [client 10.1.20.9] [ecid: 89138452752,1] MOD_OC4J_0013: Failed to call destination: home's service() to service the request.
    Please HELP ME...

    Hi this is what the solution given by your link
    A.1.6 Connection Timeouts Through a Stateful Firewall Affect System Performance
    Problem
    To improve performance the mod_oc4j component in each Oracle HTTP Server process maintains open TCP connections to the AJP port within each OC4J instance it sends requests to.
    In situations where a firewall exists between OHS and OC4J, packages sent via AJP are rejected if the connections can be idle for periods in excess of the inactivity timeout of stateful firewalls.
    However, the AJP socket is not closed; as long as the socket remains open, the worker thread is tied to it and is never returned to the thread pool. OC4J will continue to create more threads, and will eventually exhaust system resources.
    Solution
    The OHS TCP connection must be kept "alive" to avoid firewall timeout issues. This can be accomplished using a combination of OC4J configuration parameters and Apache runtime properties.
    Set the following parameters in the httpd.conf or mod_oc4j.conf configuration files. Note that the value of Oc4jConnTimeout sets the length of inactivity, in seconds, before the session is considered inactive.
    Oc4jUserKeepalive on
    Oc4jConnTimeout 12000 (or a similar value)
    Also set the following AJP property at OC4J startup to enable OC4J to close AJP sockets in the event that a connection between OHS and OC4J is dropped due to a firewall timeout:
    ajp.keepalive=true
    For example:
    java -Dajp.keepalive=true -jar oc4j.jar
    Please tell me where or which file i should put the option
    java -Dajp.keepalive=true -jar oc4j.jar ??????/

  • ODS to CUBE load taking too much time..

    Hi all ,
    we are loading the data from our ZODS to ZCUBE, but the data load is taking too much time , we haven't created any indexes , we alsotried by making infosource for the ODS but still tha same problem .. It is always showing 0 from 345674 records that is the records are not getting extracted from ODS .
    Can anybody help me in this regards , it is a bit urgent ..
    Thanks in advance.

    Hi,
    there are a few you can check. First you should check if this job hasn't ended in a dump with ST22.
    The next thing you can do, if the job doesn't end abnormaly, is to reduce the amount of records processed at the same time. Sometimes the system has trouble if the amount of records that it has to process is too large. Go to the InfoPackage -> DataS. Default Data Transfer -> Fill the maximum to 10% of de the default value. Try to run the load again.
    If the job still doesn't finish then you have to check wether or not there are any ABAP routines and/or formula involved in the update rule ? Maybe they running in a loop.
    regards,
    Raymond Baggen
    Uphantis bv

  • Combining clob taking too much time - need help

    Hello,
    I want to append clob values into another clob value like
    declare
    v_temp clob;
    v_c1_temp clob;
    cursor c1 as select clob_data from t;
    -- here t table contains clob_data column holding clob data
    -- t table have more then 1500 rows
    begin
    v_temp := '';
    open c1 into v_c1_temp;
    loop
    v_temp := v_temp + v_c1_temp; --------- combining clob (concat may be used)
    end loop;
    close(c1);
    end;
    above part also repeats in outer loop (not shown here)
    my problem is :- it is taking too much time - you dont believe 90% more time due to that concatenation.
    is it any smart way to do same thing?
    It will be very helpful to me.

    Hi ,
    You should also always try and have the latest BI content patch installed but I don't think this is the problem. It seems that there
    are alot of objects to collect. Under 'grouping' you can select the option 'only necessary objects', please check if you can
    use this option to  install the objects that you need from content.
    Best Regards,
    Des.

  • Delete query taking too much time

    Hi All,
    my delete query is taking too much time. around 1hr 30 min for 1.5 lac records.
    Though I have dropped mv log on the table & disabled all the triggers on it.
    Moreover deletion is based on primary key .
    delete from table_name where primary_key in (values)
    above is dummy format of my query.
    can anyone please tell me what could be other reason that query is performing that slow.
    Is there anything to check in DB other than triggers,mv log,constraints in order to improve the performance?
    Please reply asap.

    Delete is the most time consuming operation, as the whole record data has to be stored at the undo segments. On the other hand, there is a part of the query used to select records to delete that probably is adding an extra overhead to the process, the in (values) clause. It would be nice on your side to post another dummy from this (values) clause. I could figure out this is a subquery, and in order for you to obtain this list you have to run a inefficient query.
    You can gather the execution plan so you can see where the most heavy part of th query is. This way a better tuning approach and a more accurate diagnostic can be issued.
    ~ Madrid.

  • Server0 process taking too much time

    Hi All,
        Once i start the Netweaver server, the server) process taking too much time.
    When i was installed Netweaver that time 13 min, after 2 months 18 min.. then 25 min now it is taking 35 minutes.... to become green color.
    Why it is taking too much time, what might be the cause.....
    Give some ideas to solve this problem..............
    The server0 developer trace has this information continuously 6 to 7 times...
    [Thr 4204] *************** STISEND ***************
    [Thr 4204] STISEND: conversation_ID: 86244265
    [Thr 4204] STISEND: sending 427 bytes
    [Thr 4204] STISearchConv: found conv without search
    [Thr 4204] STISEND: send synchronously
    [Thr 4204] STISEND GW_TOTAL_SAPSEND_HDR_LEN: 88
    [Thr 4204] NiIWrite: hdl 0 sent data (wrt=515,pac=1,MESG_IO)
    [Thr 4204] STIAsSendToGw: Send to Gateway o.k.
    [Thr 4204] STIAsRcvFromGw: timeout value: -1
    [Thr 4204] NiIRead: hdl 0 recv would block (errno=EAGAIN)
    [Thr 4204] NiIRead: hdl 0 received data (rcd=3407,pac=2,MESG_IO)
    [Thr 4204] STIAsRcvFromGw: Receive from Gateway o.k.
    [Thr 4204] STISEND: data_received: CM_COMPLETE_DATA_RECEIVED
    [Thr 4204] STISEND: received_length: 3327
    [Thr 4204] STISEND: status_received: CM_SEND_RECEIVED
    [Thr 4204] STISEND: request_to_send_received: CM_REQ_TO_SEND_NOT_RECEIVED
    [Thr 4204] STISEND: ok
    [Thr 4204] STIRCV: new buffer state = BUFFER_EMPTY
    [Thr 4204] STIRCV: ok
    [Thr 4204] *************** STSEND ***************
    [Thr 4204] STSEND: conversation_ID: 86244265
    [Thr 4204] STISearchConv: found conv without search
    [Thr 4204] STSEND: new buffer state = BUFFER_DATA
    [Thr 4204] STSEND: 106 bytes buffered
    [Thr 4204] *************** STIRCV ***************
    [Thr 4204] STIRCV: conversation_ID: 86244265
    [Thr 4204] STIRCV: requested_length: 16000 bytes
    [Thr 4204] STISearchConv: found conv without search
    [Thr 4204] STIRCV: send 106 buffered bytes before receive
    [Thr 4204] STIRCV: new buffer state = BUFFER_DATA2
    [Thr 4204] *************** STISEND ***************
    then
    [Thr 4252] JHVM_NativeGetParam: get profile parameter DIR_PERF
    [Thr 4252] JHVM_NativeGetParam: return profile parameter DIR_PERF=C:\usr\sap\PRFCLOG
    this message continuously
    Can i have any solution for the above problem let me know .
    Thanks & regards,
    Sridhar M.

    Hello Manoj,
           Thanks for your quick response, Previously the server has 4GB RAM and now also it has same.
    Yesterday i found some more information, like deployed(through SDM) applications also take some memory at the time of starting the J2EE server...Is it right?
    Any other cause...let me know
    Thanks & Regards,
    Sridhar M.

  • Import taking too much time

    Hi all
    I'm quite new to database administration.my problem is that i'm trying to import dump file but one of the table taking too much time to import .
    Description::
    1 Export taken from source database which is in oracle 8i character set is WE8ISO8859P1
    2 I am taking import in 10 g with character set utf 8 and national character set is also same.
    3 dump file is about 1.5 gb.
    4 I got error like value is too large for column so in target db which is in utf 8 i convert all coloumn from varchar2 to char.
    5 while taking a import some table get import very fast bt at perticular table it get very slow
    please help me thanks in advance.......

    Hello,
    4 I got error like value is too large for column so in target db which is in utf 8 i convert all coloumn from varchar2 to char.
    5 while taking a import some table get import very fast bt at perticular table it get very slow For the point *4* it's typically due to the CHARACTER SET conversion.
    You export data in WE8ISO8859P1 and import in UTF8. In WE8ISO8859P1 characters are encoded in *1 Byte* so *1 CHAR = 1 BYTE*. In UTF8 (Unicode) characters are encoded in up to *4 Bytes* so *1 CHAR > 1 BYTE*.
    For this reason you'll have to modify the length of your CHAR or VARCHAR2 Columns, or add the CHAR option (by default it's BYTE) in the column datatype definition of the Tables. For instance:
    VARCHAR2(100 CHAR)The NLS_LENGTH_SEMANTICS parameter may be used also but it's not very well managed by export/Import.
    So, I suggest you this:
    1. set NLS_LENGTH_SEMANTICS=CHAR on your target database and restart the database.
    2. Create from a script all your Tables (empty) on the target database (without the indexes and constraints).
    3. Import the datas to the Tables.
    4. Import the Indexes and constraints.You'll have more information on the following Note of MOS:
    Examples and limits of BYTE and CHAR semantics usage (NLS_LENGTH_SEMANTICS) [ID 144808.1]For the point *5* it may be due to the conversion problem you are experiencing, it may also due to some special datatype like LONG.
    Else, I have a question, why do you choose UTF8 on your Target database and not AL32UTF8 ?
    AL32UTF8 is recommended for Unicode uses.
    Hope this help.
    Best regards,
    Jean-Valentin

  • Delta Sync taking too much time on refreshing of tables

    Hi,
    I am working on Smart Service Manager 3.0. I have come across a scenario where the delta sync is taking too much time.
    It is required that if we update the stock quantity then the stock should be updated instantaneously.
    To do this we have to refresh 4 stock tables at every sync so that the updated quantity is reflected in the device.
    This is taking a lot of time (3 to 4 min) which is highly unacceptable from user perspective.
    Please could anyone suggest something so that  only those table get refreshed upon which the action is carried out.
    For eg: CTStock table should get refreshed only If i transfer a stock and get updated accordingly
    Not on any other scenario like the changing  status from accept to driving or any thing other than stocks.
    Thanks,
    Star
    Tags edited by: Michael Appleby

    Hi fiontan,
    Thanks a lot for the response!!!
    Yeah!! I kow it's a lotta code, but i thought it'd be more informative if the whole function was quoted.
    I'm in fact using the PrintWriter to wrap the BufferedWriter but am not using the print() method.
    Does it save any time by using the print() method??
    The place where the delay is occurring is the wile loop shown below:
                while(allitems.hasMoreElements()){
                String aRow = "";
                    XDItem item = (XDItem)allitems.nextElement();
                    for(int i =0 ; i < props.length; i++){
                         String value = item.getStringValue(props);
         if(value == null || value.equalsIgnoreCase("null"))
              value = "";
                             if(i == 0)
                                  aRow = value;
                             else
                                  aRow += ("\t" + value);
    startTime1 = System.currentTimeMillis();
    System.out.println("time here is--before-writing to buffer --out.flush() done: " +startTime1);
    bufferWrt.write(aRow.toCharArray());
    out.flush();//added by rosmon to check extra time taken for extraction//
    bufferWrt.flush();//added by rosmon to check extra time taken for extraction//
    bufferWrt.newLine();
    startTime2 = System.currentTimeMillis();
    System.out.println("time here is--after-writing to buffer : " +startTime2);
    What exactly happens is that after a few loops it just seems to sleep for around 20 seconds and then again starts off and ............it goes on till the records are done.
    Please do lemme know if you have any idea as to why this is happening !!!!! This bug is giving me the scare.
    thanks in advance

  • Sites Taking too much time to open and shows error

    hi, 
    i've setup sharepoint 2013 environement correctly and created a site collection everything was working fine but suddenly now when i am trying to open that site collection or central admin site it's taking too much time to open a page but most of the time
    does not open any page or central admin site and shows following error
    event i go to logs folder under 15 hive but nothing useful found please tell me why it takes about 10-12 minutes to open a site or any page and then shows above shown error. 

    This usually happens if you are low on hardware requirements.  Check whether your machine confirms with the required software and hardware requirements.
    https://technet.microsoft.com/en-us/library/cc262485.aspx
    http://sharepoint.stackexchange.com/questions/58370/minimum-real-world-system-requirements-for-sharepoint-2013
    Please remember to up-vote or mark the reply as answer if you find it helpful.

Maybe you are looking for

  • Exchange and Office Web Apps Integration - Wrong Url to Outlook Web App port 444

    Hi, I'm trying to setup Office Web Apps integration with Exchange 2013.  Office Web Apps are working fine with SharePoint 2013 and the WAC servers are listed as in a healthy state. When trying to open an office document from OWA I get the usual "Sorr

  • Validation on text item

    Hi all, i have a text item P6_MAXLIABILITY I put a validation on that item with regular expression. I want that validation to happen, when the focus moves to the next item. could any one give me a suggestion? bye Srikavi

  • Is there any way of replacing a backslash with a frontslash ?

    I have a major problem here. I used an installer to install my product to the respective folder. But the thing is the installer uses a backslash instead of a frontslash. As a result, my java program is unable to process it. Is there anyway of replaci

  • How many years we can store the data in ODS as well as psa data ?

    Hi guru's how many years we can store the data in ODS? can u give particular years ? how many days we can store the data in psa ? could u tell me step by step procedure ? Thanks Reddy prabha

  • Duplicated tax value

    Hi All, I have a customer who entered a service AP invoice - the line is for 70$ and the tax value is 7$. But the footer information says the tax is 14$ and the document total is 84$ In the JE the vendor is credited with 84$ but only 7$ tax is posted