More time in Extracting result set ( performence)  VERY URGENT

Hi all,
This program is taking much more time in Extracting the  the result set.........(How to increase the performence of this program)
How to decrease the Execuition of the time.......???
***INCLUDE Z00_BCI010 .
TABLES: z00_bc_cpt_sess,       " Stockage des compteurs associés aux
                               " progs de traitement.
        z00_bc_erreur,         " Table des anomalies des programmes
" spécifiques.
*début ajout FAE 30463
        z00_bc_err_log.        "Table de stockage et retention des
"erreurs
*fin ajout FAE 30463
       t100.                  " Messages.
                   Déclaration des données internes                  *
Table interne des anomalies.
DATA: BEGIN OF itb_erreur OCCURS 0.
        INCLUDE STRUCTURE z00_bc_erreur.
DATA: END OF itb_erreur.
Nombre de jour pour la suppression des données dans la table des
anomalies
DATA: i_nb_jour(3) TYPE n.
*début ajout FAE 30463
DATA: w_dl_delai    LIKE z00_bc_err_log-z_delai,
      w_in_stockage LIKE z00_bc_err_log-z_stockage VALUE 'X'.
*fin ajout FAE 30463
Date et heure d'éxécution.
DATA: i_dt_date_execution LIKE sy-datum,
      i_hr_heure_execution LIKE sy-uzeit.
Date de suppression.
DATA: z_date LIKE sy-datum.
Compteur de session.
DATA: o_ct_session LIKE z00_bc_cpt_sess-z_ct_session.
Compteur pour le numéro de ligne de la table d'anomalie.
DATA: l_ct_num_ligne LIKE z00_bc_erreur-z_no_num_ligne VALUE '00'.
Données utile au remplissage de la table interne des anomalies.
Nom du programme ABAP.
DATA: i_repid LIKE z00_bc_erreur-z_repid.
Libellé du traitement.
DATA: w_lb_traitement LIKE itb_erreur-z_lb_lib_trait.
Clé identifiant l'objet traité.
DATA: i_ds_clef_objet LIKE z00_bc_erreur-z_ds_clef_objet.
Code anomalie.
DATA: i_cd_message LIKE sy-msgno.
Type de message d'anomalie.
DATA: i_ty_message LIKE sy-msgty.
Classe de message.
DATA: i_classe_message LIKE sy-msgid.
Variable de message.
DATA: i_msgv1 LIKE sy-msgv1,
      i_msgv2 LIKE sy-msgv2,
      i_msgv3 LIKE sy-msgv3,
      i_msgv4 LIKE sy-msgv4.
Phase d'éxécution du programme.
DATA: i_in_phase_exec LIKE z00_bc_erreur-z_in_phase_exec.
Libellé de la clé.
DATA: i_clef_objet(30).
Constante.
CONSTANTS: k_heure(8) VALUE 'Heure',                        "#EC NOTEXT
           k_code(4) VALUE 'Code',                          "#EC NOTEXT
           k_lb_message(80) VALUE 'Désignation',            "#EC NOTEXT
           k_ligne LIKE sy-linsz VALUE '127',
k_societe LIKE sy-title VALUE 'SCHNEIDER ELECTRIC INDUSTRIES S.A.S.',
           k_projet LIKE sy-title VALUE 'LOGOS'.
                            TRAITEMENT                               *
Nettoyage de la table interne et des données.
FREE itb_erreur.
CLEAR: i_msgv1,
       i_msgv2,
       i_msgv3,
       i_msgv4.
    Form F930_INIT                                                   *
Fonction :                                                           *
- Renseigne la table transparente des anomalies.                     *
Donnée globale :                                                     *
- ITB_ERREUR             Tables internes des erreurs.                *
Entrées :                                                            *
- I_REPID                Nom du programme en erreur.                 *
- I_NB_JOUR              Nombre de jour avant la suppression des     *
                         enrgistrement de la lable Z00_BC_ERREUR.    *
Sortie :                                                             *
- O_CT_SESSION           Compteur de session.                        *
FORM f930_init USING i_repid
                     i_nb_jour.
Appel de la routine de suppression des vieux enregistrement.
  PERFORM f911_suppression_anomalie USING i_repid
                                          i_nb_jour.
Mise à jour des compteur de session.
  PERFORM f912_maj_z00_bc_cpt_sess USING i_repid
                                   CHANGING o_ct_session.
ENDFORM.
    Form F930_INIT_BLOCAGE                                           *
Fonction :                                                           *
- Suppression des vieux enregistrements
- mise à jour table session
Donnée globale :                                                     *
- ITB_ERREUR             Tables internes des erreurs.                *
Entrées :                                                            *
- I_REPID                Nom du programme en erreur.                 *
- I_NB_JOUR              Nombre de jour avant la suppression des     *
                         enrgistrement de la lable Z00_BC_ERREUR.    *
Sortie :                                                             *
- O_CT_SESSION           Compteur de session.                        *
FORM f930_init_blocage USING i_repid
                             i_nb_jour.
Appel de la routine de suppression des vieux enregistrement.
avec contrôle entrée de blocage
  PERFORM f911_suppression_anomalie_bloc USING i_repid
                                               i_nb_jour.
Mise à jour des compteur de session.
  PERFORM f912_maj_z00_bc_cpt_sess USING i_repid
                                   CHANGING o_ct_session.
ENDFORM.
    Form F900_ERREUR                                                 *
Fonction :                                                           *
- Renseigne la table transparente des anomalies.                     *
Donnée globale :                                                     *
- ITB_ERREUR             Tables internes des erreurs.                *
Donnée locale :                                                      *
- l_CT_NUM_LIGNE         Compteur de ligne                           *
- O_CT_SESSION           Numéro du compteur de session               *
Entrées :                                                            *
- I_REPID                Nom du programme en erreur.                 *
- I_IN_PHASE_EXEC        Phase d'éxécution du programme              *
- I_DS_CLEF_OBJET        Clé identifiant l'objet traité.             *
- I_DT_DATE_EXECUTION    Date d'éxécution.                           *
- I_HR_HEURE_EXECUTION   Heure d'éxécution.                          *
- I_TY_MESSAGE           Type de message.                            *
- I_CD_MESSAGE           code anomalie.                              *
- I_CLASSE_MESSAGE       Classe de message.                          *
- I_MSGV1                Variable de message.                        *
- I_MSGV2                Variable de message.                        *
- I_MSGV3                Variable de message.                        *
- I_MSGV4                Variable de message.                        *
FORM f900_erreur USING i_repid
                       i_in_phase_exec
                       i_ds_clef_objet
                       i_dt_date_execution
                       i_hr_heure_execution
                       i_ty_message
                       i_cd_message
                       i_classe_message
                       value(i_msgv1)
                       value(i_msgv2)
                       value(i_msgv3)
                       value(i_msgv4).                      "#EC CALLED
DE3K913901 début ajout
On récupère l'incrément qui sera inclu au n°de session :
  IF o_ct_session IS INITIAL
  AND i_repid = 'Z06_MMR001'.
    PERFORM f912_maj_z00_bc_cpt_sess USING 'Z06_MMR001'
                                     CHANGING o_ct_session.
  ENDIF.
DE3K913901 fin ajout
Nettoyage de la zone de l'en tete de la table interne.
  CLEAR itb_erreur.
Incrementation du compteur du numéro de ligne de la table d'anomalie.
  l_ct_num_ligne = l_ct_num_ligne + 1.
