How to improve performance for this code

Hi,
LOOP AT lt_element INTO ls_element.
READ TABLE lt_element_ident INTO ls_element_ident
WITH KEY element_id = ls_element-element_id BINARY SEARCH.
IF sy-subrc EQ 0.
MOVE ls_element_ident-value TO lv_guid.
SELECT * FROM zcm_valuation_at
APPENDING CORRESPONDING FIELDS OF TABLE lt_caseattributes
WHERE case_guid = lv_guid.
ENDIF.
ENDLOOP.
LOOP AT lt_caseattributes INTO ls_caseattributes.
IF ls_caseattributes-ext_key IS INITIAL.
SELECT SINGLE ext_key
INTO CORRESPONDING FIELDS OF ls_caseattributes
FROM scmg_t_case_attr
WHERE case_guid = ls_caseattributes-case_guid.
ENDIF.
*To get the Status description of the Case
SELECT SINGLE stat_ordno_descr
INTO ls_caseattributes-status
FROM scmgstatprofst AS a
INNER JOIN scmg_t_case_attr AS b
ON aprofile_id = bprofile_id
AND astat_orderno = bstat_orderno
WHERE case_guid = ls_caseattributes-case_guid.
MODIFY lt_caseattributes FROM ls_caseattributes INDEX sy-tabix TRANSPORTING status ext_key.
ENDLOOP.
READ TABLE lt_caseattributes INTO ls_caseattributes INDEX 1.
Regards,
Maruti

Hi,
try this kind of code:
==================================
start new
DATA:
  lt_scmgstatprofst LIKE scmgstatprofst OCCURS 0 WITH HEADER LINE,
  wa_scmg_t_case_attr LIKE scmg_t_case_attr.
SELECT * FROM scmgstatprofst INTO TABLE lt_scmgstatprofst.
SORT lt_scmgstatprofst BY profile_id stat_orderno.
end new
LOOP AT lt_element INTO ls_element.
  READ TABLE lt_element_ident INTO ls_element_ident
  WITH KEY element_id = ls_element-element_id BINARY SEARCH.
  IF sy-subrc EQ 0.
    MOVE ls_element_ident-value TO lv_guid.
    SELECT * FROM zcm_valuation_at
    APPENDING CORRESPONDING FIELDS OF TABLE lt_caseattributes
    WHERE case_guid = lv_guid.
  ENDIF.
ENDLOOP.
LOOP AT lt_caseattributes INTO ls_caseattributes.
  IF ls_caseattributes-ext_key IS INITIAL.
    SELECT SINGLE ext_key
    INTO CORRESPONDING FIELDS OF ls_caseattributes
    FROM scmg_t_case_attr
    WHERE case_guid = ls_caseattributes-case_guid.
  ENDIF.
*To get the Status description of the Case
start deletion
SELECT SINGLE stat_ordno_descr
INTO ls_caseattributes-status
FROM scmgstatprofst AS a
INNER JOIN scmg_t_case_attr AS b
ON aprofile_id = bprofile_id
AND astat_orderno = bstat_orderno
WHERE case_guid = ls_caseattributes-case_guid.
end deletion
start new
  CLEAR wa_scmg_t_case_attr.
  SELECT SINGLE * FROM scmg_t_case_attr INTO wa_scmg_t_case_attr
    WHERE case_guid = ls_caseattributes-case_guid.
  READ TABLE lt_scmgstatprofst WITH KEY
    profile_id   = wa_scmg_t_case_attr-profile_id
    stat_orderno = wa_scmg_t_case_attr-stat_orderno
    BINARY SEARCH.
  IF sy-subrc IS INITIAL.
    ls_caseattributes-status = lt_scmgstatprofst-stat_ordno_descr.
  ENDIF.
end new
  MODIFY lt_caseattributes FROM ls_caseattributes INDEX sy-tabix
  TRANSPORTING status ext_key.
ENDLOOP.
READ TABLE lt_caseattributes INTO ls_caseattributes INDEX 1.
==================================
Regards
Walter Habich
Edited by: Walter Habich on Jun 17, 2008 8:41 AM