Remplissage de la table interne.
  MOVE: i_repid TO itb_erreur-z_repid,
        l_ct_num_ligne TO itb_erreur-z_no_num_ligne,
        i_dt_date_execution TO itb_erreur-z_dt_date_exec,
        i_hr_heure_execution TO itb_erreur-z_hr_heure_exec,
        w_lb_traitement TO itb_erreur-z_lb_lib_trait,
        i_in_phase_exec TO itb_erreur-z_in_phase_exec,
        i_ds_clef_objet TO itb_erreur-z_ds_clef_objet.
  CONCATENATE i_ty_message
              i_cd_message
         INTO itb_erreur-z_cd_message.
Récupération du libellé du message.
  CALL FUNCTION 'MESSAGE_TEXT_BUILD'
       EXPORTING
            msgid               = i_classe_message
            msgnr               = i_cd_message
            msgv1               = i_msgv1
            msgv2               = i_msgv2
            msgv3               = i_msgv3
            msgv4               = i_msgv4
       IMPORTING
            message_text_output = itb_erreur-z_lb_message.
*début modification FAE 30463
*Si  le flag est pas coché, on met à jour la table des erreurs
*Z00_BC_ERREUR
*s'il n'y a pas d'entrée dans la table on met aussi à jour
*Z00_BC_ERREUR
  IF NOT w_in_stockage IS INITIAL.
Mise à jour de la table.
    PERFORM f910_mise_a_jour.
  ENDIF.
Mise à jour de la table interne.
  APPEND itb_erreur.
Nettoyage des variables.
  CLEAR: i_msgv1,
         i_msgv2,
         i_msgv3,
         i_msgv4.
*fin modification FAE 30463
ENDFORM.
    Form F910_MISE_A_JOUR                                            *
Fonction :                                                           *
- Mets à jour les tables Z00_BC_CPT_SESS et Z00_BC_ERREUR.           *
Donnée globale :                                                     *
- ITB_ERREUR            Tables internes des erreurs.                 *
FORM f910_mise_a_jour.
Mise à jour des anomalies.
  MOVE-CORRESPONDING itb_erreur TO z00_bc_erreur.
  CONCATENATE itb_erreur-z_dt_date_exec
              itb_erreur-z_hr_heure_exec
              o_ct_session
         INTO z00_bc_erreur-z_no_num_session.
  MODIFY z00_bc_erreur.
ENDFORM.
    Form F911_SUPPRESSION_VIEILLE_ANOMALIE                           *
Fonction :                                                           *
- Supprime les villes anomalies.                                     *
Donnée globale :                                                     *
- Z00_BC_ERREUR       Table des anomalies des programmes spécifiques.*
Entrée :                                                             *
- I_REPID             Nom du programme en erreur.                    *
- I_NB_JOUR           Nombre de jour avant la suppression des        *
                      enrgistrement de la lable Z00_BC_ERREUR.       *
FORM f911_suppression_anomalie USING i_repid
                                     i_nb_jour.
début ajout FAE 30463
  SELECT SINGLE z_stockage z_delai
           INTO (w_in_stockage, w_dl_delai)
           FROM z00_bc_err_log
          WHERE z_repid = i_repid.
*si le programme est dans la table z00_bc_err_log, on récupère la zone
Z_DELAI (délai de rétention des erreurs)
*sinon le délai est celui passé en paramètre de cette fonction
  IF sy-subrc = 0.
    z_date = sy-datum - w_dl_delai.
  ELSE.
    z_date = sy-datum - i_nb_jour.
  Pas d'enreg. ds table param, alors on stockera ds Z00_BC_ERREUR
    w_in_stockage = 'X'.
  ENDIF.
fin ajout FAE 30463
Suppression des enregistrements trop vieux.
  DELETE FROM z00_bc_erreur WHERE z_repid EQ i_repid
                              AND z_dt_date_exec LE z_date.
ENDFORM.
    Form F911_SUPPRESSION_ANOMALIE_BLOC                              *
Fonction :                                                           *
- Supprime les villes anomalies en tenant compte des objets de bloc  *
Donnée globale :                                                     *
- Z00_BC_ERREUR       Table des anomalies des programmes spécifiques.*
Entrée :                                                             *
- I_REPID             Nom du programme en erreur.                    *
- I_NB_JOUR           Nombre de jour avant la suppression des        *
                      enrgistrement de la lable Z00_BC_ERREUR.       *
FORM f911_suppression_anomalie_bloc USING i_repid
                                             i_nb_jour.
Blocage de la table
  CALL FUNCTION 'ENQUEUE_EZ00_BC_ERREUR'
    EXPORTING
      mode_z00_bc_erreur         = 'E'
      z_mandt                    = sy-mandt
      z_repid                    = i_repid
  X_Z_REPID                  = ' '
  _SCOPE                     = '2'
  _WAIT                      = ' '
  _COLLECT                   = ' '
    EXCEPTIONS
      foreign_lock               = 1
      system_failure             = 2
      OTHERS                     = 3.
Suppression des enr que si la table pour ce pg n'est pas bloquée
Si bloquée => ne rien faire car suppression aura déjà eu lieu
  IF sy-subrc EQ 0.
début ajout FAE 30463
    SELECT SINGLE z_stockage z_delai
             INTO (w_in_stockage, w_dl_delai)
             FROM z00_bc_err_log
            WHERE z_repid = i_repid.
*si le programme est dans la table z00_bc_err_log, on récupère la zone
Z_DELAI (délai de rétention des erreurs)
*sinon le délai est celui passé en paramètre de cette fonction
    IF sy-subrc = 0.
      z_date = sy-datum - w_dl_delai.
    ELSE.
      z_date = sy-datum - i_nb_jour.
    Pas d'enreg. ds table param, alors on stockera ds Z00_BC_ERREUR
      w_in_stockage = 'X'.
    ENDIF.
fin ajout FAE 30463
Suppression des enregistrements trop vieux.
    DELETE FROM z00_bc_erreur WHERE z_repid EQ i_repid
                                AND z_dt_date_exec LE z_date.
Déblocage de la table.
    CALL FUNCTION 'DEQUEUE_EZ00_BC_ERREUR'
         EXPORTING
     MODE_Z00_BC_ERREUR         = 'E'
              z_mandt              = sy-mandt
              z_repid              = i_repid.
  ENDIF.
ENDFORM.
    Form F912_MAJ_Z00_BC_CPT_SESS                                    *
Fonction :                                                           *
- Renseigne la table transparente des sessions.                      *
Données globales :                                                   *
- z00_BC_CPT_SESS      Stockage des compteurs associés aux progs de  *
                       traitement.                                   *
- Z00_BC_ERREUR        Table des anomalies des programmes spécifiques*
Entrée :                                                             *
- I_REPID              Nom du programme en erreur.                   *
Sortie :                                                             *
- O_CT_SESSION         Numéro de session.                            *
FORM f912_maj_z00_bc_cpt_sess USING i_repid
                              CHANGING o_ct_session.
Blocage de la table
  CALL FUNCTION 'ENQUEUE_EZ00_BC_CPT_SESS'
    EXPORTING
      mode_z00_bc_cpt_sess       = 'E'
      z_mandt                    = sy-mandt
      z_repid                    = i_repid
  X_Z_REPID                  = ' '
  _SCOPE                     = '2'
  _WAIT                      = ' '
  _COLLECT                   = ' '
    EXCEPTIONS
      foreign_lock               = 1
      system_failure             = 2
      OTHERS                     = 3.
Si la table est déjà vérouillée.
  IF sy-subrc NE 0.
    DO.
Si c'est la 99eme fois que l'on reboucle alors on sort du programme.
      IF sy-index EQ 99.
        STOP.
      ENDIF.
sinon attendre 1 seconde.
      WAIT UP TO 1 SECONDS.
Blocage de la table
      CALL FUNCTION 'ENQUEUE_EZ00_BC_CPT_SESS'
        EXPORTING
          mode_z00_bc_cpt_sess       = 'E'
          z_mandt                    = sy-mandt
          z_repid                    = i_repid
         X_Z_REPID                  = ' '
         _SCOPE                     = '2'
         _WAIT                      = ' '
         _COLLECT                   = ' '
        EXCEPTIONS
          foreign_lock               = 1
          system_failure             = 2
          OTHERS                     = 3.
Si table bloquée.
      IF sy-subrc EQ 0.
        EXIT.
      ENDIF.
    ENDDO.
  ENDIF.
Lecture dans la table des sessions.
  SELECT SINGLE * FROM z00_bc_cpt_sess WHERE z_repid EQ i_repid.
Contrôle si un enregistrement avec le même nom de programme existe et
si le compteur de session est différent de '99'.
  IF sy-subrc EQ 0 AND z00_bc_cpt_sess-z_ct_session NE 99.
    z00_bc_cpt_sess-z_ct_session = z00_bc_cpt_sess-z_ct_session + 1.
    o_ct_session = z00_bc_cpt_sess-z_ct_session.
    MODIFY z00_bc_cpt_sess.
Si un enregistrement avec le même nom de programme existe et
si le compteur de session est égal à '99'.
  ELSEIF sy-subrc EQ 0 AND z00_bc_cpt_sess-z_ct_session EQ 99.
    o_ct_session = z00_bc_cpt_sess-z_ct_session.
    MODIFY z00_bc_cpt_sess.
Sinon.
  ELSEIF sy-subrc NE 0.
    z00_bc_cpt_sess-z_ct_session = '00'.
    z00_bc_cpt_sess-z_repid = i_repid.
    o_ct_session = z00_bc_cpt_sess-z_ct_session.
    MODIFY z00_bc_cpt_sess.
  ENDIF.
  COMMIT WORK.
Déblocage de la table.
  CALL FUNCTION 'DEQUEUE_EZ00_BC_CPT_SESS'
       EXPORTING
            mode_z00_bc_cpt_sess = 'E'
            z_mandt              = sy-mandt
            z_repid              = i_repid.
  X_Z_REPID                  = ' '
  _SCOPE                     = '3'
  _SYNCHRON                  = ' '
  _COLLECT                   = ' '
ENDFORM.
    Form F920_TOP_OF_PAGE                                            *
Fonction :                                                           *
- Entête Schneider                                                   *
Entrée :                                                             *
- I_REPID              Nom du programme en erreur.                   *
FORM f920_top_of_page USING i_repid.                        "#EC CALLED
En-tete de page.
  CALL FUNCTION 'Z_00_BC_TOP_OF_PAGE'
       EXPORTING
            p_linsz   = k_ligne
            p_pagno   = sy-pagno
            p_prog    = i_repid
            p_projet  = k_projet
            p_societe = k_societe
            p_sujet   = sy-title.
  IF sy-subrc = 0.
  ENDIF.
ENDFORM.
    Form F920_EDITION                                                *
Fonction :                                                           *
- Edition des erreurs.                                               *
Données globales :                                                   *
- ITB_ERREUR           Table interne des anomalies.                  *
Entrée :                                                             *
- I_REPID              Nom du programme en erreur.                   *
- I_CLEF_OBJET,        Désignation de la clé de l'objet.             *
FORM f920_edition USING i_repid
                        i_clef_objet.                       "#EC CALLED
En-tete de tableau.
  WRITE AT (sy-linsz) sy-uline.
  WRITE:          sy-vline,
                  k_heure(8),
                  sy-vline,
                  k_code(4),
                  sy-vline,
                  k_lb_message(80),
                  sy-vline,
                  i_clef_objet.
  WRITE AT sy-linsz sy-vline.
  LOOP AT itb_erreur.
Edition de la table interne des anomalies.
Controle des couleurs.
    IF itb_erreur-z_cd_message(1) NE 'S'.
      IF itb_erreur-z_cd_message(1) EQ 'W'.
        FORMAT COLOR = 7 INTENSIFIED OFF.
      ELSEIF itb_erreur-z_cd_message(1) EQ 'I'.
        FORMAT COLOR = 3 INTENSIFIED OFF.
      ELSE.
        FORMAT COLOR = 6 INTENSIFIED OFF.
      ENDIF.
    ELSE.
      FORMAT COLOR = 5 INTENSIFIED ON.
    ENDIF.
    WRITE AT (sy-linsz) sy-uline.
    WRITE:          sy-vline,
                    itb_erreur-z_hr_heure_exec,
                    sy-vline,
                    itb_erreur-z_cd_message(4),
                    sy-vline,
                    itb_erreur-z_lb_message(80),
                    sy-vline,
*Begin change PIT DE3K936510
                   itb_erreur-z_ds_clef_objet(27).
                    itb_erreur-z_ds_clef_objet(59).
*End change PIT DE3K936510
    WRITE AT sy-linsz sy-vline.
  ENDLOOP.
  WRITE AT (sy-linsz) sy-uline.
ENDFORM.
INCLUDE: z00_bci010.                   " Gestion des anomalies.
                      Déclaration des données                        *
                   Tables de la bases de données                     *
TABLES:
        ekpo,        " Poste document d'achat.
        lfa1,        " Base fournisseurs (généralités).
        marc,        " Données division de l'article.
        z03_bw_cmp1,
        eord,        "Répertoire des sources appro. Achats
        eina,        "Fiche infos-achats - données générales
        t024,        "Groupes d'acheteurs
        tvarv.                                              "FAE17345+
                   Déclaration des données internes                  *
Déclaration de la table interne qui permet de recuperer les mois.
DATA: BEGIN OF itb_months OCCURS 12.
        INCLUDE STRUCTURE t247.
DATA: END OF itb_months.
Table pour récupération d'infos sur les divisions
DATA: BEGIN OF itb_t001w OCCURS 0,
        werks LIKE t001w-werks,
        fabkl LIKE t001w-fabkl," Clé du calendrier d'entreprise
      END OF itb_t001w.
Déclaration de la table interne contenant les infos sur l'adresse du
fournisseur.
DATA: BEGIN OF itb_adresse OCCURS 0,
        lifnr LIKE lfa1-lifnr,           " Numéro de compte fournisseur.
        name1 LIKE lfa1-name1,                              " Nom 1.
        name2 LIKE lfa1-name2,                              " Nom 2.
        name3 LIKE lfa1-name3,                              " Nom 3.
        name4 LIKE lfa1-name4,                              " Nom 4.
        stras LIKE lfa1-stras,           " N° de rue et nom de la rue.
        pstlz LIKE lfa1-pstlz,           " Code postal.
        ort01 LIKE lfa1-ort01,           " Localité.
        pfach LIKE lfa1-pfach,           " Boîte postale.
        pstl2 LIKE lfa1-pstl2,           " Code de la boîte postale.
        land1 LIKE lfa1-land1,           " Clé de pays.
        landx LIKE t005t-landx,          " Pays.
        spras LIKE lfa1-spras,           " Code langue