Similar Messages

  • How to improve performace for this program

    Hi,
    I want to improve performance for this program.Pls help me.Here is the code.
    Thanks
    kumar
    --# SCCS: @(#)nscdprpt_rpt_fam_fweq_detail_aggr_dml.sql     2.1 08/17/05 12:16:11
    --# Location: /appl/dpdm/src/sql/SCCS/s.nscdprpt_rpt_fam_fweq_detail_aggr_dml.sql
    -- =============================================================================
    -- Purpose:
    -- DML Script to calculate aggregate rows from table NSCDPRPT.RPT_FAM_FWEQ_DETAIL
    -- inserts one (1) monthly total row for each comparison type (6 of them)
    -- Modification History
    -- Date Version Who What
    -- 28-Jun-05 V1.00 J. Myers Initial Version
    -- 17-Aug-05 gzuerc Replaced UNION ALL code with INSERT's to avoid
    -- Oracle error out of undo tablespace.
    -- ============================================================================
    -- NOTES:
    -- This process pulls data from RPT_FAM_FWEQ_DETAIL table.
    -- The target table RPT_FAM_FWEQ_DETAIL_AGGR is truncated by plan_ctry and loaded daily;
    -- it is the data used in the Forecast Accuracy Measurements Report.
    -- The input data is 'wide' (6 quantities), and this script outputs a single
    -- row for each quantity as a 'thin' table (single column F1_QTY and F2_QTY shared by all quantities), and
    -- with a ROW_TYPE = 'TOTAL'
    -- Two (2) other scripts add additional rows to this table as follows:
    -- 1) nscdprpt_rpt_fam_FWEQ_detail_aggr_sesn_avg_dml.sql => calculates the
    -- total quantities F1_QTY, F2_QTY and AE for each LEVEL_VALUE
    -- 2) nscdprpt_rpt_fam_FWEQ_detail_aggr_pct_swg_dml.sql => calculates the
    -- percent swing in quantities between DISP_EVENTS for each grouping
    -- of PLAN_CTRY, DIVISION, SEASON and TRG_EVENT_NUM for only LEVEL_TYPE = 'SUB_CAT'
    -- =============================================================================
    -- The result set from joining RPT_FAM_FWEQ_DETAIL rows with comparison types
    -- is inserted into the table RPT_FAM_FWEQ_DETAIL_AGGR
    INSERT INTO rpt_fam_FWEQ_detail_aggr
    SELECT plan_ctry,
    division,
    season,
    monthly_seq,
         bucket_month_date,
    tier_num,
    level_num,
    tier_volume,
    trg_event_num,
    disp_event_num,
    max_event_num,
    compare_name,
    first_display_event_num,
    level_type,
    level_value,
    'TOTAL' AS row_type,
    material,
    key_material,
    sap_cat_cd,
    sap_cat_desc,
    sap_sub_cat_cd,
    sap_sub_cat_desc,
    sty_colr_sdesc,
    sty_grp_nbr,
    sty_grp_desc,
    matl_typ,
    sap_prod_typ_grp, -- 'Type Group' in Brio
    typ_grp_desc, -- 'Type Group' in Brio
    curr_prod_i2_life_cyc_cd,
    NULL AS promo_ind, -- for future use
    -- Each RPT_FAM_FWEQ_DETAIL row's eight (8) quantity columns are broken down
    -- into F1_QTY from DISP_aaaa_QTY, F2_QTY from TRG_aaaa_QTY and
         -- AE from aaaa_AE where 'aaaa' is equal to one of the COMPARE_TYPEs below:
    -- F1_QTY
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    disp_dlvry_plan_qty
    WHEN compare_type = 'NET' THEN
    disp_net_qty
    WHEN compare_type = 'NET_AO' THEN
    disp_ao_qty
    WHEN compare_type = 'NET_FTRS' THEN
    disp_futr_qty
    WHEN compare_type = 'NET_REPLENS' THEN
    disp_replen_qty
    WHEN compare_type = 'AUTH_FTRS' THEN
    disp_auth_futr_qty
    END as f1_qty,
    -- F2_QTY
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    trg_dlvry_plan_qty
    WHEN compare_type = 'NET' THEN
    trg_net_qty
    WHEN compare_type = 'NET_AO' THEN
    trg_ao_qty
    WHEN compare_type = 'NET_FTRS' THEN
    trg_futr_qty
    WHEN compare_type = 'NET_REPLENS' THEN
    trg_replen_qty
    WHEN compare_type = 'AUTH_FTRS' THEN
    trg_auth_futures_qty
    END as f2_qty,
    -- AE
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    abs(disp_dlvry_plan_qty - trg_dlvry_plan_qty)
    WHEN compare_type = 'NET' THEN
    abs(disp_net_qty - trg_net_qty)
    WHEN compare_type = 'NET_AO' THEN
    abs(disp_ao_qty - trg_ao_qty)
    WHEN compare_type = 'NET_FTRS' THEN
    abs(disp_futr_qty - trg_futr_qty)
    WHEN compare_type = 'NET_REPLENS' THEN
    abs(disp_replen_qty - trg_replen_qty)
    WHEN compare_type = 'AUTH_FTRS' THEN
    abs(disp_auth_futr_qty - trg_auth_futures_qty)
    END as ae,
    SYSDATE AS zz_insert_tmst
    FROM
    -- The following in-line view provides three (3) result sets from the RPT_FAM_FWEQ_DETAIL table
         -- This in-line view returns only LEVEL_NUM = 1 or LEVEL_TYPE = 'SUB_CAT' data
         SELECT plan_ctry,
         division,
         season,
         monthly_seq,
              bucket_month_date,
         tier_num,
         level_num,
         tier_volume,
         trg_event_num,
         trg_event_type,
         disp_event_num,
         max_event_num,
         first_display_event_num,
         level_type,
         level_value,
         -- The following NULL'd columns' values cannot be saved due to aggregation
         NULL AS material,
         NULL AS key_material,
         sap_cat_cd,
         sap_cat_desc,
         sap_sub_cat_cd,
         sap_sub_cat_desc,
         NULL AS sty_colr_sdesc,
         NULL AS sty_grp_nbr,
         NULL AS sty_grp_desc,
         NULL AS matl_typ,
         sap_prod_typ_grp, -- 'Type Group' in Brio
         typ_grp_desc, -- 'Type Group' in Brio
         NULL AS curr_prod_i2_life_cyc_cd,
         sum(disp_net_qty) AS disp_net_qty,
              sum(trg_net_qty) AS trg_net_qty,
         -- ABS(sum(trg_net_qty) - sum(disp_net_qty)) AS net_AE,
         sum(disp_dlvry_plan_qty) AS disp_dlvry_plan_qty,
              sum(trg_dlvry_plan_qty) AS trg_dlvry_plan_qty,
         -- ABS(sum(trg_dlvry_plan_qty) - sum(disp_dlvry_plan_qty)) AS dlvry_plan_AE,
         sum(disp_futr_qty) AS disp_futr_qty,
              sum(trg_futr_qty) AS trg_futr_qty,
         -- ABS(sum(trg_futr_qty) - sum(disp_futr_qty)) AS futr_AE,
         sum(disp_ao_qty) AS disp_ao_qty,
              sum(trg_ao_qty) AS trg_ao_qty,
         -- ABS(sum(trg_ao_qty) - sum(disp_ao_qty)) AS ao_AE,
         sum(disp_replen_qty) AS disp_replen_qty,
              sum(trg_replen_qty) AS trg_replen_qty,
         -- ABS(sum(trg_replen_qty) - sum(disp_replen_qty)) AS replen_AE,
         sum(disp_futr_qty) AS disp_auth_futr_qty,
              sum(trg_auth_futures_qty) AS trg_auth_futures_qty --,
         -- ABS(sum(trg_auth_futures_qty) - sum(disp_futr_qty)) AS auth_futures_AE
         FROM rpt_fam_FWEQ_detail
         WHERE plan_ctry &where_plan_ctry
         and level_num = 1 -- 'SUB-CAT'
         -- AND (promo_ind <> 'Y' OR promo_ind IS null)
         GROUP BY plan_ctry,
         division,
         season,
         monthly_seq,
              bucket_month_date,
         tier_num,
         level_num,
         tier_volume,
         trg_event_num,
         trg_event_type,
         disp_event_num,
         max_event_num,
         first_display_event_num,
         level_type,
         level_value,
         sap_cat_cd,
         sap_cat_desc,
         sap_sub_cat_cd,
         sap_sub_cat_desc,
         sap_prod_typ_grp, -- 'Type Group' in Brio
         typ_grp_desc -- 'Type Group' in Brio
         ) dtl,
         -- The following in-line view returns all of the different combinations
         -- of comparison types in the RPT_FAM_FWEQ_DETAIL table
         -- This select returns the pairing of all forecast types
         SELECT event_type, compare_type, compare_name
         from
         (SELECT event_type, compare_type, compare_type_description || ' to ' || compare_type_description AS compare_name
         FROM rpt_fam_compare_types
         WHERE event_type = 'FCST'
         UNION
         -- This select returns the pairing of all bookings types with forecast types
         SELECT bkng.event_type, fcst.compare_type, bkng.compare_type_description || ' to ' || fcst.compare_type_description AS compare_name
         FROM rpt_fam_compare_types fcst,
         rpt_fam_compare_types bkng
         WHERE fcst.event_type = 'FCST'
         AND bkng.event_type = 'BKNG'
         AND fcst.compare_type = bkng.compare_type
         WHERE event_type || ' ' || compare_type <> 'FCST AUTH_FTRS'
         AND compare_type NOT IN ('NET_SHIP', 'SHIP_NET_FTRS', 'NET_ETS', 'GROSS_FTRS')
         ) cmpr
    -- The two (2) in-line views are joined by EVENT_TYPE (i.e. 'FCST' and 'BKNG')
    -- to form a product of all RPT_FAM_FWEQ_DETAIL rows with comparison types
    WHERE dtl.trg_event_type = cmpr.event_type
    ORDER BY plan_ctry,
    division,
    season,
    monthly_seq,
    tier_num,
    level_num,
    tier_volume,
    trg_event_num,
    disp_event_num,
    max_event_num,
    first_display_event_num,
    level_type,
    level_value
    COMMIT
    INSERT INTO rpt_fam_FWEQ_detail_aggr
    SELECT plan_ctry,
    division,
    season,
    monthly_seq,
         bucket_month_date,
    tier_num,
    level_num,
    tier_volume,
    trg_event_num,
    disp_event_num,
    max_event_num,
    compare_name,
    first_display_event_num,
    level_type,
    level_value,
    'TOTAL' AS row_type,
    material,
    key_material,
    sap_cat_cd,
    sap_cat_desc,
    sap_sub_cat_cd,
    sap_sub_cat_desc,
    sty_colr_sdesc,
    sty_grp_nbr,
    sty_grp_desc,
    matl_typ,
    sap_prod_typ_grp, -- 'Type Group' in Brio
    typ_grp_desc, -- 'Type Group' in Brio
    curr_prod_i2_life_cyc_cd,
    NULL AS promo_ind, -- for future use
    -- Each RPT_FAM_FWEQ_DETAIL row's eight (8) quantity columns are broken down
    -- into F1_QTY from DISP_aaaa_QTY, F2_QTY from TRG_aaaa_QTY and
         -- AE from aaaa_AE where 'aaaa' is equal to one of the COMPARE_TYPEs below:
    -- F1_QTY
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    disp_dlvry_plan_qty
    WHEN compare_type = 'NET' THEN
    disp_net_qty
    WHEN compare_type = 'NET_AO' THEN
    disp_ao_qty
    WHEN compare_type = 'NET_FTRS' THEN
    disp_futr_qty
    WHEN compare_type = 'NET_REPLENS' THEN
    disp_replen_qty
    WHEN compare_type = 'AUTH_FTRS' THEN
    disp_auth_futr_qty
    END as f1_qty,
    -- F2_QTY
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    trg_dlvry_plan_qty
    WHEN compare_type = 'NET' THEN
    trg_net_qty
    WHEN compare_type = 'NET_AO' THEN
    trg_ao_qty
    WHEN compare_type = 'NET_FTRS' THEN
    trg_futr_qty
    WHEN compare_type = 'NET_REPLENS' THEN
    trg_replen_qty
    WHEN compare_type = 'AUTH_FTRS' THEN
    trg_auth_futures_qty
    END as f2_qty,
    -- AE
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    abs(disp_dlvry_plan_qty - trg_dlvry_plan_qty)
    WHEN compare_type = 'NET' THEN
    abs(disp_net_qty - trg_net_qty)
    WHEN compare_type = 'NET_AO' THEN
    abs(disp_ao_qty - trg_ao_qty)
    WHEN compare_type = 'NET_FTRS' THEN
    abs(disp_futr_qty - trg_futr_qty)
    WHEN compare_type = 'NET_REPLENS' THEN
    abs(disp_replen_qty - trg_replen_qty)
    WHEN compare_type = 'AUTH_FTRS' THEN
    abs(disp_auth_futr_qty - trg_auth_futures_qty)
    END as ae,
    SYSDATE AS zz_insert_tmst
    FROM
         -- This in-line view returns only LEVEL_NUM = 2 or LEVEL_TYPE = 'STYLE_GROUP' data
         (SELECT plan_ctry,
         division,
         season,
         monthly_seq,
              bucket_month_date,
         tier_num,
         level_num,
         tier_volume,
         trg_event_num,
         trg_event_type,
         disp_event_num,
         max_event_num,
         first_display_event_num,
         level_type,
         level_value,
         -- The following NULL'd columns' values cannot be saved due to aggregation
         NULL AS material,
         NULL AS key_material,
         sap_cat_cd,
         sap_cat_desc,
         sap_sub_cat_cd,
         sap_sub_cat_desc,
         NULL AS sty_colr_sdesc,
         sty_grp_nbr,
         sty_grp_desc,
         NULL AS matl_typ,
         sap_prod_typ_grp, -- 'Type Group' in Brio
         typ_grp_desc, -- 'Type Group' in Brio
         NULL AS curr_prod_i2_life_cyc_cd,
         sum(disp_net_qty) AS disp_net_qty,
              sum(trg_net_qty) AS trg_net_qty,
         -- ABS(sum(trg_net_qty) - sum(disp_net_qty)) AS net_AE,
         sum(disp_dlvry_plan_qty) AS disp_dlvry_plan_qty,
              sum(trg_dlvry_plan_qty) AS trg_dlvry_plan_qty,
         -- ABS(sum(trg_dlvry_plan_qty) - sum(disp_dlvry_plan_qty)) AS dlvry_plan_AE,
         sum(disp_futr_qty) AS disp_futr_qty,
              sum(trg_futr_qty) AS trg_futr_qty,
         -- ABS(sum(trg_futr_qty) - sum(disp_futr_qty)) AS futr_AE,
         sum(disp_ao_qty) AS disp_ao_qty,
              sum(trg_ao_qty) AS trg_ao_qty,
         -- ABS(sum(trg_ao_qty) - sum(disp_ao_qty)) AS ao_AE,
         sum(disp_replen_qty) AS disp_replen_qty,
              sum(trg_replen_qty) AS trg_replen_qty,
         -- ABS(sum(trg_replen_qty) - sum(disp_replen_qty)) AS replen_AE,
         sum(disp_futr_qty) AS disp_auth_futr_qty,
              sum(trg_auth_futures_qty) AS trg_auth_futures_qty --,
         -- ABS(sum(trg_auth_futures_qty) - sum(disp_futr_qty)) AS auth_futures_AE
         FROM rpt_fam_FWEQ_detail
         WHERE plan_ctry &where_plan_ctry
         and level_num = 2 -- 'STYLE-GRP' or 'STYLE'
         -- AND (promo_ind <> 'Y' OR promo_ind IS null)
         GROUP BY plan_ctry,
         division,
         season,
         monthly_seq,
              bucket_month_date,
         tier_num,
         level_num,
         tier_volume,
         trg_event_num,
         trg_event_type,
         disp_event_num,
         max_event_num,
         first_display_event_num,
         level_type,
         level_value,
         sap_cat_cd,
         sap_cat_desc,
         sap_sub_cat_cd,
         sap_sub_cat_desc,
         sty_grp_nbr,
         sty_grp_desc,
         sap_prod_typ_grp, -- 'Type Group' in Brio
         typ_grp_desc -- 'Type Group' in Brio
         ) dtl,
         -- The following in-line view returns all of the different combinations
         -- of comparison types in the RPT_FAM_FWEQ_DETAIL table
         -- This select returns the pairing of all forecast types
         SELECT event_type, compare_type, compare_name
         from
         (SELECT event_type, compare_type, compare_type_description || ' to ' || compare_type_description AS compare_name
         FROM rpt_fam_compare_types
         WHERE event_type = 'FCST'
         UNION
         -- This select returns the pairing of all bookings types with forecast types
         SELECT bkng.event_type, fcst.compare_type, bkng.compare_type_description || ' to ' || fcst.compare_type_description AS compare_name
         FROM rpt_fam_compare_types fcst,
         rpt_fam_compare_types bkng
         WHERE fcst.event_type = 'FCST'
         AND bkng.event_type = 'BKNG'
         AND fcst.compare_type = bkng.compare_type
         WHERE event_type || ' ' || compare_type <> 'FCST AUTH_FTRS'
         AND compare_type NOT IN ('NET_SHIP', 'SHIP_NET_FTRS', 'NET_ETS', 'GROSS_FTRS')
         ) cmpr
    -- The two (2) in-line views are joined by EVENT_TYPE (i.e. 'FCST' and 'BKNG')
    -- to form a product of all RPT_FAM_FWEQ_DETAIL rows with comparison types
    WHERE dtl.trg_event_type = cmpr.event_type
    ORDER BY plan_ctry,
    division,
    season,
    monthly_seq,
    tier_num,
    level_num,
    tier_volume,
    trg_event_num,
    disp_event_num,
    max_event_num,
    first_display_event_num,
    level_type,
    level_value
    COMMIT
    INSERT INTO rpt_fam_FWEQ_detail_aggr
    SELECT plan_ctry,
    division,
    season,
    monthly_seq,
         bucket_month_date,
    tier_num,
    level_num,
    tier_volume,
    trg_event_num,
    disp_event_num,
    max_event_num,
    compare_name,
    first_display_event_num,
    level_type,
    level_value,
    'TOTAL' AS row_type,
    material,
    key_material,
    sap_cat_cd,
    sap_cat_desc,
    sap_sub_cat_cd,
    sap_sub_cat_desc,
    sty_colr_sdesc,
    sty_grp_nbr,
    sty_grp_desc,
    matl_typ,
    sap_prod_typ_grp, -- 'Type Group' in Brio
    typ_grp_desc, -- 'Type Group' in Brio
    curr_prod_i2_life_cyc_cd,
    NULL AS promo_ind, -- for future use
    -- Each RPT_FAM_FWEQ_DETAIL row's eight (8) quantity columns are broken down
    -- into F1_QTY from DISP_aaaa_QTY, F2_QTY from TRG_aaaa_QTY and
         -- AE from aaaa_AE where 'aaaa' is equal to one of the COMPARE_TYPEs below:
    -- F1_QTY
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    disp_dlvry_plan_qty
    WHEN compare_type = 'NET' THEN
    disp_net_qty
    WHEN compare_type = 'NET_AO' THEN
    disp_ao_qty
    WHEN compare_type = 'NET_FTRS' THEN
    disp_futr_qty
    WHEN compare_type = 'NET_REPLENS' THEN
    disp_replen_qty
    WHEN compare_type = 'AUTH_FTRS' THEN
    disp_auth_futr_qty
    END as f1_qty,
    -- F2_QTY
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    trg_dlvry_plan_qty
    WHEN compare_type = 'NET' THEN
    trg_net_qty
    WHEN compare_type = 'NET_AO' THEN
    trg_ao_qty
    WHEN compare_type = 'NET_FTRS' THEN
    trg_futr_qty
    WHEN compare_type = 'NET_REPLENS' THEN
    trg_replen_qty
    WHEN compare_type = 'AUTH_FTRS' THEN
    trg_auth_futures_qty
    END as f2_qty,
    -- AE
    CASE WHEN compare_type = 'DELIVERY_PLAN' THEN
    abs(disp_dlvry_plan_qty - trg_dlvry_plan_qty)
    WHEN compare_type = 'NET' THEN
    abs(disp_net_qty - trg_net_qty)
    WHEN compare_type = 'NET_AO' THEN
    abs(disp_ao_qty - trg_ao_qty)
    WHEN compare_type = 'NET_FTRS' THEN
    abs(disp_futr_qty - trg_futr_qty)
    WHEN compare_type = 'NET_REPLENS' THEN
    abs(disp_replen_qty - trg_replen_qty)
    WHEN compare_type = 'AUTH_FTRS' THEN
    abs(disp_auth_futr_qty - trg_auth_futures_qty)
    END as ae,
    SYSDATE AS zz_insert_tmst
    FROM
         -- This in-line view returns only LEVEL_NUM = 3 or LEVEL_TYPE = 'MATL' data
         (SELECT plan_ctry,
         division,
         season,
         monthly_seq,
              bucket_month_date,
         tier_num,
         level_num,
         tier_volume,
         trg_event_num,
         trg_event_type,
         disp_event_num,
         max_event_num,
         first_display_event_num,
         level_type,
         level_value,
         material,
         key_material,
         sap_cat_cd,
         sap_cat_desc,
         sap_sub_cat_cd,
         sap_sub_cat_desc,
         sty_colr_sdesc,
         sty_grp_nbr,
         sty_grp_desc,
         matl_typ,
         sap_prod_typ_grp, -- 'Type Group' in Brio
         typ_grp_desc, -- 'Type Group' in Brio
         curr_prod_i2_life_cyc_cd,
         sum(disp_net_qty) AS disp_net_qty,
              sum(trg_net_qty) AS trg_net_qty,
         -- ABS(sum(trg_net_qty) - sum(disp_net_qty)) AS net_AE,
         sum(disp_dlvry_plan_qty) AS disp_dlvry_plan_qty,
              sum(trg_dlvry_plan_qty) AS trg_dlvry_plan_qty,
         -- ABS(sum(trg_dlvry_plan_qty) - sum(disp_dlvry_plan_qty)) AS dlvry_plan_AE,
         sum(disp_futr_qty) AS disp_futr_qty,
              sum(trg_futr_qty) AS trg_futr_qty,
         -- ABS(sum(trg_futr_qty) - sum(disp_futr_qty)) AS futr_AE,
         sum(disp_ao_qty) AS disp_ao_qty,
              sum(trg_ao_qty) AS trg_ao_qty,
         -- ABS(sum(trg_ao_qty) - sum(disp_ao_qty)) AS ao_AE,
         sum(disp_replen_qty) AS disp_replen_qty,
              sum(trg_replen_qty) AS trg_replen_qty,
         -- ABS(sum(trg_replen_qty) - sum(disp_replen_qty)) AS replen_AE,
         sum(disp_futr_qty) AS disp_auth_futr_qty,
              sum(trg_auth_futures_qty) AS trg_auth_futures_qty --,
         -- ABS(sum(trg_auth_futures_qty) - sum(disp_futr_qty)) AS auth_futures_AE
         FROM rpt_fam_FWEQ_detail
         WHERE plan_ctry &where_plan_ctry
         and level_num = 3 -- 'MATERIAL'
         -- AND promo_ind <> 'Y'
         GROUP BY plan_ctry,
         division,
         season,
         monthly_seq,
              bucket_month_date,
         tier_num,
         level_num,
         tier_volume,
         trg_event_num,
         trg_event_type,
         disp_event_num,
         max_event_num,
         first_display_event_num,
         level_type,
         level_value,
         material,
         key_material,
         sap_cat_cd,
         sap_cat_desc,
         sap_sub_cat_cd,
         sap_sub_cat_desc,
         sty_colr_sdesc,
         sty_grp_nbr,
         sty_grp_desc,
         matl_typ,
         sap_prod_typ_grp, -- 'Type Group' in Brio
         typ_grp_desc, -- 'Type Group' in Brio
         curr_prod_i2_life_cyc_cd
         ) dtl,
         -- The following in-line view returns all of the different combinations
         -- of comparison types in the RPT_FAM_FWEQ_DETAIL table
         -- This select returns the pairing of all forecast types
         SELECT event_type, compare_type, compare_name
         from
         (SELECT event_type, compare_type, compare_type_description || ' to ' || compare_type_description AS compare_name
         FROM rpt_fam_compare_types
         WHERE event_type = 'FCST'
         UNION
         -- This select returns the pairing of all bookings types with forecast types
         SELECT bkng.event_type, fcst.compare_type, bkng.compare_type_description || ' to ' || fcst.compare_type_description AS compare_name
         FROM rpt_fam_compare_types fcst,
         rpt_fam_compare_types bkng
         WHERE fcst.event_type = 'FCST'
         AND bkng.event_type = 'BKNG'
         AND fcst.compare_type = bkng.compare_type
         WHERE event_type || ' ' || compare_type <> 'FCST AUTH_FTRS'
         AND compare_type NOT IN ('NET_SHIP', 'SHIP_NET_FTRS', 'NET_ETS', 'GROSS_FTRS')
         ) cmpr
    -- The two (2) in-line views are joined by EVENT_TYPE (i.e. 'FCST' and 'BKNG')
    -- to form a product of all RPT_FAM_FWEQ_DETAIL rows with comparison types
    WHERE dtl.trg_event_type = cmpr.event_type
    ORDER BY plan_ctry,
    division,
    season,
    monthly_seq,
    tier_num,
    level_num,
    tier_volume,
    trg_event_num,
    disp_event_num,
    max_event_num,
    first_display_event_num,
    level_type,
    level_value
    COMMIT
    /

    I agree.
    SELECT ticket_no,name_of_the_passenger..
    FROM ticket_master
    WHERE ticket_no NOT IN
    (SELECT Ticket_no
    FROM ticket_cancellations
    WHERE trip_id = my_trip_id);
    This involves creating a little temp table for each record in ticket_no. Then full scanning it.
    Change it to
    SELECT ticket_no,name_of_the_passenger..
    FROM ticket_master B
    WHERE ticket_no NOT EXISTS
    (SELECT null
    FROM ticket_cancellations A
    WHERE A.ticket_no = B.ticket_no
    AND trip_id = my_trip_id);
    Then you get an index hit in both cases.

  • How to improve performance for Custom Extractor in BI..

    HI all,
               I am new to BI and started working on BI for couple of weeks.. I created a Custom Extractor(Data View) in the Source system and when i pull data takes lot of time.. Can any one respond to this, suggesting how to improve the performance of my custom Extractor.. Please do the needfull..
      Thanks and Regards,
    Venugopal..

    Dear Venugopal,
    use transaction ST05 to check if your SQL statements are optimal and that you do not have redundant database calls. You should use as much as possible "bulking", which means to fetch the required data with one request to database and not with multiple requests to database.
    Use transaction SE30 to check if you are wasting time in loops and if yes, optimize the algorithm.
    Best Regards,
    Sylvia

  • How to improve performance for Azure Table Storage bulk loads

    Hello all,
    Would appreciate your help as we are facing a challenge.
    We are tried to bulk load Azure table storage. We have a file that contains nearly 2 million rows.
    We would need to reach a point where we could bulk load 100000-150000 entries per minute. Currently, it takes more than 10 hours to process the file..
    We have tried Parallel.Foreach but it doesn't help. Today I discovered Partitioning in PLINQ. Would that be the way to go??
    Any ideas? I have spent nearly two days in trying to optimize it using PLINQ, but still I am not sure what is the best thing to do.
    Kindly, note that we shouldn't be using SQL/Azure SQL for this.
    I would really appreciate your help.
    Thanks

    I'd think you're just pooling the parallel connections to Azure, if you do it on one system.  You'd also have a bottleneck of round trip time from you, through the internet to Azure and back again.
    You could speed it up by moving the data file to the cloud and process it with a Cloud worker role.  That way you'd be in the datacenter (which is a much faster, more optimized network.)
    Or, if that's not fast enough - if you can split the data so multiple WorkerRoles could each process part of the file, you can use the VM's scale to put enough machines to it that it gets done quickly.
    Darin R.

  • How to improve performance of this SQL query?

    Hi,
    I have a query that tries to build a string (RPATH) for use as a url parameter. The query is:
    SELECT DISTINCT USERNAME, PASSWORD, ROLE, RIGHTS,
    DECODE(GEO, ROLE, 'g='||NVL(GEO,'none'), NULL)||
         DECODE(AREA, ROLE, 'g='||NVL(GEO,'none')||'&a='||NVL(AREA,'none'), NULL)||
         DECODE(REGION, ROLE, 'g='||NVL(GEO,'none')||'&a='||NVL(AREA,'none')||'&r='||NVL(REGION,'none'), NULL)||
         DECODE(DISTRICT, ROLE, 'g='||NVL(GEO,'none')||'&a='||NVL(AREA,'none')||'&r='||NVL(REGION,'none')||'&d='||NVL(DISTRICT,'none'), NULL)||
         DECODE(OFFICE, ROLE, 'g='||NVL(GEO,'none')||'&a='||NVL(AREA,'none')||'&r='||NVL(REGION,'none')||'&d='||NVL(DISTRICT,'none')||'&o='||NVL(OFFICE,'none')
    , NULL) RPATH
    FROM (SELECT U.*, L.*
         FROM (SELECT * FROM T_USERS WHERE USERNAME='xxx' AND PASSWORD='yyy') U, T_LOC_SUB L
         WHERE U.ROLE IN ('WW', L.GEO, L.AREA, L.REGION, L.DISTRICT, L.OFFICE))
    GROUP BY USERNAME, PASSWORD, ROLE, RIGHTS, GEO, AREA, REGION, DISTRICT, OFFICE;
    T_USERS is defined as
    CREATE TABLE T_USERS (
    username          VARCHAR2(10)     CONSTRAINT T_USERS_username_pk PRIMARY KEY,
    password          VARCHAR2(10),
    role                    CONSTRAINT T_USERS_role_FK REFERENCES T_LOC_MAIN(loc),
    rights          VARCHAR2(3)
    T_LOC_SUB is defined as
    CREATE TABLE T_LOC_SUB (
    geo          CONSTRAINT T_LOC_SUB_geo_FK REFERENCES T_LOC_MAIN(loc),
    area          CONSTRAINT T_LOC_SUB_area_FK REFERENCES T_LOC_MAIN(loc),
    region          CONSTRAINT T_LOC_SUB_region_FK REFERENCES T_LOC_MAIN(loc),
    district     CONSTRAINT T_LOC_SUB_district_FK REFERENCES T_LOC_MAIN(loc),
    office          CONSTRAINT T_LOC_SUB_office_FK REFERENCES T_LOC_MAIN(loc)
    T_LOC_MAIN is defined as
    CREATE TABLE T_LOC_MAIN (
    loc          VARCHAR2(4)     CONSTRAINT T_LOC_MAIN_loc_PK PRIMARY KEY,
    label          VARCHAR2(60),
    rank          NUMBER
    REGION and DISTRICT columns in T_LOC_SUB may be NULL at times. How can I rewrite the SQL to make it run faster or more efficiently?
    Please help.. Thank you..

    Hi,
    I just realised I can simplify the query to:
    SELECT DISTINCT USERNAME, PASSWORD, ROLE, RIGHTS,
    DECODE(ROLE,
         GEO, 'g='||NVL(GEO,'none'),
         AREA, 'g='||NVL(GEO,'none')||'&a='||NVL(AREA,'none'),
         REGION, 'g='||NVL(GEO,'none')||'&a='||NVL(AREA,'none')||'&r='||NVL(REGION,'none'),
         DISTRICT, 'g='||NVL(GEO,'none')||'&a='||NVL(AREA,'none')||'&r='||NVL(REGION,'none')||'&d='||NVL(DISTRICT,'none'),
         OFFICE, 'g='||NVL(GEO,'none')||'&a='||NVL(AREA,'none')||'&r='||NVL(REGION,'none')||'&d='||NVL(DISTRICT,'none')||'&o='||NVL(OFFICE,'none'),
         NULL) RPATH
    FROM (SELECT U.*, L.*
    FROM (SELECT * FROM T_USERS WHERE USERNAME='xxx' AND PASSWORD='yyy') U, T_LOC_SUB L
    WHERE U.ROLE IN ('WW', L.GEO, L.AREA, L.REGION, L.DISTRICT, L.OFFICE))
    GROUP BY USERNAME, PASSWORD, ROLE, RIGHTS, GEO, AREA, REGION, DISTRICT, OFFICE;
    Anyone can offer a better and more efficient improvement?
    Thanx!

  • How to improve performance for bulk data load in Dynamics CRM 2013 Online

    Hi all,
    We need to bulk update (or create) contacts into Dynamics CRM 2013 online every night due to data updated from another external data source.  The data size is around 100,000 and the data loading duration was around 6 hours.
    We are already using ExecuteMultiple web services to handle the integration, however, the 6 hours integraton duration is still not acceptable and we are seeking for any advise for further improvement. 
    Any help is highly appreciated.  Many thanks.
    Gary

    I think Andrii's referring to running multiple threads in parallel (see
    http://www.mscrmuk.blogspot.co.uk/2012/02/data-migration-performance-to-crm.html - it's a bit dated, but should still be relevant).
    Microsoft do have some throttling limits applied in Crm Online, and it is worth contacting them to see if you can get those raised.
    100 000 records per night seems a large number. Are all these records new or updated records, or are there some that are unchanged, in which case you could filter them out before uploading ? Or are there useful ways to summarise the data before loading
    Microsoft CRM MVP - http://mscrmuk.blogspot.com/ http://www.excitation.co.uk

  • How to improve Performance for Select statement

    Hi Friends,
    Can  you please help me in improving the performance of the following query:
    SELECT SINGLE MAX( policyterm ) startterm INTO (lv_term, lv_cal_date) FROM zu1cd_policyterm WHERE gpart = gv_part GROUP BY startterm.
    Thanks and Regards,
    Johny

    long lists can not be produced with  a SELECT SINGLE, there is also nothing to group.
    But I guess the SINGLE is a bug
    SELECT MAX( policyterm ) startterm
                  INTO (lv_term, lv_cal_date)
                  FROM zu1cd_policyterm
                  WHERE gpart = gv_part
                  GROUP BY startterm.
    How many records are in zu1cd_policyterm ?
    Is there an index starting with gpart?
    If first answer is 'large' and second 'no'   =>   slow
    What is the meaning of gpart?  How many different values can it assume?
    If many different values then an index makes sense, if you are allowed to create
    an index.
    Otherwise you must be patient.
    Siegfried

  • How to Improve Performance of this query??

    Hi experts,
    Kindly suggest me some perfomance optimization on the below code.
    SELECT * FROM vtrdi AS v
                   INTO TABLE six
                   FOR ALL ENTRIES IN r_vbeln
                   WHERE vbeln EQ  r_vbeln-low
                   AND   trsta IN  s_trsta
                   AND   vstel IN  s_vstel
                   AND   tddat IN  s_tddat
                   AND   vbtyp IN  r_vbtyp
                   AND   lstel IN  s_lstel
                   AND   route IN  s_route
                   AND   tragr IN  s_tragr
                   AND   vsbed IN  s_vsbed
                   AND   land1 IN  s_land1
                   AND   lzone IN  s_lzone
                   AND   wadat IN  s_wadat
                   AND   wbstk IN  s_wbstk
                   AND   lddat IN  s_lddat
                   AND   lfdat IN  s_lfdat
                   AND   kodat IN  s_kodat
                   AND   kunnr IN  s_kunnr
                   AND   spdnr IN  s_spdnr
                   AND   inco1 IN  s_inco1
                   AND   inco2 IN  s_inco2
                   AND   lprio IN  s_lprio
                   AND EXISTS ( SELECT * FROM likp
                                  WHERE vbeln EQ v~vbeln
                                  AND lifnr IN s_lifnr    
                                  AND lgtor IN s_lgtor
                                  AND lgnum IN s_lgnum
                                  AND lfuhr IN s_lfuhr
                                  AND aulwe IN s_aulwe
                                  AND traty IN s_traty
                                  AND traid IN s_traid
                                  AND vsart IN s_vsart
                                  AND trmtyp IN s_trmtyp
                                  AND sdabw IN s_sdabw
                                  AND cont_dg IN r_cont_dg ).
    Thanks in Advance...
    Santosh.

    Try to write 2 select
    SELECT * FROM vtrdi AS v
    INTO TABLE six
    FOR ALL ENTRIES IN r_vbeln
    WHERE vbeln EQ r_vbeln-low
    AND trsta IN s_trsta
    AND vstel IN s_vstel
    AND tddat IN s_tddat
    AND vbtyp IN r_vbtyp
    AND lstel IN s_lstel
    AND route IN s_route
    AND tragr IN s_tragr
    AND vsbed IN s_vsbed
    AND land1 IN s_land1
    AND lzone IN s_lzone
    AND wadat IN s_wadat
    AND wbstk IN s_wbstk
    AND lddat IN s_lddat
    AND lfdat IN s_lfdat
    AND kodat IN s_kodat
    AND kunnr IN s_kunnr
    AND spdnr IN s_spdnr
    AND inco1 IN s_inco1
    AND inco2 IN s_inco2
    AND lprio IN s_lprio.
    SELECT * FROM likp  into table itab
    WHERE vbeln EQ v~vbeln
    AND lifnr IN s_lifnr
    AND lgtor IN s_lgtor
    AND lgnum IN s_lgnum
    AND lfuhr IN s_lfuhr
    AND aulwe IN s_aulwe
    AND traty IN s_traty
    AND traid IN s_traid
    AND vsart IN s_vsart
    AND trmtyp IN s_trmtyp
    AND sdabw IN s_sdabw
    AND cont_dg IN r_cont_dg
    loop at six
      check whether entry is exists or not
    if not remove from six interbal table.
    endloop.
    Thanks
    Venkat

  • SQL Performance - Looking for a hint or suggestion on how to improve performance.

    I've linked several tables for the Sales Order, Delivery, and Invoicing. In essence, a query to show shipments and invoicing to a sales order.
    Throughput is poor....60 + seconds, so I am looking for a solution...perhaps /* + hints*/ techinques to improve the performance of this code.
    Here is a functional version of the code....
    /* Functionally tested join between OM, WSH, AR Tables */
    Select oeh.order_number
         , trx_number as invc_no
         , rctl.line_number as invc_line_no
         , rctl.inventory_item_id rctl_inventory_item_id
         , rctl.sales_order_line as SO_Line_No
         , oel.line_id
         , rctl.line_type
         , oel.ship_from_org_id as oel_ship_from_org_id
         , rctl.warehouse_id
         , oel.ordered_quantity
         , oel.shipped_quantity
         , oel.invoiced_quantity
         , rctl.UNIT_SELLING_PRICE
         , rctl.extended_amount
         , rctl.revenue_amount
         , wdd.delivery_detail_id
         , wnd.delivery_id
         , rctl.interface_line_attribute1  -- Sales Order Number
         , rctl.interface_line_attribute3  -- delivery_id (wsh)
         , rctl.interface_line_attribute6  -- Sales Order Line Id
      From apps.oe_order_headers_all oeh
         , apps.oe_order_lines_all oel
         , apps.wsh_delivery_details wdd
         , apps.wsh_new_deliveries wnd
         , apps.wsh_delivery_assignments wda
         , apps.ra_customer_trx_all rct
         , apps.ra_customer_trx_lines_all rctl
    Where oeh.header_id = oel.header_id                           
       and wdd.source_header_id = oeh.header_id
       and wdd.source_header_id = oel.header_id 
           and wdd.source_line_id = oel.line_id
           and wdd.SOURCE_CODE = 'OE'
       and wdd.delivery_detail_id = wda.delivery_detail_id
       and wda.delivery_id = wnd.delivery_id
       and rctl.interface_line_attribute1 = to_char(oeh.order_number)
          and rctl.interface_line_attribute6 = to_char(oel.line_id) --this is where explain plan cost is high!
           and rctl.org_id = oel.org_id
       and rctl.interface_line_attribute3 = to_char(wnd.delivery_id)
       and rctl.customer_trx_id = rct.customer_trx_id
       and rct.interface_header_context = 'ORDER ENTRY'
       and oeh.order_number = '99999' --enter desired sales order here....
    Order by 1,2,3,4;

    Can you provide your explain?
    Also, can you do an "set autotrace traceonly" and run it again and post results?  The results of that would help people here provide more reasonable suggestions.
    (Mine so far is only: avoid hints - that's a crutch and not solving the real problem).
    Are your statistics up to date?
    select table_name, last_analyzed from dba_tables
    where table_name in (
           'OE_ORDER_HEADERS_ALL OEH','OE_ORDER_LINES_ALL OEL','WSH_DELIVERY_DETAILS WDD',
           'WSH_NEW_DELIVERIES WND','WSH_DELIVERY_ASSIGNMENTS WDA','RA_CUSTOMER_TRX_ALL RCT',
            'RA_CUSTOMER_TRX_LINES_ALL RCTL' );

  • How to improve performance of MediaPlayer?

    I tried to use the MediaPlayer with a On2 VP6 flv movie.
    Showing a video with a resolution of 1024x768 works.
    Showing a video with a resolution of 1280x720 and a average bitrate of 1700 kb/s leads to a delay of the video signal behind the audio signal of a couple of seconds. VLC, Media Player Classic and a couple of other players have no problem with the video. Only the FX MediaPlayer shows a poor performance.
    Additionally mouse events in a second stage (the first stage is used for the video) are not processed in 2 of 3 cases. If the MediaPlayer is switched off, the mouse events work reliable.
    Does somebody know a solution for this problems?
    Cheers
    masim

    duplicate thread..
    How to improve performance of attached query

  • HOW TO IMPROVE PERFORMANCE ON SUM FUNCTION IN INLINE SQL QUERY

    SELECT NVL(SUM(B1.T_AMOUNT),0) PAYMENT,B1.ACCOUNT_NUM,B1.BILL_SEQ
    FROM
    SELECT P.T_AMOUNT,P.ACCOUNT_NUM,P.BILL_SEQ
    FROM PAYMENT_DATA_VIEW P
    WHERE TRUNC(P.ACC_PAYMENT_DATE) < '01-JAN-2013'
    AND P.CUSTOMER_NAME ='XYZ'
    AND P.CLASS_ID IN (-1,1,2,94)
    ) B1
    GROUP BY B1.ACCOUNT_NUM,B1.BILL_SEQ
    Above is the query.If we run inner query it takes few second to execute but while we are summing up the same amount and bill_Seq using inline view, it takes time to execute it.
    Note: Count of rows selected from inner query will be around >10 Lac
    How to improve the performance for this query?
    Pls suggest
    Thanks in advance

    989209 wrote:
    SELECT NVL(SUM(B1.T_AMOUNT),0) PAYMENT,B1.ACCOUNT_NUM,B1.BILL_SEQ
    FROM
    SELECT P.T_AMOUNT,P.ACCOUNT_NUM,P.BILL_SEQ
    FROM PAYMENT_DATA_VIEW P
    WHERE TRUNC(P.ACC_PAYMENT_DATE) < '01-JAN-2013'
    AND P.CUSTOMER_NAME ='XYZ'
    AND P.CLASS_ID IN (-1,1,2,94)
    ) B1
    GROUP BY B1.ACCOUNT_NUM,B1.BILL_SEQ
    Above is the query.If we run inner query it takes few second to execute but while we are summing up the same amount and bill_Seq using inline view, it takes time to execute it.
    Note: Count of rows selected from inner query will be around >10 Lac
    How to improve the performance for this query?
    Pls suggest
    Thanks in advancea) Lac is not an international unit, so is not understood by everyone. This is an international forum so please use international units.
    b) Please read the FAQ: {message:id=9360002} to learn how to format your question correctly for people to help you.
    c) As your question relates to performance tuning, please also read the two threads linked to in the FAQ: {message:id=9360003} for an idea of what specific information you need to provide for people to help you tune your query.

  • User exit for  this code

    Hi ..
    my requirement  is the program should prompt for 3 parameters (all check marks) with the follwoing text; all check marks enabled by default
    - Variables
    - Key Figures
    - Structures
    So when users select variables then do this part in main program
    test_for = 'STR'.
    perform dowork using test_for.
    for key figures
    test_for = 'CKF'.
    perform dowork using test_for.
    test_for = 'SEL'.
    perform dowork using test_for.
    for variables
    test_for = 'VAR'.
    perform dowork using test_for.
    please give  the code how to write that one.
    thanks in advance
    Madhavi

    Hi Maik,
    am using this quode for one tool .this tool is used for copy queries from one system another instead of transporting.its easy method.so i want to do some modifications for this code.please elaborate ur answer .will assign points.
    Cheers,
    Madhavi

  • How to improve performance when there are many TextBlocks in ItemsControl items?

       Hi,
       I'm trying to find a way to improve performance for a situation when there is an ItemsControl using UI and Data virtualization and each item on that control has 36 TextBlocks. Basically the item is a single string. There are so many TextBlocks
    to allow assigning different brushes to different parts of the string. Performance of this construction is terrible. I have 37 items visible on the screen and if I try to scroll up or down it scrolls into the black space and then it takes a second or two to
    show the items.
       I tried different things. For example, the most successful performance-wise was to replace TextBlocks with Borders and then draw bitmaps. In other words, I prepared 127 bitmaps for each character (I need ASCII only) and then I used those bitmaps
    to set Border.Backgrounds. It improved performance about 1.5 - 2 times but it consumed much more memory (which is not surprising, of course). Required amount of memory is so big that it throws OutOfMemoryException on 512MB emulator but works on 1GB. As a result
    I don't thing it is a good solution.
       Another thing that worked perfect is to replace 36 TextBlocks with only 6 TextBlocks. In this case the performance improvement is about 5 - 10 times but I lose the ability to set different colors to different parts of the string. It seems that
    the performance degrades dramatically with the increase of number of TextBlocks. Is there another technique to draw strings where literally each character can be of different color with decent performance?
    Thank you
    Alex

       Using Runs inside TextBlocks gives approximately the same improvement as using bitmaps 1.5 - 2 times faster but it is not even close to the case with just a couple of TextBlocks in the ItemsControl item. Any other ideas?
    Alex

  • How to improve performance of query

    Hi all,
    How to improve performance of query.
    please send :
    [email protected]
    thanks in advance
    bhaskar

    hi
    go through the following links for performance
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/cccad390-0201-0010-5093-fd9ec8157802
    http://www.asug.com/client_files/Calendar/Upload/ASUG%205-mar-2004%20BW%20Performance%20PDF.pdf
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/1955ba90-0201-0010-d3aa-8b2a4ef6bbb2

  • To improve performance for report

    Hi Expert,
    i have generated the opensales order report which is fetching data from VBAK it is taking more time exectuing in the forground itself.
    it is going in to dump in foreground and i have executed in the background also but it is going in to dump.
    SELECT vbeln
               auart
               submi
               vkorg
               vtweg
               spart
               knumv
               vdatu
               vprgr
               ihrez
               bname
               kunnr
        FROM vbak
        APPENDING TABLE itab_vbak_vbap
        FOR ALL ENTRIES IN l_itab_temp
    *BEGIN OF change 17/Oct/2008.
        WHERE erdat IN s_erdat              AND
             submi = l_itab_temp-submi     AND
    *End of Changes 17/Oct/2008.
              auart = l_itab_temp-auart     AND
    *BEGIN OF change 17/Oct/2008.
              submi = l_itab_temp-submi     AND
    *End of Changes 17/Oct/2008.
              vkorg = l_itab_temp-vkorg     AND
              vtweg = l_itab_temp-vtweg     AND
              spart = l_itab_temp-spart     AND
              vdatu = l_itab_temp-vdatu     AND
              vprgr = l_itab_temp-vprgr     AND
              ihrez = l_itab_temp-ihrez     AND
              bname = l_itab_temp-bname     AND
              kunnr = l_itab_temp-sap_kunnr.
        DELETE itab_temp FROM l_v_from_rec TO l_v_to_rec.
      ENDDO.
    Please give me suggession for improving performance for the programmes.

    hi,
    you try like this
    DATA:BEGIN OF itab1 OCCURS 0,
         vbeln LIKE vbak-vbeln,
         END OF itab1.
    DATA: BEGIN OF itab2 OCCURS 0,
          vbeln LIKE vbap-vbeln,
          posnr LIKE vbap-posnr,
          matnr LIKE vbap-matnr,
          END OF itab2.
    DATA: BEGIN OF itab3 OCCURS 0,
          vbeln TYPE vbeln_va,
          posnr TYPE posnr_va,
          matnr TYPE matnr,
          END OF itab3.
    SELECT-OPTIONS: s_vbeln FOR vbak-vbeln.
    START-OF-SELECTION.
      SELECT vbeln FROM vbak INTO TABLE itab1
      WHERE vbeln IN s_vbeln.
      IF itab1[] IS NOT INITIAL.
        SELECT vbeln posnr matnr FROM vbap INTO TABLE itab2
        FOR ALL ENTRIES IN itab1
        WHERE vbeln = itab1-vbeln.
      ENDIF.

Maybe you are looking for

  • Making a spot color channel of a selection

    I want to make a spot color channel out of the current selection. How can I use the seletion to make the new channel? tell application "Adobe Photoshop CS6"     activate     set useropacity to 50     set teller to 1     set userchannelname to "kleur

  • Ignore required fileds when click on af:ShowDetilItem

    I am using jdeveloper 11.1.2 I have jsf page with two showDetailItem in each one I have <af:region> which is task flow with jsff page contain required fields I need when click on showDetailItem to take me to this component without displaying error me

  • Help! Safari crashing when using finder to download/upload

    Any time I try to do anything which involves Finder popping up such as uploading photos to Facebook, I get a message saying, "Safari quit unexpectedly while using the FinderKit plug-in", can anybody help me?! This is the detailed feedback about it Pr

  • AirPrint SAMSUNG M2675 not working

    Hello My net printer doesn't allow me to connect to it. It is working on other macs in the office (with Mavericks on not) but not on mine. The air print option in preferences panel seems not working (displays error when adding through the preferences

  • Sample Websphere6 JMS application with default Messaging

    Hi, Where could I get the Sample Websphere6 JMS application with default messaging?. Please post me a link Thank you