END OF itb_adresse.
Déclaration d'une table interne pour les informations sur les
prévisions de commande.
DATA: BEGIN OF itb_prev_cde OCCURS 0,
        werks LIKE marc-werks,            " Division
        idnlf LIKE eina-idnlf,            " ADDsde ref article frn
        lifnr LIKE eord-lifnr,            " N° fournisseur.
        ekgrp LIKE marc-ekgrp,            " Groupe d'acheteurs
        dispo LIKE marc-dispo,            " Code gestionnaire MRP
        matnr LIKE eord-matnr,            " Article.
        maktx LIKE makt-maktx,            " Désignation article.
        bstmi LIKE marc-bstmi,            " Quantité de commande.
        men00 LIKE plaf-gsmng,            " Quantité du mois en cours M.
        men01 LIKE plaf-gsmng,            " Quantité pour le mois M+1.
        men02 LIKE plaf-gsmng,            " Quantité pour le mois M+2.
        men03 LIKE plaf-gsmng,            " Quantité pour le mois M+3.
        men04 LIKE plaf-gsmng,            " Quantité pour le mois M+4.
        men05 LIKE plaf-gsmng,            " Quantité pour le mois M+5.
        men06 LIKE plaf-gsmng.            " Quantité pour le mois M+6.
DATA: END OF itb_prev_cde.
Structure de travail pour les commandes convernant les PFC
DATA str_pca_pfc  LIKE itb_prev_cde.
*add sde
DATA str_eord_pfc  LIKE itb_prev_cde.
Structure de travail pour les prévisons PFC
DATA str_prev_pfc LIKE itb_prev_cde.
Déclaration d'une table interne pour les informations sur le
portefeuille des commandes d'achat.
DATA: BEGIN OF itb_pca OCCURS 0,
        werks LIKE ekpo-werks,    " Division
        idnlf LIKE eina-idnlf,     " ADDsde ref article frn
        lifnr LIKE eord-lifnr,    " N° fournisseur.
        ekgrp LIKE marc-ekgrp,    " Groupe d'acheteurs
        dispo LIKE marc-dispo,    " Code gestionnaire MRP
        matnr LIKE eord-matnr,    " Article.
        maktx LIKE makt-maktx,    " Désignation article.
        ebeln LIKE ekes-ebeln,    " Numéro du document d'achat.
        ebelp LIKE ekes-ebelp,    " Numéro de poste du document d'achat.
        slfdt LIKE eket-slfdt,    " Date de livraison statistique
        eindt LIKE ekes-eindt,    " Date de livraison indiquée dans la
                                  " confirmation de la cde.
        menge LIKE ekes-menge,    " Quantité indiquée dans la confirma-
                                  " tion de la commande.
        attdu LIKE eket-wemng,    " Portefeuille fournisseur.
        netpr LIKE ekpo-brtwr,    " Prix net du document d'achat dans
                                  " la devise du document.
        rtard TYPE i,             " Retard en jours ouvres.
        wemng LIKE eket-wemng,    " Quantité de l'entrée de marchandise.
        bldat LIKE mkpf-bldat,    " Date inscrite sur la pièce/sur le
                                  " document.
        qtran LIKE ekes-menge,    " Quantité en transit.
        dtran LIKE ekes-eindt.    " Date du dernier avis de transit.
DATA: END OF itb_pca.
DATA: w_i TYPE i,                "Compteur
      w_i_char(1) TYPE c,        "Texte pour récupérer compteur
      w_nm_zone(20) TYPE c,      "Nom zone pour assign au field-symbols
      w_nb_j TYPE i,             "Nb de jours ouvrés jusqu'à fin mois
      w_nb_j_tot TYPE i.         "Nb de jours ouvrés du mois
FIELD-SYMBOLS:       TYPE ANY.
Déclaration d'une table contenant les fiches info achat.
DATA: BEGIN OF itb_eina OCCURS 0,
        matnr LIKE eina-matnr,
        lifnr LIKE eina-lifnr,
        idfnl LIKE eina-idnlf.
DATA: END OF itb_eina.
Déclaration d'une table contenant les infos groupe acheteur.
*DATA: BEGIN OF itb_t024 OCCURS 0,
       ekgrp LIKE t024-ekgrp,
       eknam LIKE t024-eknam,
       ektel LIKE t024-ektel,
       telfx LIKE t024-telfx.
*DATA: END OF itb_t024.
Déclaration d'une table pour le transfert du fichier.
DATA: BEGIN OF itb_transfert OCCURS 0,
        col00(8),                 "division
        col00bis(20),             "Reference article
        col01(18),                "No article
        col02(45),                "libelle article
        col021(17),               "Groupe acheteur
        col022(13),               "gestionnaire
        col03(17),                "qte commandée ou No de commande
        col04(13),                "Mois 1 ou No poste cde
        col05(20),                "Mois 2 ou délai initial
        col06(33),                "Mois 3 ou délai négocié
        col07(13),                "Mois 4 ou qté cdée
        col08(13),                "Mois 5 ou qté attendue
        col09(13),                "Mois 6 ou Montant attendu
        col10(13),                "Mois 7 ou retard
        col11(13),                "qte partielle livree
        col12(13),                "date livraison partielle
        col13(13),                "qté en transit
        col14(13).                "date
DATA: END OF itb_transfert.
Déclaration d'une table contenant la liste des fournisseurs.
DATA: BEGIN OF itb_lifnr OCCURS 0,
        werks LIKE marc-werks,
        idfnl LIKE eina-idnlf,
        lifnr LIKE eord-lifnr,
        ekgrp LIKE marc-ekgrp,
        spras LIKE lfa1-spras,
        eknam LIKE t024-eknam,
        ektel LIKE t024-ektel,
        telfx LIKE t024-telfx.
DATA: END OF itb_lifnr.
Déclaration d'une structure pour la selection dans la table MSEG.
DATA : BEGIN OF itb_mseg OCCURS 0,
         mblnr LIKE mseg-mblnr,
         mjahr LIKE mseg-mjahr,
         ebeln LIKE mseg-ebeln,
         ebelp LIKE mseg-ebelp,
       END OF itb_mseg.
déclaration d'une structure pour la selection dans EKPO.
DATA : BEGIN OF itb_ekpo OCCURS 0,
ebeln LIKE ekpo-ebeln,
         lifnr LIKE ekko-lifnr,
         ekgrp LIKE ekko-ekgrp,
         ebelp LIKE ekpo-ebelp,
         matnr LIKE ekpo-matnr,
         werks LIKE ekpo-werks,
         menge LIKE ekpo-menge,
         bpumz LIKE ekpo-bpumz,
         netpr LIKE ekpo-netpr,
         peinh LIKE ekpo-peinh,  "Base de prix FAE17345+
          "AFT++
         bpumn LIKE ekpo-bpumn,
         dispo LIKE marc-dispo,   "AFT++
       END OF itb_ekpo.
déclaration d'une structure pour la selection dans EKPO.
DATA : BEGIN OF itb_ekko OCCURS 0,
         ebeln LIKE ekko-ebeln,
         lifnr LIKE ekko-lifnr,
         spras LIKE ekko-spras,
       END OF itb_ekko.
déclaration d'une structure pour la selection dans EKES.
DATA : BEGIN OF itb_ekes OCCURS 0,
         ebeln LIKE eket-ebeln,
         ebelp LIKE eket-ebelp,
         etens LIKE ekes-etens,
         ebtyp LIKE ekes-ebtyp,
         eindt LIKE ekes-eindt,
         menge LIKE ekes-menge,
         dabmg LIKE ekes-dabmg,
       END OF

hai ,
use code inspector to find the performance issue sorce code and also it gives some tips to tune the peformance.
Go to program in display mode or editable mode and in  menu bar you
have program menu in first......chose it and go to cheak....select it we have list including code inspector do it and tune it............
plzz reward if useful
regards,
jai.m

Similar Messages

  • Just in time creation of Result Set

    I have this problem which is bugging me a lot. Actually I want to display some data on the browser by fetching it from the database. Now this result set could be quite big. So i would like to display on multiple pages like if there are 100 rows then 25 rows per page, so in total 4 pages. One way to do this load all data in memory and then display it moving your cursor down, but in this technique u have to keep large amount of data in memory. I want to fetch these rows as required like first time top 25 rows, next time next 25 rows and so on. I am stuck.. Please help me!!

    //you could use a Select bean:
    private com.ibm.ivj.db.uibeans.Select getSelectSQL() {
         if (ivjSelectSQL == null) {
              try {
                   ivjSelectSQL = new com.ibm.ivj.db.uibeans.Select();
                   ivjSelectSQL.setReadOnly(true);
                   ivjSelectSQL.setQuery(new com.ibm.ivj.db.uibeans.Query               ivjSelectSQL.setQuery(new com.ibm.ivj.db.uibeans.Query(getMyCon(), sqlGeneral()));
              } catch (java.lang.Throwable ivjExc) {
                   handleException(ivjExc);
         return ivjSelectSQL;
              ivjScrollPaneTableGen.setModel(getSelectSQL());
              ivjScrollPaneTableGen.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    ivjScrollPaneTableGen.setAutoCreateColumnsFromModel(true);
              getSelectSQL().execute();
    // after this your table will contain automatically all the rows.
    how the NextPage should work I haven't done yet, but I saw there is a setViewport(JViewport) function in JScrollPane class which seems to do the thing that you want.

  • Doubt in setting values-- very urgent - please!

    hai,
    i am creating a java bean ..
    public void setTitle_cont(String proj_title_cont[])
         for(int i=0;i<3;i=i+1)
         this.proj_title_cont[i] = proj_title_cont;
    public String getTitle_cont()
    {//error come here - says "missing return statement"
         for(int i=0;i<3;i=i+1)
         return proj_title_cont[i];
    setTitle_cont() is working fine..but getTitle_cont() shows error...
    can anyone please help out..its very urgent..
    thanx in advance
    regards
    koel

    Your code looks strange, it contains some errors. First of all, what does your set...() method do? You have a for-loop that does the same thing 3 times. Your get...() method has a return inside a for-loop. That makes no sense; the method will return at the first iteration.
    What is the type of the member variable proj_title_cont? Is it a strring array (String[]) or a single string (String)?
    You probably wanted to do something like this:
    // member variable
    private String[] proj_title_cont;
    public void setTitle_cont(String[] proj_title_cont)
      this.proj_title_cont = proj.title.cont;
    public String[] getTitle_cont()
      return this.proj_title.cont;
    }Jesper

  • Time overlapping of data record..very urgent

    Hi All,
    while loading time dependent data(texts..0HRPOSITION), i am geeting the following error....
    Processing (data packet): Errors occurred
       Data Package 1 ( 7418 Records ) : Errors occurred
              Update ( 0 new / 0 changed ) : Errors occurred
                   Data records for package 1 selected in PSA - 2 error(s)
                   Record 7415 :0HRPOSITION : Time overlapping of data record 7415 with 7416 : '['20100924'/'20070618'] " .
                   Record 7416 :0HRPOSITION : Time overlapping of data record 7415 with 7416 : '['20100924'/'20070618'] ....
    Could anyone let me know how to rectify this error and reload the IP..I am workning on production system.....its very urgent
    Thanks in advance.
    Manjula

    Hi Manjula
    !)0HRposition infobject and check what is the time previously for that record..
    2)Edit the PSA for the 7415 or 7416  and change the vlaue to the previous record time which u found in the infoobject
    3) i think ur doing a full load.  so better edit the PSA and repload the data from PSA
    Regards
    AK

  • Time out error in oracle reports--very urgent

    Hi
    I have this oracle report on 9i which calls 14 other reports and runs them
    via a wrapper report which I run from a URL
    However I get this engine null crashed error or else Engine rwEng-0 is destroyed due to timeout error.
    From what I understand there is a timeout issue happening bcoz reports is taking a long time to run.Hence I increased the value of engineResponseTimeOut but it does not help either.Would you have any other idea to resolve this issue?
    Could someone plz tell me urgently how can this be resolved.This is on Oracle 9i.
    Thanks

    Hi Ravi kanth,
    You are using select * statement which is very time consuming and low performance. Dont use select * instead use select field1 field2.... into table itab  where field1 = s_field.  Use corresponding field names in the select statement.
    Follow the below rules.
    1) Dont use nested select statements
    2) If possible use for all entries in addition
    3) In the where addition make sure you give all the primary key
    4) Use Index for the selection criteria.
    5) You can also use inner joins
    6) You can try to put the data from the first select statement into an Itab and then in order to select the data from the second table use for all entries in.
    7) Use the runtime analysis SE30 and SQL Trace (ST05) to identify the performance and also to identify where the load is heavy, so that you can change the code accordingly
    <b>reward if useful</b>.
    Regards,
    sunil kairam.

  • 2LIS_03_UM Set up -Very Urgent

    Hi Gurus,
    I'm trying to fill the set-up tables for DataSource 2LIS_03_UM. I have 5 Company codes.
    While I execute T.Code OLIZBW, it prompts for an entry in Archiving Run apart from the Company Code, Name of Run, Termination time.
    Where do you get the numeric value of the "Archiving Run"? I can't fill the set-up table without the value for the "Archiving Run".
    Kindly help me out.
    Thanks in advance.

    Dear Swetha,
      2LIS_03_UM in you filling the um no need to give the
    archive run. only select company code and name of run
    and termination date and time .
    jobs run in background only -->select program in menu bar
    execute in background>give the printer name and select immediately
    like this fill the all company codes..
    assign points ...if its helpful......
    rama

  • Source System Extraction taking more time

    Hi All,
    I Have an Issue, please help me out in this.
    We have two source systems in our process. One is working fine. We dont have any issue with that. But another source system taking more time to extract the data in the source system than usual. From few days only we are facing this problem. Record count is also normal. I am unable find root cause for this, please help me out regarding this issue.
    It is Full update. We are using Custom program to extract the data. It is running daily.
    Thanks in Advance.
    Regards,
    Suresh
    Edited by: sureshd on Jul 14, 2011 6:04 PM
    Edited by: sureshd on Jul 14, 2011 6:05 PM

    When a long running job is running in the source system side you can trace it through ST05. Simultaneously you can monitor the screen of SM50/SM66 to see what are the tables being accessed during the job.
    After the loading is completed, you can deactivate the trace and then go to the Display trace option where you would see various number of SQL statements along with their tables. Check which particular statement is an expensive one by looking at the time stamp.
    Then next job is to decide why that table is being accessed for so much of time and how to improve the run time of the table. check the fields inside the table and their selectivity and see wether any index already exist on that. You can do this by going into SE11. If index is not available on those specific fields ask your Basis Guy to create a secondary one on top of it which may help in better performance. hope it helps.

  • Result set looping and arrays??????????

    Hey i have a result set problem in using an applet connected to a database.
    After i have accessed a database, i am using a result set to store these values, then put them into arrays to out put to screen. im using:
    count = 0;
    while(rs.next())
    lecturer[count] = rs.getString("FirstName") + " " + rs.getString("Surname");
    room[count] = rs.getString("Room_No");
    sentence = rs.getString("Subjects");
    if(sentence.length()>12)
    space = sentence.indexOf(" ");
    subject[count] = sentence.substring(0,(space));
    subject2[count] = sentence.substring((space+1),sentence.length());
    else
    subject[count] = sentence;
    subject2[count] = " ";
    timeslot[count] = rs.getInt("Time_slot");
    count++;
    resCount++;
    rs.close();
    stm.close();
    The while is there untill there are no more values in the result set. This should work(in theory). But for some reason the while loop goes around and around until 'size' (which is the size for all the arrays) is reached. This is a set value at the start of the applet. But whenever i change it the while loop goes around that many times without fail. this results in duplicate outputs to screen, that i dont want.
    Anyone got any ideas????????????

    This flow doesn't make too much sense to me. Why are you setting an absolute limit on the length of the array, if it should really be determined by the number of rows in your resultset. It sounds like you would be better off using a Collection class, like:
    List names = new ArrayList();
    while(rs.next()) {
      names.add(rs.getString("name"));
    }

  • Query taking long time for EXTRACTING the data more than 24 hours

    Hi ,
    Query taking long time for EXTRACTING the data more than 24 hours please find the query and explain plan details below even indexes avilable on table's goe's to FULL TABLE SCAN. please suggest me.......
    SQL> explain plan for select a.account_id,round(a.account_balance,2) account_balance,
    2 nvl(ah.invoice_id,ah.adjustment_id) transaction_id,
    to_char(ah.effective_start_date,'DD-MON-YYYY') transaction_date,
    to_char(nvl(i.payment_due_date,
    to_date('30-12-9999','dd-mm-yyyy')),'DD-MON-YYYY')
    due_date, ah.current_balance-ah.previous_balance amount,
    decode(ah.invoice_id,null,'A','I') transaction_type
    3 4 5 6 7 8 from account a,account_history ah,invoice i_+
    where a.account_id=ah.account_id
    and a.account_type_id=1000002
    and round(a.account_balance,2) > 0
    and (ah.invoice_id is not null or ah.adjustment_id is not null)
    and ah.CURRENT_BALANCE > ah.previous_balance
    and ah.invoice_id=i.invoice_id(+)
    AND a.account_balance > 0
    order by a.account_id,ah.effective_start_date desc; 9 10 11 12 13 14 15 16
    Explained.
    SQL> select * from table(dbms_xplan.display);
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)|
    | 0 | SELECT STATEMENT | | 544K| 30M| | 693K (20)|
    | 1 | SORT ORDER BY | | 544K| 30M| 75M| 693K (20)|
    |* 2 | HASH JOIN | | 544K| 30M| | 689K (20)|
    |* 3 | TABLE ACCESS FULL | ACCOUNT | 20080 | 294K| | 6220 (18)|
    |* 4 | HASH JOIN OUTER | | 131M| 5532M| 5155M| 678K (20)|
    |* 5 | TABLE ACCESS FULL| ACCOUNT_HISTORY | 131M| 3646M| | 197K (25)|
    | 6 | TABLE ACCESS FULL| INVOICE | 262M| 3758M| | 306K (18)|
    Predicate Information (identified by operation id):
    2 - access("A"."ACCOUNT_ID"="AH"."ACCOUNT_ID")
    3 - filter("A"."ACCOUNT_TYPE_ID"=1000002 AND "A"."ACCOUNT_BALANCE">0 AND
    ROUND("A"."ACCOUNT_BALANCE",2)>0)
    4 - access("AH"."INVOICE_ID"="I"."INVOICE_ID"(+))
    5 - filter("AH"."CURRENT_BALANCE">"AH"."PREVIOUS_BALANCE" AND ("AH"."INVOICE_ID"
    IS NOT NULL OR "AH"."ADJUSTMENT_ID" IS NOT NULL))
    22 rows selected.
    Index Details:+_
    SQL> select INDEX_OWNER,INDEX_NAME,COLUMN_NAME,TABLE_NAME from dba_ind_columns where
    2 table_name in ('INVOICE','ACCOUNT','ACCOUNT_HISTORY') order by 4;
    INDEX_OWNER INDEX_NAME COLUMN_NAME TABLE_NAME
    OPS$SVM_SRV4 P_ACCOUNT ACCOUNT_ID ACCOUNT
    OPS$SVM_SRV4 U_ACCOUNT_NAME ACCOUNT_NAME ACCOUNT
    OPS$SVM_SRV4 U_ACCOUNT CUSTOMER_NODE_ID ACCOUNT
    OPS$SVM_SRV4 U_ACCOUNT ACCOUNT_TYPE_ID ACCOUNT
    OPS$SVM_SRV4 I_ACCOUNT_ACCOUNT_TYPE ACCOUNT_TYPE_ID ACCOUNT
    OPS$SVM_SRV4 I_ACCOUNT_INVOICE INVOICE_ID ACCOUNT
    OPS$SVM_SRV4 I_ACCOUNT_PREVIOUS_INVOICE PREVIOUS_INVOICE_ID ACCOUNT
    OPS$SVM_SRV4 U_ACCOUNT_NAME_ID ACCOUNT_NAME ACCOUNT
    OPS$SVM_SRV4 U_ACCOUNT_NAME_ID ACCOUNT_ID ACCOUNT
    OPS$SVM_SRV4 I_LAST_MODIFIED_ACCOUNT LAST_MODIFIED ACCOUNT
    OPS$SVM_SRV4 I_ACCOUNT_INVOICE_ACCOUNT INVOICE_ACCOUNT_ID ACCOUNT
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ACCOUNT ACCOUNT_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ACCOUNT SEQNR ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_INVOICE INVOICE_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ADINV INVOICE_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA CURRENT_BALANCE ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA INVOICE_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA ADJUSTMENT_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_CIA ACCOUNT_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_LMOD LAST_MODIFIED ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ADINV ADJUSTMENT_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_PAYMENT PAYMENT_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_ADJUSTMENT ADJUSTMENT_ID ACCOUNT_HISTORY
    OPS$SVM_SRV4 I_ACCOUNT_HISTORY_APPLIED_DT APPLIED_DATE ACCOUNT_HISTORY
    OPS$SVM_SRV4 P_INVOICE INVOICE_ID INVOICE
    OPS$SVM_SRV4 U_INVOICE CUSTOMER_INVOICE_STR INVOICE
    OPS$SVM_SRV4 I_LAST_MODIFIED_INVOICE LAST_MODIFIED INVOICE
    OPS$SVM_SRV4 U_INVOICE_ACCOUNT ACCOUNT_ID INVOICE
    OPS$SVM_SRV4 U_INVOICE_ACCOUNT BILL_RUN_ID INVOICE
    OPS$SVM_SRV4 I_INVOICE_BILL_RUN BILL_RUN_ID INVOICE
    OPS$SVM_SRV4 I_INVOICE_INVOICE_TYPE INVOICE_TYPE_ID INVOICE
    OPS$SVM_SRV4 I_INVOICE_CUSTOMER_NODE CUSTOMER_NODE_ID INVOICE
    32 rows selected.
    Regards,
    Bathula
    Oracle-DBA

    I have some suggestions. But first, you realize that you have some redundant indexes, right? You have an index on account(account_name) and also account(account_name, account_id), and also account_history(invoice_id) and account_history(invoice_id, adjustment_id). No matter, I will suggest some new composite indexes.
    Also, you do not need two lines for these conditions:
    and round(a.account_balance, 2) > 0
    AND a.account_balance > 0
    You can just use: and a.account_balance >= 0.005
    So the formatted query isselect a.account_id,
           round(a.account_balance, 2) account_balance,
           nvl(ah.invoice_id, ah.adjustment_id) transaction_id,
           to_char(ah.effective_start_date, 'DD-MON-YYYY') transaction_date,
           to_char(nvl(i.payment_due_date, to_date('30-12-9999', 'dd-mm-yyyy')),
                   'DD-MON-YYYY') due_date,
           ah.current_balance - ah.previous_balance amount,
           decode(ah.invoice_id, null, 'A', 'I') transaction_type
      from account a, account_history ah, invoice i
    where a.account_id = ah.account_id
       and a.account_type_id = 1000002
       and (ah.invoice_id is not null or ah.adjustment_id is not null)
       and ah.CURRENT_BALANCE > ah.previous_balance
       and ah.invoice_id = i.invoice_id(+)
       AND a.account_balance >= .005
    order by a.account_id, ah.effective_start_date desc;You will probably want to select:
    1. From ACCOUNT first (your smaller table), for which you supply a literal on account_type_id. That should limit the accounts retrieved from ACCOUNT_HISTORY
    2. From ACCOUNT_HISTORY. We want to limit the records as much as possible on this table because of the outer join.
    3. INVOICE we want to access last because it seems to be least restricted, it is the biggest, and it has the outer join condition so it will manufacture rows to match as many rows as come back from account_history.
    Try the query above after creating the following composite indexes. The order of the columns is important:create index account_composite_i on account(account_type_id, account_balance, account_id);
    create index acct_history_comp_i on account_history(account_id, invoice_id, adjustment_id, current_balance, previous_balance, effective_start_date);
    create index invoice_composite_i on invoice(invoice_id, payment_due_date);All the columns used in the where clause will be indexed, in a logical order suited to the needs of the query. Plus each selected column is indexed as well so that we should not need to touch the tables at all to satisfy the query.
    Try the query after creating these indexes.
    A final suggestion is to try larger sort and hash area sizes and a manual workarea policy.alter session set workarea_size_policy = manual;
    alter session set sort_area_size = 2147483647;
    alter session set hash_area_size = 2147483647;

  • Which is more efficient way to get result set from database server

    Hi,
    I am working on a project where I require to query database to fetch result set and then iterate through the resultset. Now, What I want is that I want to create one single java code that would call many different SQLs and create a list out of resultset. There are two approaches for me.
    1.) To create a txt file where I can store my queries. My java program can read this file and get the appropriate query to be used.
    2.) To create a stored procedure containing the queries and call the stored procedure from my java program. Also, not that some of the queries needs to be created dynamically depending upon the parameteters supplied.
    Out of these two approches which is optimum and why?
    Also, following things to be noted.
    1. At times I want to create where clause of the query dynamically depenending upon the parameters passed.
    2. I want one single java file that will handle all database calls.
    3. Paramters to the stored procedure can be passed using array descriptor.
    4. Conneciton I am making using JNDI.
    Please do provide me optimum way of out these two. You may also suggest some other approaches, if any.
    Thanks,
    Rajan
    Edited by: RP on Jun 26, 2012 11:11 PM

    RP wrote:
    In case of queries stored in text files. I will require to replace some pre defined placeholder with actual parameters and then pass that modified query to db engine. Even I liked the second approach as it is more easily maintainable. There are a couple of issues. Shared SQL is one. Irrespective of the method used, the SQL cursor that is created needs to have bind variables. This ensures re-usability of the cursor. This reduces the risk of Shared Pool fragmentation. This lowers hard parsing and reduces CPU utilisation.
    Another issue is flexibility. If the SQL cursors are created by stored procedures, this code resides on the server and abstracts the Java client from the complexities of SQL and SQL performance. The code can easily be updated and fine tuned to deliver faster/better SQL cursors, or modified to take new Oracle features, changes in data model, and so on, into consideration. This stored proc can be updated without having to touch or recompile a single byte of Java client code.
    There's also the security issue. What is more secure? SQL encapsulated in stored procs in a secure database and server environment? Or SQL "encapsulated" in text files on the client?
    The less code you have running on the client, the less code you have running in the wild that can be compromised without having to first compromise the server.
    Only I was worried about any performace issue might happen using this approach. Performance is not a factor of who creates the SQL cursor.
    Whether Java client creates a SQL cursor, or a PL/SQL stored proc creates a SQL cursor, or a .Net client creates a SQL cursor - that SQL cursor does not know what the client is. It does not care what the client is. The SQL cursor performs as well as it is capable of.. given the execution plan, data volumes, server resources and speed/performance of the server.
    The client language and SQL cursor interface used by the client (there are several in PL/SQL), determines the performance of the client's interaction with the cursor (e.g. round trips to the database when interfacing with the cursor). The client language (and its client interface to the cursor) does not dictate the actual performance of that SQL cursor on the database (does not make joins faster, or I/O faster)
    One more question, Will my java program close the cursor that I opened in Procedure?That you need to ask your Java code. Java code leaking ref cursors are unfortunately all too common. You need to make sure that your Java client interface to SQL cursors, closes the cursor handle when done.

  • I use itunes on a Dell XPS502 with W7/64. In some cases have have problems to import CD's. The sound is very disturbed and the import need a lot more time than in normal cases. Is there a problem between itunes W7/64 or a known hardware issue?

    I use itunes on a Dell XPS502 with W7/64. In some cases have have problems to import CD's. The sound is very disturbed and the import need a lot more time than in normal cases. Is there a problem between itunes and W7/64 or a known hardware issue?
    Example-CD : "Tracy Chapman , Telling stories" is not able to import . I have more such negative cases. But in other cases it works fine and the sound is great.
    The firmware at the inbuild CD/DVD DS-6E2SH is the latest version.
    What can I do??

    hi b noir,
    I don't no about virtuel drives like you mententioned. In the mean time I have rebooted the XPS and run again the iTunes diagnostics. I think the back - chance in the registry was not ready to use.  Now there are another results. They are the same in case of a running CD or a not running CD. The difference in total is like before. It takes more time that iTunes reads the (bad) CD and at the there is no good sound. In both cases ( running or not running CD) iTunes diagnostics gives as a result :
    (the copie from ITunes shows the result of the not running CD from Tracy Chapman)
    Microsoft Windows 7 x64 Ultimate Edition Service Pack 1 (Build 7601)
    Dell Inc. Dell System XPS L502X
    iTunes 10.3.1.55
    QuickTime 7.6.9
    FairPlay 1.11.17
    Apple Application Support 1.5.2
    iPod Updater-Bibliothek 10.0d2
    CD Driver 2.2.0.1
    CD Driver DLL 2.1.1.1
    Apple Mobile Device 3.4.0.25
    Apple Mobile Device Treiber 1.55.0.0
    Bonjour 2.0.5.0 (214.3)
    Gracenote SDK 1.8.2.457
    Gracenote MusicID 1.8.2.89
    Gracenote Submit 1.8.2.123
    Gracenote DSP 1.8.2.34
    iTunes-Seriennummer 00D7B2B00CD25750
    Aktueller Benutzer ist kein Administrator.
    Aktuelles Datum und Uhrzeit sind 2011-06-11 19:33:22.
    iTunes befindet sich nicht im abgesicherten Modus.
    WebKit Accelerated Compositing ist aktiviert.
    HDCP wird unterstützt.
    Core Media wird unterstützt.
    Info zu Video-Anzeige
    NVIDIA, NVIDIA GeForce GT 540M
    Intel Corporation, Intel(R) HD Graphics Family
    **** Info für externe Plug-Ins ****
    Keine externen Plug-Ins installiert.
    iPodService 10.3.1.55 (x64) arbeitet zurzeit.
    iTunesHelper 10.3.1.55 arbeitet zurzeit.
    Apple Mobile Device service 3.3.0.0 arbeitet zurzeit.
    **** CD/DVD-Laufwerkstests****
    LowerFilters: PxHlpa64 (2.0.0.0),
    UpperFilters: GEARAspiWDM (2.2.0.1),
    D: PLDS DVDRWBD DS-6E2SH, Rev CD11
    Audio-CD im Laufwerk
    11 Titel auf der CD gefunden, Spieldauer: 42:07 auf Audio-CD
    Titel 1, Startzeit: 00:02:00
    Titel 2, Startzeit: 03:59:47
    Titel 3, Startzeit: 07:19:27
    Titel 4, Startzeit: 11:31:30
    Titel 5, Startzeit: 15:31:50
    Titel 6, Startzeit: 20:07:50
    Titel 7, Startzeit: 24:27:15
    Titel 8, Startzeit: 27:49:10
    Titel 9, Startzeit: 32:41:25
    Titel 10, Startzeit: 35:29:65
    Titel 11, Startzeit: 38:38:00
    Audio-CD erfolgreich gelesen (Suche nach alter Firmware).
    Laufwerksgeschwindigkeit erfolgreich erkannt
    Die CDR-Geschwindigkeiten des Laufwerks sind:  4 10 16 24
    Die CDRW-Geschwindigkeiten des Laufwerks sind:  4
    Die DVDR-Geschwindigkeiten des Laufwerks sind:  4
    Die DVDRW-Geschwindigkeiten des Laufwerks sind:  4
    After starting the import it is going slower and slower. If it is helpful I can send you a soundfile with these distortions.
    best regards
    tcgerd

  • Does row_number() returns different result set every time?

    Hi,
    I have a query somewhat like the example:
    select /*+ parallel (ftstm,4) */
    ftstm. term,
    sum(ftstm.revenue) revenue,
    sum(ftstm.searches) searches,
    row_number() over (order by sum(ftstm.revenue)desc) as depth_rank
    from
    fact_terms
    group by
    ftstm.term
    ORDER BY
    revenue DESC
    where
    depth_rank <= 100000
    I have run this query 2-3 times and surprisingly- when I do MINUS on the result sets, I got few records.
    Is that possible or am I doing some mistake with this query? Please help...

    Nandini wrote:
    Hi,
    I have a query somewhat like the example:
    select /*+ parallel (ftstm,4) */
    ftstm. term,
    sum(ftstm.revenue) revenue,
    sum(ftstm.searches) searches,
    row_number() over (order by sum(ftstm.revenue)desc) as depth_rank
    from
    fact_terms
    group by
    ftstm.term
    ORDER BY
    revenue DESC
    where
    depth_rank <= 100000
    I have run this query 2-3 times and surprisingly- when I do MINUS on the result sets, I got few records.well what are you MINUSing from it?
    You need to provide us with your database version, example data and expected output (or show us what you are getting)...
    {message:id=9360002}

  • Setting ECHO ON takes more time?

    Hi all,
    Recently, we had to run a huge file with INSERTs in production database. But before that when the same file was run in testing database, we set the ECHO on in SQL*PLUS and it took more time, I mean, the difference was huge, in fact. I wish to know if setting ECHO to ON takes more time than setting ECHO to OFF. Does this have an effect on time it takes to make the INSERTs.
    Regards,
    ...

    Yingkuan,
    Thanks for the reply. In fact, I know the function what ECHO does. Now suppose I have 121,000 lines of INSERT statements in a file called "inserts.sql" and I am going to execute it in SQL*PLUS to a remote server, the server being 9.2.0.8.0. Will there be a time difference in completing the scripts if I set the ECHO to ON and if I set the ECHO to OFF. Consider the following scenario:
    Scenario 1
    ========
    SQL> SET ECHO ON;
    SQL> @inserts.sql;
    Elapsed: 02:00:00.00
    Scenario 2
    ========
    SQL> SET ECHO OFF;
    SQL> @inserts.sql;
    Elapsed: 01:00:00.00
    Please note the "Elapsed" time between the 2 scenarios. Will the ECHO setting impact the elapsed time? I think this setting will not cause the file to take long time to complete as it is just a client side setting. Please clarify.
    Regards,
    ...

  • How to determine how many times result set columns have same value

    Hi -
    I'm doing a report which will be used for payment trend analyses.
    My initial result set looks like this:
    HOUSEHOLD_ID     JAN_PMT     FEB_PMT     MAR_PMT     APR_PMT     MAY_PMT     JUN_PMT     JUL_PMT     AUG_PMT     SEP_PMT     OCT_PMT     NOV_PMT     DEC_PMT
    90026845409     1     1     1     1     2     1     1     1     1     0     1     0(many rows, of course; result set pivoted)
    I need to determine the households that have a > 0 value in three or more consecutive months.
    I'm hoping someone will have some suggestions because the only solutions I'm coming up with right now would be a coding nightmare (lots of "OR's"), and I'm assuming (hoping) there's a better solution out there.
    Thanks!
    Christine

    Hi Frank,
    I'm not sure I'm understanding how I would use those analytic functions. Here is my select statement:
    SELECT HOUSEHOLD_ID,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  1 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  1 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS JAN_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  2 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  2 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS FEB_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  3 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  3 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS MAR_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  4 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  4 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS APR_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  5 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  5 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS MAY_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  6 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  6 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS JUN_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  7 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  7 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS JUL_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  8 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  8 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS AUG_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     =  9 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 =  9 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS SEP_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     = 10 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 = 10 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS OCT_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     = 11 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 = 11 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS NOV_PMT,
           SUM(CASE WHEN ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM'))     = 12 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 ) OR
                         ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'MM')) - 1 = 12 AND TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6  )
                    THEN 1 ELSE 0 END) AS DEC_PMT
      FROM MONETARY_TRANS
    WHERE MONETARY_TRANS_TYPE_ID    = 1                             --payment
    --TESTING
    AND HOUSEHOLD_ID = 90026845409
       AND RESPONSIBLE_PARTY_TYPE_ID = 1                             --household
       AND RECEIVED_DATE > '01-JAN-2008'
       AND ( TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) < 6
        OR   TO_NUMBER(TO_CHAR(RECEIVED_DATE, 'DD')) > 19 )
       AND PREMIUM_AMOUNT            > 0
       AND BILLING_TRANS_TYPE_ID     = 6
       AND MONETARY_TRANS_TYPE_ID    = 1
       AND RESPONSIBLE_PARTY_TYPE_ID = 1
    GROUP BY HOUSEHOLD_IDAnd from this I get the results originally posted. From there I need to figure out the households that have values greater than 0 for three or more consecutive months.
    Thanks for your help........
    -Christine

  • Change display of result set from 'showing data as rows, to showing data as one or more columns'

    Hi Everyone,
    I am interested in changing the way that data is displayed in my result set.
    Essentially I want to display a selection of rows (1 to n) as columns, the following diagram explains my intentions -
    Perhaps one of the greatest challenges here is the fact that I do not have a concrete number of rows (or BIN numbers).
    Each stock item could be stored in one or more BINS, which I will not know until running my query.
    Any suggestions here will be greatly appreciated.
    Kind Regards,
    David

    Can you explain on what basis you select those BinLabels? There're lots of other labels also available on your sample data so whats the rule which determines which all BinLabels should be selected?
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs
    Agree with Visakh16's opinion. In addition, it might be helpful if you can post your DDL here.
    Regards,
    Elvis Long
    TechNet Community Support

Maybe you are looking for