Regarding performance tunnning

hi experts,
               i have developed a report but while execution  it is taking some extra time ,i already checked the extended program check and the code inspector,,i made it to zero for error ,warning etc.what extra sud i do to improve the performance,plz help me   ,here i m giving my codes the complete pogram......
program:::::
REPORT  ZRAWPRACTICE.
*Person:
*Program For:Mr.
*Module:MM & PP.
*Description :
*ALV GRID DISPLAY AND FORM WITH THE HELP OF SAP-SCRIPT TOOLS:
*type groups:
type-pools:slis.
*tables workarea:
tables:mard,t001w,mkpf,mseg,makt,T750E,t001l.
*internal table for final display:
data:begin of itab_final occurs 0,
     werks like mard-werks,         "for plant id
     matnr like mard-matnr,         "for material number
     maktx like makt-maktx,         "for material description
     name1 like t001w-name1,        "plant name
     lifnr like mseg-lifnr,         "vendors number
     name2 like lfa1-name1,         "vendors name
     labst_tm like mard-labst,      "target monthly
     labst like mard-labst,         "opening stock
     labst_cl like mard-labst,      "closing stock
     labst_rt like mard-labst,      "receive today
     labst_rtld like mard-labst,    "receive till date
     labst_rty like mard-labst,     "receive till year
     labst_it like mard-labst,      "issued today
     labst_itld like mard-labst,    "issued till date
     labst_ity like mard-labst,     "issued till year
     bwart like mseg-bwart,         "movement type
     mblnr like mseg-mblnr,         "material doc number
     eisbe_cl like marc-eisbe ,     "closing balance
     eisbe like marc-eisbe,         "safety stock
     insme like mard-insme,         "Stock in quality inspection
     speme like mard-speme,         "Blocked stock
     einme like mard-einme,         "Totl Stck of All Restricted Batches
     retme like mard-retme,         "Blocked Stock Returns
     lgort like mard-lgort,         "Storage location
     lgobe like t001l-lgobe,        "Description of storage location
     P_DATE like sy-datum,          "for previous date
     gptxt like t750e-gptxt,        "for remarks
     end of itab_final.
*internal table for mseg.:
data:begin of itab_mseg occurs 0,
     mblnr like mseg-mblnr,         "Number of Material Document
     matnr like mseg-matnr,         "Material Number
     werks like mseg-werks,         "Plant
     lgort like mseg-lgort,         "Storage location
     bwart like mseg-bwart,         "Movement Type
     erfmg like mseg-erfmg,         "Quantity in unit of entry
     shkzg like mseg-shkzg,         "Debit/Credit Indicator
     menge like mseg-menge,         "quantity
     menge1 like mseg-menge,        "for passing sum
     mjahr like mseg-mjahr,         "Material Document Year
     name1 like lfa1-name1,         "Name 1
     lifnr like mseg-lifnr,         "Vendor's account number
     end of itab_mseg.
*internal table for movement type:
data:itab1 like itab_mseg occurs 0 with header line.
data:itab2 like itab_mseg occurs 0 with header line.
*internal table for mkpf:
data:begin of itab_mkpf occurs 0,
     mblnr like mkpf-mblnr,         "Number of Material Document
     mjahr like mkpf-mjahr,         "Material Document Year
     budat like mkpf-budat,         "Posting Date in the Document
     blart like mkpf-blart,         "Document type
     p_date1 like sy-datum,         "for psting date
     end of itab_mkpf.
*internal table for rcving date:
data:begin of itab_mkpf_rcvdate occurs 0,
     mblnr like mkpf-mblnr,         "Number of Material Document
     mjahr like mkpf-mjahr,         "Material Document Year
     budat like mkpf-budat,         "Posting Date in the Document
     blart like mkpf-blart,         "Document type
     P_DATE2 like sy-datum,         "for previous date(rcv qty)
     end of itab_mkpf_rcvdate.
*internal table for quantity received:
data:begin of itab_101 occurs 0,
     matnr like mseg-matnr,         "Material Number
     erfmg like mseg-erfmg,         "Quantity in unit of entry
     mblnr like mseg-mblnr,         "Number of Material Document
     ebeln like mseg-ebeln,         "Purchase order number
     werks like mseg-werks,         "Plant
     erfmg_rt(13) type c,           "Quantity received today
     lgort like mseg-lgort,         "Storage location
     bwart like mseg-bwart,         "Movement Type
     lfbnr like mseg-lfbnr,         "Doc No. of a Reference Document
     smbln like mseg-smbln,         "Number of Material Document
     end of itab_101.
*internal table for deleting the docno.
data:itab3 like itab_101 occurs 0 with header line.
*internal table for plant name:
data:begin of itab_t001w occurs 0,
     werks like t001w-werks,        "plant id
     name1 like t001w-name1,        "plant name
     end of itab_t001w.
*internal table for VENDOR name:
data:begin of itab_lfa1 occurs 0,
     lifnr like lfa1-lifnr,         "vendor number
     name1 like lfa1-name1,         "vendor name
     end of itab_lfa1.
*internal table for Opening stock:
data:begin of itab_mard occurs 0,
     matnr like mard-matnr,         "material number
     labst like mard-labst,         "opening stock
     werks like mard-werks,         "plant id
     end of itab_mard.
*internal table for material description:
data:begin of itab_makt occurs 0,
     matnr like makt-matnr,         "material number
     maktx like makt-maktx,         "material description
     end of itab_makt.
*internal table for safety stock:
data:begin of itab_marc occurs 0,
     matnr like marc-matnr,         "materail number
     werks like marc-werks,         "plant id
     eisbe like marc-eisbe,         "safety stock
     end of itab_marc.
*internal table for mkpf and mseg inner join
data:begin of itab_mkpf_mseg occurs 0,
     mblnr like mkpf-mblnr,
     mjahr like mkpf-mjahr,
     budat like mkpf-budat,
     blart like mkpf-blart,
     matnr like mseg-matnr,
     werks like mseg-werks,
     lgort like mseg-lgort,
     bwart like mseg-bwart,
     erfmg like mseg-erfmg,
     shkzg like mseg-shkzg,
     menge like mseg-menge,
     menge1 like mseg-menge,
     end of itab_mkpf_mseg.
*internal table for mkpf for current date:
data:itab_mkpf1 like itab_mkpf_mseg occurs 0 with header line.
*internal table for collection
DATA: BEGIN OF WEG_MAT OCCURS 100,
      WERKS LIKE MSEG-WERKS,
      LGORT LIKE MSEG-LGORT,
      MATNR LIKE MSEG-MATNR,
      SHKZG LIKE MSEG-SHKZG,
      MENGE(09) TYPE P DECIMALS 3,
      END OF WEG_MAT.
*for closing stock & opening stock
DATA: BEGIN OF BESTAND OCCURS 100,
        BWKEY LIKE MBEW-BWKEY,
        WERKS LIKE MSEG-WERKS,
        lgort like mseg-lgort,
        MATNR LIKE MSEG-MATNR,
        CHARG LIKE MSEG-CHARG,
        ENDMENGE(09) TYPE P DECIMALS 3,
        ANFMENGE(09) TYPE P DECIMALS 3,
        MEINS LIKE MARA-MEINS,
        SOLL(09) TYPE P DECIMALS 3,
        HABEN(09) TYPE P DECIMALS 3,
        WAERS LIKE T001-WAERS,
      END OF BESTAND.
*for current date movement type
DATA: BEGIN OF SUM_MAT OCCURS 100,
        lgort like mseg-lgort,
        WERKS LIKE MSEG-WERKS,
        MATNR LIKE MSEG-MATNR,
        SHKZG LIKE MSEG-SHKZG,
        MENGE(09) TYPE P DECIMALS 3,                               "XJD
      END OF SUM_MAT.
*for sotrage location description
data:begin of itab_t001l occurs 0,
     lgort like t001l-lgort,
     lgobe like t001l-lgobe,
     end of itab_t001l.
*WORK AREAS DEFINED FOR ALV'S:
DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,       "field catalog
      IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,     "field catalog ITAB
      WA_SORT TYPE SLIS_SORTINFO_ALV,           "SORT work area
      IT_SORT TYPE SLIS_T_SORTINFO_ALV,         "SORT ITAB
      LAYOUT TYPE SLIS_LAYOUT_ALV,              "LAYOUT
      WA_FCODE TYPE SLIS_EXTAB,                 "FUN CODE
      I_FCODE_EXTAB TYPE SLIS_T_EXTAB,
      WA_EVENTS TYPE SLIS_ALV_EVENT,
      IT_EVENTS TYPE SLIS_T_EVENT.
*for selection screen:
SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME title text-001.
PARAMETERS: s_werks like mseg-werks obligatory,
            s_date like mkpf-budat obligatory.
select-options:matnr for mard-matnr no intervals obligatory.
SELECTION-SCREEN END OF BLOCK B1.
SELECTION-SCREEN BEGIN OF BLOCK B2 WITH FRAME title text-002.
PARAMETERS: LIST RADIOBUTTON GROUP G1,
            FORM RADIOBUTTON GROUP G1.
SELECTION-SCREEN END OF BLOCK B2.
*for start of selection event:
start-of-selection.
perform get_data.
perform get_mkpf_data.
perform get_mseg_data.
perform get_opening_stock.
perform alv_display.      ""for opening and closing stcok
perform get_mseg_cancellation.
perform get_mseg_recvtoday_quantity .
perform get_refresh_alltable.
perform get_mseg_recvtilldate_quantity .
perform get_mseg_recvtillyear_quantity .
perform get_refresh_alltable.
perform get_mseg_issuedtoday_quantity .
perform get_mseg_issdtilldate_quantity .
perform get_mseg_issdtillyear_quantity .
perform refresh_mseg_mkpf.
perform define_fieldcatalog.
*perform sort_field.
perform check_options.
*&      Form  define_fieldcatalog
      text
-->  p1        text
<--  p2        text
FORM define_fieldcatalog .
  WA_FIELDCAT-COL_POS = 1.
  WA_FIELDCAT-FIELDNAME = 'WERKS'.
  WA_FIELDCAT-SELTEXT_L = 'Plant id'.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 2.
  WA_FIELDCAT-FIELDNAME = 'NAME1'.
  WA_FIELDCAT-SELTEXT_L = 'Plant name'.
  WA_FIELDCAT-OUTPUTLEN = 30.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 3.
  WA_FIELDCAT-FIELDNAME = 'MAKTX'.
  WA_FIELDCAT-SELTEXT_L = 'Material Description'.
  WA_FIELDCAT-OUTPUTLEN = 40.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 4.
  WA_FIELDCAT-FIELDNAME = 'MATNR'.
  WA_FIELDCAT-SELTEXT_L = 'Material Number'.
  WA_FIELDCAT-OUTPUTLEN = 15.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
WA_FIELDCAT-COL_POS = 5.
WA_FIELDCAT-FIELDNAME = 'MBLNR'.
WA_FIELDCAT-SELTEXT_L = 'Material Doc.No.'.
WA_FIELDCAT-OUTPUTLEN = 15.
WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
APPEND WA_FIELDCAT TO IT_FIELDCAT.
CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 5.
  WA_FIELDCAT-FIELDNAME = 'LGORT'.
  WA_FIELDCAT-SELTEXT_L = 'Storage Location'.
  WA_FIELDCAT-OUTPUTLEN = 17.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 6.
  WA_FIELDCAT-FIELDNAME = 'LGOBE'.
  WA_FIELDCAT-SELTEXT_L = 'Storage Location Descriptions'.
  WA_FIELDCAT-OUTPUTLEN = 28.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 7.
  WA_FIELDCAT-FIELDNAME = 'NAME2'.
  WA_FIELDCAT-SELTEXT_L = 'Source/Vendor'.
  WA_FIELDCAT-OUTPUTLEN = 33.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 8.
  WA_FIELDCAT-FIELDNAME = 'LABST_TM'.
  WA_FIELDCAT-SELTEXT_L = 'Target Monthly'.
  WA_FIELDCAT-OUTPUTLEN = 15.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  WA_FIELDCAT-DO_SUM = 'X'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 9.
  WA_FIELDCAT-FIELDNAME = 'LABST'.
  WA_FIELDCAT-SELTEXT_L = 'Opening Stock'.
  WA_FIELDCAT-OUTPUTLEN = 15.
  WA_FIELDCAT-DO_SUM = 'X'.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 10.
  WA_FIELDCAT-FIELDNAME = 'LABST_RT'.
  WA_FIELDCAT-SELTEXT_L = 'Receive today'.
  WA_FIELDCAT-OUTPUTLEN = 15.
  WA_FIELDCAT-DO_SUM = 'X'.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 11.
  WA_FIELDCAT-FIELDNAME = 'LABST_RTLD'.
  WA_FIELDCAT-SELTEXT_L = 'Receive till date'.
  WA_FIELDCAT-OUTPUTLEN = 20.
  WA_FIELDCAT-DO_SUM = 'X'.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 12.
  WA_FIELDCAT-FIELDNAME = 'LABST_RTY'.
  WA_FIELDCAT-SELTEXT_L = 'Receive till year'.
  WA_FIELDCAT-OUTPUTLEN = 20.
  WA_FIELDCAT-DO_SUM = 'X'.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 13.
  WA_FIELDCAT-FIELDNAME = 'LABST_IT'.
  WA_FIELDCAT-SELTEXT_L = 'Issued today'.
  WA_FIELDCAT-OUTPUTLEN = 13.
  WA_FIELDCAT-DO_SUM = 'X'.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 14.
  WA_FIELDCAT-FIELDNAME = 'LABST_ITLD'.
  WA_FIELDCAT-SELTEXT_L = 'Issued till date'.
  WA_FIELDCAT-OUTPUTLEN = 20.
  WA_FIELDCAT-DO_SUM = 'X'.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 15.
  WA_FIELDCAT-FIELDNAME = 'LABST_ITY'.
  WA_FIELDCAT-SELTEXT_L = 'Issued till year'.
  WA_FIELDCAT-OUTPUTLEN = 20.
  WA_FIELDCAT-DO_SUM = 'X'.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 16.
  WA_FIELDCAT-FIELDNAME = 'EISBE_CL'.
  WA_FIELDCAT-SELTEXT_L = 'Closing Balance'.
  WA_FIELDCAT-OUTPUTLEN = 16.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  WA_FIELDCAT-DO_SUM = 'X'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 17.
  WA_FIELDCAT-FIELDNAME = 'LABST_CL'.
  WA_FIELDCAT-SELTEXT_L = 'Closing Stock'.
  WA_FIELDCAT-OUTPUTLEN = 16.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  WA_FIELDCAT-DO_SUM = 'X'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 18.
  WA_FIELDCAT-FIELDNAME = 'EISBE'.
  WA_FIELDCAT-SELTEXT_L = 'Safety stock'.
  WA_FIELDCAT-OUTPUTLEN = 14.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  WA_FIELDCAT-DO_SUM = 'X'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
  WA_FIELDCAT-COL_POS = 19.
  WA_FIELDCAT-FIELDNAME = 'GPTXT'.
  WA_FIELDCAT-SELTEXT_L = 'Remarks'.
  WA_FIELDCAT-OUTPUTLEN = 100.
  WA_FIELDCAT-TABNAME = 'ITAB_FINAL'.
  WA_FIELDCAT-INPUT = 'X'.
  APPEND WA_FIELDCAT TO IT_FIELDCAT.
  CLEAR WA_FIELDCAT.
ENDFORM.                    " define_fieldcatalog
*&      Form  check_options
      text
-->  p1        text
<--  p2        text
FORM check_options .
  WA_EVENTS-NAME = 'TOP_OF_PAGE'.
  WA_EVENTS-FORM = 'TOP'.
  APPEND WA_EVENTS TO IT_EVENTS.
  CLEAR WA_EVENTS.
  WA_EVENTS-NAME = 'END_OF_LIST'.
  WA_EVENTS-FORM = 'END_LIST'.
  APPEND WA_EVENTS TO IT_EVENTS.
  CLEAR WA_EVENTS.
IF LIST = 'X'.
    PERFORM LIST_DISP.
ENDIF.
IF FORM = 'X'.
    PERFORM FORM_DISP.
ENDIF.
ENDFORM.                    " check_options
*&      Form  LIST_DISP
      text
-->  p1        text
<--  p2        text
FORM LIST_DISP .
PERFORM DEFINE_LAYOUT.
  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
   EXPORTING
     I_CALLBACK_PROGRAM             = SY-REPID
     IT_FIELDCAT                    = IT_FIELDCAT
     IS_LAYOUT                      = LAYOUT
     IT_SORT                        = IT_SORT
    I_CALLBACK_PF_STATUS_SET       = 'STATUS'
    IT_EXCLUDING                   = I_FCODE_EXTAB
    I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
     IT_EVENTS                      = IT_EVENTS[]
  IMPORTING
    E_EXIT_CAUSED_BY_CALLER        =
    ES_EXIT_CAUSED_BY_USER         =
    TABLES
     T_OUTTAB                       = itab_final
   EXCEPTIONS
     PROGRAM_ERROR                  = 1
     OTHERS                         = 2
  IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " LIST_DISP
*&      Form  get_data
      text
-->  p1        text
<--  p2        text
FORM get_data .
*for different types of stock with material number.
select mard~matnr
       mard~werks
       mard~lgort
       mard~labst
       mard~insme
       mard~speme
       mard~einme
       mard~retme
       mseg~lifnr into corresponding
       fields of table itab_final from mard inner join mseg on
       mard~matnr =
       msegmatnr where  mardmatnr in matnr and mard~werks = s_werks.
*for vendor name:
select lifnr
       name1
       from lfa1 into corresponding fields of table
       itab_lfa1 for all entries in itab_final where lifnr =
itab_final-lifnr.
*for plant name:
select werks
       name1 from t001w into corresponding fields of table
       itab_t001w for all entries in itab_final where werks =
itab_final-werks.
*for opening stock:
select werks
       matnr
       labst from mard into corresponding fields of table
itab_mard for all entries in itab_final where matnr = itab_final-matnr.
*for material description:
select matnr
       maktx from makt into corresponding fields of table
itab_makt for all entries in itab_final where matnr = itab_final-matnr.
*for safety stock:
select matnr
       werks
       eisbe from marc into corresponding fields of table
itab_marc for all entries in itab_final where matnr = itab_final-matnr.
*for storage location description
select lgort
       lgobe from t001l into corresponding fields of table
itab_t001l for all entries in itab_final where lgort = itab_final-lgort
sort itab_final by matnr lgort.
loop at itab_final.
read table itab_t001w with key werks = itab_final-werks.
if sy-subrc = 0.
itab_final-name1 = itab_t001w-name1.
endif.
read table itab_lfa1 with key lifnr = itab_final-lifnr.
if sy-subrc = 0.
itab_final-name2 = itab_lfa1-name1.
endif.
read table itab_makt with key matnr = itab_final-matnr.
if sy-subrc = 0.
itab_final-maktx = itab_makt-maktx.
endif.
read table itab_marc with key matnr = itab_final-matnr
                              werks = itab_final-werks.
if sy-subrc = 0.
itab_final-eisbe = itab_marc-eisbe.
endif.
read table itab_t001l with key lgort = itab_final-lgort.
if sy-subrc = 0.
itab_final-lgobe = itab_t001l-lgobe.
endif.
itab_final-labst = itab_final-labst + itab_final-insme +
                   itab_final-speme.
modify itab_final.
delete adjacent duplicates from itab_final comparing matnr lgort.
endloop.
*loop and case for the quantity of the field " target monthly.
loop at itab_final.
case itab_final-matnr.
     when '000000001000000008'.
     itab_final-labst_tm = '3000.000'.
     when '000000001000000007'.
     itab_final-labst_tm = '500.000'.
     when '000000001000000006'.
     itab_final-labst_tm = '400.000'.
     when '000000001000000005'.
     itab_final-labst_tm = '3000.000'.
     when '000000003000000011'.
     itab_final-labst_tm = '18000.000'.
     when '000000001000000000'.
     itab_final-labst_tm = '20000.000'.
     when '000000001000000001'.
     itab_final-labst_tm = '20000.000'.
endcase.
modify itab_final.
endloop.
ENDFORM.                    " get_data
form top.
    clear itab_final-p_date.
    WRITE:/ SY-ULINE.
    WRITE:/ 'REPORT DATE:', SY-DATUM, 60 'VISA STEEL LTD.' color 5,
                     100'Report Developed By Ravi kumar Gupta.' .
    WRITE:/ 'TIME:', SY-UZEIT.
*for previous date
    clear itab_final-p_date.
    itab_final-p_date = S_date - 1.
    WRITE:/ 'USER NAME:', SY-UNAME,55'STOCK REPORT FOR:',73
             ITAB_FINAL-P_DATE,100'Application:MM & PP.'.
    WRITE:/ 'PAGE', SY-PAGNO.
   write:/ 'Unit of Measure =','MT.'.
    translate itab_final-name1 to upper case.
    WRITE:/54 itab_final-name1 color 6.
    WRITE:/ SY-ULINE.
    skip 1.
endform.
form end_list.
   skip 1.
   write:/ sy-uline.
   write:/ 'Cc:S.B.Singh     Executive Director.'.
   write:/04'K.M.Lal       Executive Director Raw Material.'.
   write:/04'A.K.Lamba     President Project.'.
   write:/04'A.K.Agarwal   VP Commercial.'.
   write:/04'Murli Dhar    Manager Blast Furnace.'.
   write:/04'S.N.Sarangi   DGM Commercial.'.
   WRITE:/ SY-ULINE.    .
    SKIP 2.
    WRITE:/60 'END OF PAGE'.
endform.
*&      Form  FORM_DISP
      text
-->  p1        text
<--  p2        text
FORM FORM_DISP .
ENDFORM.                    " FORM_DISP
*&      Form  DEFINE_LAYOUT
      text
-->  p1        text
<--  p2        text
FORM DEFINE_LAYOUT .
  LAYOUT-ZEBRA = 'X'.
LAYOUT-SUBTOTALS_TEXT = 'SUBTOTAL SUM'.
  LAYOUT-WINDOW_TITLEBAR = 'STOCK REPORT'.
  LAYOUT-TOTALS_TEXT  = 'TOTAL'.
ENDFORM.                    " DEFINE_LAYOUT
*&      Form  get_mkpf_data
      text
-->  p1        text
<--  p2        text
FORM get_mkpf_data .
itab_mkpf-p_date1 = s_date.
itab_mkpf-p_date1+6 = '01'.
**for the current date
select mkpf~mblnr
       mkpf~budat
       mseg~matnr
       mseg~werks
       mseg~lgort
       mseg~bwart
       mseg~shkzg
       mseg~menge into corresponding fields of
       table itab_mkpf1 from mkpf inner join mseg on mkpf~mblnr =
       mseg~mblnr where
       budat eq itab_mkpf-p_date1
*for the whole year
select mkpf~mblnr
       mkpf~mjahr
       mkpf~budat
       mkpf~blart
       mseg~matnr
       mseg~werks
       mseg~lgort
       mseg~bwart
       mseg~erfmg
       mseg~shkzg
       mseg~menge into corresponding fields of
       table itab_mkpf_mseg from mkpf inner join mseg on mkpf~mblnr =
       mseg~mblnr where
       budat gt itab_mkpf-p_date1
       and budat le sy-datum.
ENDFORM.                    " get_mkpf_data
*&      Form  get_mseg_data
      text
-->  p1        text
<--  p2        text
FORM get_mseg_data .
sort itab_mkpf_mseg by werks lgort matnr .
*for the deletion of material from mseg.
sort itab_mkpf_mseg by matnr lgort.
loop at itab_mkpf_mseg.
read table itab_final with key matnr = itab_mkpf_mseg-matnr.
if sy-subrc eq 4.
delete itab_mkpf_mseg.
endif.
endloop.
*for material deletion of itab_mkpf1
loop at itab_mkpf1.
read table itab_mkpf_mseg with key matnr = itab_mkpf1-matnr.
if sy-subrc eq 4.
delete itab_mkpf1.
endif.
endloop.
sort itab_mkpf_mseg by matnr werks lgort shkzg.
delete itab_mkpf_mseg where lgort is initial.
*for closing stock i.e,all  mvmnt type summation
loop at itab_final.
   loop at itab_mkpf_mseg.
    IF  itab_final-werks = itab_mkpf_mseg-werks AND
          itab_final-lgort = itab_mkpf_mseg-lgort and
          itab_final-matnr = itab_mkpf_mseg-matnr.
          MOVE-CORRESPONDING itab_mkpf_mseg TO weg_mat.
          COLLECT weg_mat.
     ENDIF.
    ENDLOOP.
ENDLOOP.
*for  current date movement type
loop at itab_final.
   loop at itab_mkpf1.
    IF  itab_final-werks = itab_mkpf1-werks AND
          itab_final-lgort = itab_mkpf1-lgort and
          itab_final-matnr = itab_mkpf1-matnr.
          MOVE-CORRESPONDING itab_mkpf1 TO sum_mat.
          COLLECT sum_mat.
     ENDIF.
    ENDLOOP.
ENDLOOP.
*for closing stock
loop at itab_final.
CLEAR weg_mat-menge.
MOVE-CORRESPONDING itab_final TO bestand.
READ TABLE weg_mat WITH KEY werks = itab_final-werks
                            lgort = itab_final-lgort
                            matnr = itab_final-matnr
                            shkzg = 'S'.
bestand-endmenge = itab_final-labst + itab_final-insme +
                   itab_final-speme + itab_final-einme +
                   itab_final-retme - weg_mat-menge.
CLEAR weg_mat-menge.
READ TABLE weg_mat WITH KEY werks = itab_final-werks
                            lgort = itab_final-lgort
                            matnr = itab_final-matnr
                            shkzg = 'H'.
bestand-endmenge = bestand-endmenge + weg_mat-menge.    "closing stock
COLLECT bestand.
endloop.
ENDFORM.                    " get_mseg_data
*&      Form  refresh_mseg_mkpf
      text
-->  p1        text
<--  p2        text
FORM refresh_mseg_mkpf .
  REFRESH itab_mkpf.
  REFRESH itab_mseg.
  REFRESH itab1.
  REFRESH itab2.
ENDFORM.                    " refresh_mseg_mkpf
*&      Form  get_mseg_cancellation
      text
-->  p1        text
<--  p2        text
FORM get_mseg_cancellation .
itab_mkpf_rcvdate-p_date2 = s_date - 1.
select mblnr
       mjahr
       budat
       blart from mkpf into corresponding fields of
       table itab_mkpf_rcvdate where
       budat eq itab_mkpf_rcvdate-p_date2
       and blart in
       ('WA','WE','WL').
if not itab_mkpf_rcvdate[] is initial.
select matnr
       erfmg
       mblnr
       ebeln
       werks
       lgort
       bwart
       lfbnr
       erfmg
       smbln from mseg into corresponding fields of table itab_101
       for
       all entries in itab_mkpf_rcvdate
       where mblnr = itab_mkpf_rcvdate-mblnr and
       bwart in ('101','531') and werks = s_werks.
endif.
select mandt
       ebeln
       matnr
       bwart
       lfbnr
       smbln from mseg client specified into corresponding fields of
       table itab3 for
       all entries in itab_101 where  ebeln =
       itab_101-ebeln  and bwart in ('102','532') and mandt = sy-mandt .
loop at itab_101.
        read table itab3 with key lfbnr = itab_101-mblnr.
              if sy-subrc = 0.
              delete itab_101.
              continue.
              endif.
        read table itab3 with key smbln = itab_101-mblnr.
              if sy-subrc = 0.
              delete itab_101.
              continue.
              endif.
endloop.
sort itab_101 by  matnr.
ENDFORM.                    " get_mseg_cancellation
*&      Form  get_mseg_recvtoday_quantity .
      text
-->  p1        text
<--  p2        text
FORM get_mseg_recvtoday_quantity .
loop at itab_final.
   loop at itab_101.
      IF  itab_final-werks = itab_101-werks AND
          itab_final-lgort = itab_101-lgort and
          itab_final-matnr = itab_101-matnr.
          at end of matnr.
          sum.
          itab_101-erfmg_rt =  itab_101-erfmg.
          itab_final-labst_rt = itab_101-erfmg_rt .
          endat.
      endif.
   endloop.
modify itab_final.
endloop.
clear itab_final-labst_rt.
ENDFORM.                    " get_mseg_recvtoday_quantity .
*&      Form  get_mseg_recvtilldate_quantity
      text
-->  p1        text
<--  p2        text
FORM get_mseg_recvtilldate_quantity .
select mblnr
       mjahr
       budat
       blart from mkpf into corresponding fields of
       table itab_mkpf_rcvdate where
       budat between itab_mkpf-p_date1 and itab_mkpf_rcvdate-p_date2
       and blart in
       ('WA','WE','WL').
select matnr
       erfmg
       mblnr
       ebeln
       werks
       lgort
       bwart
       lfbnr
       erfmg
       smbln from mseg into corresponding fields of table itab_101
       for
       all entries in itab_mkpf_rcvdate
       where mblnr = itab_mkpf_rcvdate-mblnr and
       bwart in ('101','531') and werks = s_werks.
select mandt
       ebeln
       matnr
       bwart
       lfbnr
       smbln from mseg client specified
       into corresponding fields of table itab3 for
       all entries in itab_101 where  ebeln =
       itab_101-ebeln  and   bwart in ('102','532') and mandt = sy-mandt
loop at itab_101.
        read table itab3 with key lfbnr = itab_101-mblnr.
              if sy-subrc = 0.
              delete itab_101.
              continue.
              endif.
        read table itab3 with key smbln = itab_101-mblnr.
              if sy-subrc = 0.
              delete itab_101.
              continue.
              endif.
endloop.
sort itab_101 by  matnr.
loop at itab_final.
   loop at itab_101.
      IF  itab_final-werks = itab_101-werks AND
          itab_final-lgort = itab_101-lgort and
          itab_final-matnr = itab_101-matnr.
          at end of matnr.
          sum.
          itab_101-erfmg_rt =  itab_101-erfmg.
          itab_final-labst_rtld = itab_101-erfmg_rt.
          endat.
      endif.
   endloop.
modify itab_final.
endloop.
ENDFORM.                    " get_mseg_recvtilldate_quantity
*&      Form  get_refresh_alltable
      text
-->  p1        text
<--  p2        text
FORM get_refresh_alltable .
refresh itab_mkpf_rcvdate.
refresh itab_101.
refresh itab3.
refresh itab_mkpf.
ENDFORM.                    " get_refresh_alltable
*&      Form  get_mseg_recvtillyear_quantity
      text
-->  p1        text
<--  p2        text
FORM get_mseg_recvtillyear_quantity .
select mblnr
       mjahr
       budat
       blart from mkpf into corresponding fields of
       table itab_mkpf_rcvdate where
       budat le itab_mkpf_rcvdate-p_date2
       and blart in
       ('WA','WE','WL').
select matnr
       erfmg
       mblnr
       ebeln
       werks
       lgort
       bwart
       lfbnr
       erfmg
       smbln from mseg into corresponding fields of table itab_101
       for
       all entries in itab_mkpf_rcvdate
       where mblnr = itab_mkpf_rcvdate-mblnr and
       bwart in ('101','531') and werks = s_werks.
select mandt
       ebeln
       matnr
       bwart
       lfbnr
       smbln from mseg client specified
       into corresponding fields of table itab3 for
       all entries in itab_101 where  ebeln =
       itab_101-ebeln  and   bwart in ('102','532') and mandt = sy-mandt
loop at itab_101.
        read table itab3 with key lfbnr = itab_101-mblnr.
              if sy-subrc = 0.
              delete itab_101.
              continue.
              endif.
        read table itab3 with key smbln = itab_101-mblnr.
              if sy-subrc = 0.
              delete itab_101.
              continue.

hi,
1.first remove occurs 0 and occurs 0,
use types and delcare structure.
then declare internal table.
ex-
types : begin of ty_lfa1,
        kunnr like kna1-kunnr,'end of ty_kna1.
data : i_kna1 type standard table of ty_kna1 with header line.
2.instead of inner join use forallentries.
3. into corresponding fields of will decrease performance.
4. delete adjacent duplicates from itab_final comparing matnr lgort.
place it outside the loop.
5.before every select statenet check sy-subrc = 0.if sucessful the write another one.
6.dont' loop an internal table more than once.
and for better performane follow below points
Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
Avoid for all entries in JOINS
Try to avoid joins and use FOR ALL ENTRIES.
Try to restrict the joins to 1 level only ie only for tables
Avoid using Select *.
Avoid having multiple Selects from the same table in the same object.
Try to minimize the number of variables to save memory.
The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
Avoid creation of index as far as possible
Avoid operators like <>, > , < & like % in where clause conditions
Avoid select/select single statements in loops.
Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.
Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)
Avoid using ORDER BY in selects
Avoid Nested Selects
Avoid Nested Loops of Internal Tables
Try to use FIELD SYMBOLS.
Try to avoid into Corresponding Fields of
Avoid using Select Distinct, Use DELETE ADJACENT
Go through the following Document
Check the following Links
Re: performance tuning
Re: Performance tuning of program
http://www.sapgenie.com/abap/performance.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
check the below link
http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
See the following link if it's any help:
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
Check also http://service.sap.com/performance

Similar Messages

  • Regarding performance optimization and tuning...

    hi all,
    <b>please provide me the performance tuning scenarios and parameters of an R/3 system with Oracle..</b>
    i heartly welcome all docs and pdf links or notes related to this issue..
    please provide ur suggestions at the earliest...
    expecting ur response..
    <i>Vineeth</i>

    Hello,
    there are many SAP Notes regarding performance issues. Here are just a couple of them:
    618868
    805934
    793113
    805934
    Please also have a look at the lists of the relating Notes at the end of each Note.
    But still much more effective would be to read the book of
    <a href="http://www.sap-press.de/katalog/buecher/titel/gp/titelID-1155?GalileoSession=66220888A2.lRCIISlE">T.Schneider Performance Optimization Guide</a>.
    It's the best performance tuning guide. The course ADM315 (or BC315?) ist also very helpful.
    Regards,
    Natalia

  • Urgent query regarding performance

    hi
    i have one query regarding performance.iam using interactive reporting and workspace.
    i have all the linsence server,shared services,and Bi services and ui services and oracle9i which has metadata installed in one system(one server).data base which stores relationaldata(DB2) on another system.(i.e 2 systems in total).
    in order to increase performance i made some adjustments
    i installed hyperion BI server services, UI services,license server and shared services server such that all web applications (that used web sphere 5.1) such as shared services and UI services in server1(or computer1).and remaining linsence and bi server services in computer2 and i installed database(db2) on another computer3.(i.e 3 systems in total)
    my query : oracle 9i which has metadata where to install that in ( computer 1 or in computer 2 )
    i want to get best performance.where to install that oracle 9i which has metadata stored in it.
    for any queries please reply mail
    [email protected]
    9930120470

    You should know that executing a query is always slower the first time. Then Oracle can optimise your query and store it temporary for further executions. But passing from 3 minutes to 3 seconds, maybe your original query is really, really slow. Most of the times I only win few milliseconds. If Oracle is able to optimize it to 3 seconds. You must clearly rewrite your query.
    Things you should know to enhance your execution time : try to reduce the number of nested loops, nested loops give your an exponential execution time which is really slow :
    for rec1 in (select a from b) loop
      for  rec2 in (select c from d) loop
      end loop;
    end loop;Anything like that is bad.
    Try to avoid Cartesian products by writing the best where clause possible.
    select a.a,
             b.b
    from  a,
            b
    where b.b > 1This is bad and slow.

  • Regarding Performance Issue

    Hi Friends,
       i have a FI report, Main Cash Vocher Printing, the report is very slow so to check its performance i have done the SQL Trace in ST05.
    in SQL trace i have found all the DB tables used and time taken to execute the select statement.... in that list i also found and Cluster Table RFBLG , but i did not used these cluster table in the program.
    and i also found more than 500 entries of Obj.NameRFBLG in that  ...
    Though its duration is small , ,, can we control that so that my report performance van be increased
    its Urgent...
    Useful reply will be awarded maximum
    Regards
    Kumat M

    Hi Kumat,
    RFBLG is the Cluster table of the logical table BSEG. That means the table BSEG stores its rows in the database table RFBLG. If the access to RFBLG is fast enough, you could ignore those entries and concentrate on red lines in the trace.
    Regards
    Ralph Ganszky

  • Regarding Performance pbl in SQL query.

    hey guys,
    Could somebody help me over this posting.
    I have created TAX report. which retrieved records from BSIS and BSAS table to calculate consumption tax.
    From SE30 and SQL trace i found that loop at BSIS and BSAS takes round trip
    for each Input Period value.
    could you please give me best coding alternate to my below coding part.
    *Main code--
    loop at itab_t001.(itab_t001-bukrs is company code list,for each company code)
    WK_MONAT = '01'.
      DO.
        IF WK_MONAT = P_MONAT. "p_monat is parameter input for period
          FLG_CUR_PERIOD = CNS_TRUE.
        ENDIF.
        PERFORM FRM_READ_DATA.         " RETRIEVE DATA FROM BSIS AND BSAS
        WK_MONAT = WK_MONAT + 1.
        IF WK_MONAT > P_MONAT.
          EXIT.
        ENDIF.
      ENDDO.
    END of Main code----
          Read FI documents from table BSIS/BSAS
    FORM  FRM_READ_DATA.
    Select data from table BSIS
      SELECT BELNR BUZEI BLART MWSKZ HKONT SHKZG DMBTR
        INTO CORRESPONDING FIELDS OF TABLE ITAB_BSIS
        FROM BSIS WHERE BUKRS = itab_t001-BUKRS AND  GJAHR = P_GJAHR AND  MONAT = WK_MONAT AND
        ( MWSKZ <> ' ' AND MWSKZ <> '**' ).
    Select data from table BSAS
      SELECT BELNR BUZEI BLART MWSKZ HKONT SHKZG DMBTR
        APPENDING CORRESPONDING FIELDS OF TABLE ITAB_BSIS
        FROM BSAS  WHERE BUKRS = itab_t001-BUKRS AND  GJAHR = P_GJAHR AND MONAT = WK_MONAT AND
             ( MWSKZ <> ' ' AND MWSKZ <> '**' ).
    Select data from table BSIS that includes non-consumption tax accounts
      SELECT BELNR
       INTO TABLE ITAB_NO_TAX_DOC
        FROM BSIS WHERE BUKRS = itab_t001-BUKRS AND GJAHR = P_GJAHR AND
             MONAT = WK_MONAT AND HKONT IN S_NT_ACC.
    Select data from table BSAS that includes non-consumption tax accounts
      SELECT BELNR  APPENDING TABLE ITAB_NO_TAX_DOC
        FROM BSAS WHERE BUKRS = itab_t001-BUKRS AND  GJAHR = P_GJAHR AND
             MONAT = WK_MONAT AND HKONT IN S_NT_ACC.
    ...Proceeded with ABOVE fetched internal tables.
    ENDFORM.
    Note:
    I found that BSIS and BSAS table have 10000s of records it takes 3hrs time to run this report(if i give 12months period). (for each month(ie 01month report takes 15minutes to execute.)
    so i think instead calling BSiS twice, calling BSIS ones is wise.
    could you pls help me how can i modify the code and should i have
    to created any index here(if so mention how and which field)
    pls feel free to ask if any addition code is required.
    could you pls confirm.
    ambichan.
    Message was edited by: ambi chan

    Hi Ambichan,
    Few things that can be done to the below code.
    1. Dont put select queries inside the "loop at itab_t001....endloop" statement.
    Instead use <b>FOR ALL ENTRIES</b> IN itab_t001 for the queries. Then you can use READ stmt to get the values.
    NOTE: Make sure that you select all <b>key fields</b> from the databse when using FOR all Entries.
    <i>This will avoid hitting of the DB table multiple time.</i>
    2. Avoid "INTO CORRESPONDING FIELDS OF TABLE" in select queries. Modify the internal table to suit the strucutre of the databse table.
    <i>This will make the query faster</i>
    3. Make sure that the fields in the select query are in the same order as that in DB table.
    <i>This will also make the query faster</i>
    Try these changes and performance should increase.
    Regards,
    Saji.

  • Regarding Performance in XI

    Hi All,
    Q1) How Do we Do the Performance in XI ????
    Q2) What we have to do to Improve the Performance in XI ????
    Please let me Know
    Regards
    Vamsi

    1. Do u mean Monitor Performance?
    U can do this through Runtime Workbench -> performance Monitoring
    2. See these
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/489f5844-0c01-0010-79be-acc3b52250fd
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/defd5544-0c01-0010-ba88-fd38caee02f7?prtmode=navigate
    /people/prasad.illapani/blog/2007/04/27/performance-tuning-checks-in-sap-exchange-infrastructurexi-part-iii
    Regards,
    Prateek

  • Regarding Performance of the Index

    Hi all,
    Generally Index should increase the performance of the search, but i got the reverse of that when i was accessing the data from a table with and without index.
    I have seen that the query performed more faster without index. What is the situation of the data base to perform like this. Can anybody explain.
    SQL> set autotrace on explain
    SQL> select * from emp where empno = 7934;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    Elapsed: 00:00:00.18
    Execution Plan
    Plan hash value: 2949544139
    | Id  | Operation                   | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |        |     1 |    37 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP    |     1 |    37 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX UNIQUE SCAN         | PK_EMP |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("EMPNO"=7934)
    SQL> alter table emp disable primary key;
    Table altered.
    Elapsed: 00:00:01.53
    SQL> select * from emp where empno = 7934;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7934 MILLER     CLERK           7782 23-JAN-82       1300                    10
    Elapsed: 00:00:00.15
    Execution Plan
    Plan hash value: 3956160932
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |    37 |     3   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| EMP  |     1 |    37 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("EMPNO"=7934)Regards,
    Sri Ram.
    Edited by: Sri Ram on Jun 19, 2011 9:52 PM
    Edited by: BluShadow on 20-Jun-2011 10:33
    added {noformat}{noformat} tags.  86 posts and you still don't know how to post code/data?  Please read {message:id=9360002}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    SQL> alter table emp disable primary key;
    Table altered.
    Elapsed: 00:00:00.15
    SQL> select * from emp where empno =7566;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7566 JONES      MANAGER         7839 02-APR-81       2975                    40
    Elapsed: 00:00:00.17
    Execution Plan
    Plan hash value: 3956160932
    | Id  | Operation         | Name | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT  |      |     1 |    37 |     3   (0)| 00:00:01 |
    |*  1 |  TABLE ACCESS FULL| EMP  |     1 |    37 |     3   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       1 - filter("EMPNO"=7566)
    SQL> alter table emp enable primary key;
    Table altered.
    Elapsed: 00:00:00.14
    SQL> select * from emp where empno =7566;
         EMPNO ENAME      JOB              MGR HIREDATE         SAL       COMM     DEPTNO
          7566 JONES      MANAGER         7839 02-APR-81       2975                    40
    Elapsed: 00:00:00.17
    Execution Plan
    Plan hash value: 2949544139
    | Id  | Operation                   | Name   | Rows  | Bytes | Cost (%CPU)| Time     |
    |   0 | SELECT STATEMENT            |        |     1 |    37 |     1   (0)| 00:00:01 |
    |   1 |  TABLE ACCESS BY INDEX ROWID| EMP    |     1 |    37 |     1   (0)| 00:00:01 |
    |*  2 |   INDEX UNIQUE SCAN         | PK_EMP |     1 |       |     0   (0)| 00:00:01 |
    Predicate Information (identified by operation id):
       2 - access("EMPNO"=7566)Edited by: BluShadow on 20-Jun-2011 10:34
    added more {noformat}{noformat} tags.  See, it's really not that difficult, but I'm not going to do it all the time for you.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Regarding Performance

    Hi All,
    I am doing the performance analysis using SE30.
    I got the results as follows ::
    ABAP - 80%
    Database and System - 15%
    I understand database should be as low as possible.
    I wish to know about the ABAP.
    Its 80% so is it good or not good.
    What steps can we take to get it down if required.
    regards

    Hi Sachin,
    ABAP 80% denotes the program is too good.
    Generally ABAP should have more percentage than SYSTEM and DATABASE.
    ABAP 80% denotes you are utilizing application server as 80%.
    If helps plz reward points.
    Regards
    Bhupal Reddy

  • Regarding Performance issues

    Can anybody share pure BI Performance document of DB02, St02,RSRST analysis does purpose.
    Can anyone share it., Thanks in advance.

    HI,
    check below links
    http://www.sap-press.de/download/dateien/1049/sappress_bw_performance_optimization_guide_080.pdf
    http://wiki.sdn.sap.com/wiki/display/BI/Aggregates--SAPBWQueryPerformance
    http://sap.seo-gym.com/performance%20tuning%20for%20queries.pdf
    Click on search button in SDN and Google you can find lots of docs
    Regards
    KP

  • Regarding performance impact if I do DB accessing coding in comp Controller

    Hi ,
    This is my project requirement, I have to use some com compoment which in turn fetches data from the database. I am using a java com bridge tool to do this. This tool is generating the java proxy classes for the VB com component.
    I am using java proxy classes( This class files are using JNI to connect to VB COM compnent and fetch the data from DB) in my webdynpro component controller.
    The architecture is aas below
    WEBDYNPRO    >>   JAVA Classes object( generated by the JAVA- COM bridge   tool )                         >>   JAVA-COM bridge  tool >> VB COM+ Component   >> SQL server.
    The issue
       Performance :-   first time it is OK but for Consecutive calls the application is going down very visibly and after 4 iteration it hangs . When I look at the log I am getting this
    Message : Exception occured during processing of Web Dynpro application com/oreqsrch/com.oreqsrchapp.OReqSrchApp.
    The causing exception is nested.
    [EXCEPTION]
    com.sap.tc.webdynpro.services.session.LockException: Thread SAPEngine_Application_Thread[impl:3]_36 failed to acquire exclusive lock on client session ClientSession(id=(J2EE9536400)ID1120562150DB11245826542790956137End_1159630423). Existing locks: LockingManager(ThreadName:SAPEngine_Application_Thread[impl:3]_36, exclusive client session lock:
    ClientSessionLock(SAPEngine_Application_Thread[impl:3]_9), shared client session locks: ClientSessionSharedLockManager([]), app session locks: ApplicationSessionLockManager([]), current request: com/oreqsrch/com.oreqsrchapp.OReqSrchApp).
    Hint: Take a thread dump of the server node to find the blocking thread that causes the problem.
    Is this issue because I have return the code data access code in the component controller rather wrting in some beans ?
    My questions regarding
    What would the performance impact if write the DB access code in the webdynpro component controller rather than writing in a bean or an EJB?( I know ideally DB access code has to write in Bean or EJB ).
    Please address  this with respedct to performance  point of view .
    thanks
    pkiran

    Hi Both,
    Thanks for the reply.
    Yes they are closed and set it to null;
    Connection max and mini properties are controlled at COM+ components in VB.
    Since I am using COM - JAVA bridge,  I am just invoking the methods defined ijn the VB code  thru the bridge tool. all the objects which are retrieving the data are closed and nullify it.
    My question is
    if I write DB access code in component control instead in EJB or Java bean, will there be any performance issue ?
    regards
    pkiran

  • Regarding performance issue in time dependent hierarchie.

    hai
    we are loading time dependent hierarchies from flatfile to bw,it is weekely load,we have nearly one million records loaded,we got an issues regarding change of these hierarchies timely.when ever there occurs a change in hierarchy a new row is added to the table,it is degrading the performance,can any one of you please suggest  how to over come performance related issues regarding time dependent hierarchies.
    Regards
    Srinivas.G

    hello deven,
    if you are only focusing on your application's performance
    on the aspect of usability i.e. less waiting time, fast
    response UI, i would personally suggest you to use AJAX.
    put some processing part on the browser side and making
    data retrieval from MI asynchronous... this way, your user
    don't have to wait for all data to be presented, but rather
    could work on the data presented in pieces (i.e. asynchronously).
    anyway try googling for AJAX...
    regards
    jo

  • Regarding Performance It is Urgent.

    hi
         I have one statement    move-corresponding gt_bkpf to post_tab.
    In gt_bkpf  Internal Table 10 fields are there. Post_tab is another Internal Table.
    In performance issue you need to use ASSIGN instead of move-corresponding.
    How can i do it. Plz Reply.
    Regards
    Rami Reddy

    Hi!
    Field to field assignment means the following:
    MOVE: gt_bkpf-bukrs TO post_tab-bukrs,
    gt_bkpf-belnr TO post_tab-belnr,
    gt_bkpf-gjahr TO post_tab-gjahr.
    It's a very little bit faster that move-corresponding, but if you need a new field, you have to code that also, against move-corresponding, which handles it automatically (if their names are identical).
    Regards
    Tamá

  • Regarding performance of a report

    Hi friends,
    In the loop statement I am using modify statement for updating the data in the internal table .
    I have to improve the performance of a report.
    is there any alternative for Improving teh performance.,
    Regards,
    Jayan

    HI
    If u r modifying Ztable no probelm  because we will be having small amount of data .
    IF u r updating standard table Do like below .
    First collect all the records which you want to update to table into one internal table .
    Then update the table with that internal table ..
    IT will be better when you are updating standard table .
    I think this will  help you ..
    If u r not understood copy paste ur code i can solve ur probelm ...

  • Regarding Performance Problem

    Dear All,
    I have
         8 GB Ram
        800 Hard Disk
       itanium2   1.40Ghz
       RAID 5 i.e 146*5
    but our sap performance is poor.
    is it correct configuration?
    please help the how i improve the performance of system.
    thanks in advance.
    regards,
    Abhijeet

    Hi,
        Did you scheduled archiving jobs and also fine tuning steps in your PI server
    Check this How to guide if not checked already.
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2016a0b1-1780-2b10-97bd-be3ac62214c7
    HTH
    Rajesh

  • Regarding performance of report

    hi SDNs,
    my report is running for more than 30 min and going dumb.
    so i am increasing the performance by considering every thing..
    putting indexes in select stmts .
    while reading ( READ TABLE ) using binary search.
    sorting before reading.
    thing is still showing, some poor performance..
    what to consider inorder to increase the perofrmance?
    and here report has to extract huge data ( min 50,000 records )
    shall i use HASHED OR SORTED ? how to use these??
    i am using STANDARD now ??
    pls help me .,
    Thanking you,
    ramu

    hi,
    pls go thru this. def this will help
    Performance tuning for Data Selection Statement 
    For all entries
    The for all entries creates a where clause, where all the entries in the driver table are combined with OR. If the number of 
    entries in the driver table is larger than rsdb/max_blocking_factor, several similar SQL statements are executed to limit the 
    length of the WHERE clause. 
    The plus
    Large amount of data 
    Mixing processing and reading of data 
    Fast internal reprocessing of data 
    Fast 
    The Minus
    Difficult to program/understand 
    Memory could be critical (use FREE or PACKAGE size) 
    Some steps that might make FOR ALL ENTRIES more efficient:
    Removing duplicates from the the driver table 
    Sorting the driver table 
    If possible, convert the data in the driver table to ranges so a BETWEEN statement is used instead of and OR statement:
    FOR ALL ENTRIES IN i_tab
      WHERE mykey >= i_tab-low and
            mykey <= i_tab-high.
    Nested selects
    The plus:
    Small amount of data 
    Mixing processing and reading of data 
    Easy to code - and understand 
    The minus:
    Large amount of data 
    when mixed processing isn’t needed 
    Performance killer no. 1
    Select using JOINS
    The plus
    Very large amount of data 
    Similar to Nested selects - when the accesses are planned by the programmer 
    In some cases the fastest 
    Not so memory critical 
    The minus
    Very difficult to program/understand 
    Mixing processing and reading of data not possible 
    Use the selection criteria
    SELECT * FROM SBOOK.                   
      CHECK: SBOOK-CARRID = 'LH' AND       
                      SBOOK-CONNID = '0400'.        
    ENDSELECT.                             
    SELECT * FROM SBOOK                     
      WHERE CARRID = 'LH' AND               
            CONNID = '0400'.                
    ENDSELECT.                              
    Use the aggregated functions
    C4A = '000'.              
    SELECT * FROM T100        
      WHERE SPRSL = 'D' AND   
            ARBGB = '00'.     
      CHECK: T100-MSGNR > C4A.
      C4A = T100-MSGNR.       
    ENDSELECT.                
    SELECT MAX( MSGNR ) FROM T100 INTO C4A 
    WHERE SPRSL = 'D' AND                
           ARBGB = '00'.                  
    Select with view
    SELECT * FROM DD01L                    
      WHERE DOMNAME LIKE 'CHAR%'           
            AND AS4LOCAL = 'A'.            
      SELECT SINGLE * FROM DD01T           
        WHERE   DOMNAME    = DD01L-DOMNAME 
            AND AS4LOCAL   = 'A'           
            AND AS4VERS    = DD01L-AS4VERS 
            AND DDLANGUAGE = SY-LANGU.     
    ENDSELECT.                             
    SELECT * FROM DD01V                    
    WHERE DOMNAME LIKE 'CHAR%'           
           AND DDLANGUAGE = SY-LANGU.     
    ENDSELECT.                             
    Select with index support
    SELECT * FROM T100            
    WHERE     ARBGB = '00'      
           AND MSGNR = '999'.    
    ENDSELECT.                    
    SELECT * FROM T002.             
      SELECT * FROM T100            
        WHERE     SPRSL = T002-SPRAS
              AND ARBGB = '00'      
              AND MSGNR = '999'.    
      ENDSELECT.                    
    ENDSELECT.                      
    Select … Into table
    REFRESH X006.                 
    SELECT * FROM T006 INTO X006. 
      APPEND X006.                
    ENDSELECT
    SELECT * FROM T006 INTO TABLE X006.
    Select with selection list
    SELECT * FROM DD01L              
      WHERE DOMNAME LIKE 'CHAR%'     
            AND AS4LOCAL = 'A'.      
    ENDSELECT
    SELECT DOMNAME FROM DD01L    
    INTO DD01L-DOMNAME         
    WHERE DOMNAME LIKE 'CHAR%' 
           AND AS4LOCAL = 'A'.  
    ENDSELECT
    Key access to multiple lines
    LOOP AT TAB.          
    CHECK TAB-K = KVAL. 
    ENDLOOP.              
    LOOP AT TAB WHERE K = KVAL.     
    ENDLOOP.                        
    Copying internal tables
    REFRESH TAB_DEST.              
    LOOP AT TAB_SRC INTO TAB_DEST. 
      APPEND TAB_DEST.             
    ENDLOOP.                       
    TAB_DEST[] = TAB_SRC[].
    Modifying a set of lines
    LOOP AT TAB.             
      IF TAB-FLAG IS INITIAL.
        TAB-FLAG = 'X'.      
      ENDIF.                 
      MODIFY TAB.            
    ENDLOOP.                 
    TAB-FLAG = 'X'.                  
    MODIFY TAB TRANSPORTING FLAG     
               WHERE FLAG IS INITIAL.
    Deleting a sequence of lines
    DO 101 TIMES.               
      DELETE TAB_DEST INDEX 450.
    ENDDO.                      
    DELETE TAB_DEST FROM 450 TO 550.
    Linear search vs. binary
    READ TABLE TAB WITH KEY K = 'X'.
    READ TABLE TAB WITH KEY K = 'X' BINARY SEARCH.
    Comparison of internal tables
    DESCRIBE TABLE: TAB1 LINES L1,      
                    TAB2 LINES L2.      
    IF L1 <> L2.                        
      TAB_DIFFERENT = 'X'.              
    ELSE.                               
      TAB_DIFFERENT = SPACE.            
      LOOP AT TAB1.                     
        READ TABLE TAB2 INDEX SY-TABIX. 
        IF TAB1 <> TAB2.                
          TAB_DIFFERENT = 'X'. EXIT.    
        ENDIF.                          
      ENDLOOP.                          
    ENDIF.                              
    IF TAB_DIFFERENT = SPACE.           
    ENDIF.                              
    IF TAB1[] = TAB2[].  
    ENDIF.               
    Modify selected components
    LOOP AT TAB.           
    TAB-DATE = SY-DATUM. 
    MODIFY TAB.          
    ENDLOOP.               
    WA-DATE = SY-DATUM.                    
    LOOP AT TAB.                           
    MODIFY TAB FROM WA TRANSPORTING DATE.
    ENDLOOP.                               
    Appending two internal tables
    LOOP AT TAB_SRC.              
      APPEND TAB_SRC TO TAB_DEST. 
    ENDLOOP
    APPEND LINES OF TAB_SRC TO TAB_DEST.
    Deleting a set of lines
    LOOP AT TAB_DEST WHERE K = KVAL. 
      DELETE TAB_DEST.               
    ENDLOOP
    DELETE TAB_DEST WHERE K = KVAL.
    Tools available in SAP to pin-point a performance problem
    The runtime analysis (SE30)
    SQL Trace (ST05)
    Tips and Tricks tool
    The performance database
    Optimizing the load of the database
    Using table buffering
    Using buffered tables improves the performance considerably. Note that in some cases a stament can not be used with a buffered table, so when using these staments the buffer will be bypassed. These staments are:
    Select DISTINCT 
    ORDER BY / GROUP BY / HAVING clause 
    Any WHERE clasuse that contains a subquery or IS NULL expression 
    JOIN s 
    A SELECT... FOR UPDATE 
    If you wnat to explicitly bypass the bufer, use the BYPASS BUFFER addition to the SELECT clause.
    Use the ABAP SORT Clause Instead of ORDER BY
    The ORDER BY clause is executed on the database server while the ABAP SORT statement is executed on the application server. The datbase server will usually be the bottleneck, so sometimes it is better to move thje sort from the datsbase server to the application server.
    If you are not sorting by the primary key ( E.g. using the ORDER BY PRIMARY key statement) but are sorting by another key, it could be better to use the ABAP SORT stament to sort the data in an internal table. Note however that for very large result sets it might not be a feasible solution and you would want to let the datbase server sort it.
    Avoid ther SELECT DISTINCT Statement
    As with the ORDER BY clause it could be better to avoid using SELECT DISTINCT, if some of the fields are not part of an index. Instead use ABAP SORT + DELETE ADJACENT DUPLICATES on an internal table, to delete duplciate rows.
    http://www.erpgenie.com/abap/performance.htm
    http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
    http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm
    for any clarifiaction pls mail me.
    pls reward points, if this helped u.
    regards,
    anversha.
    [email protected]

Maybe you are looking for

  • File to RFC Error com.sap.engine.interfaces.messaging.api.exception.Messagi

    Hi , I am doing File to RFC  Scenario. My file get picked and I able to view the audit log under RWB message monitoring. Here I am getting the error u201CTransmitting the message to endpoint dest://XI_INTEGRATION_SERVER using connection File_http://s

  • Slideshow with Text and Music

    I am not sure what program (if any) will do this. We need to make a presentation .... photos, with some text and music. I know you can do the slideshow in iphoto.....with music...but not sure about the text portion. Any advice or pointers would be GR

  • Connection to ipod s

    Hi I've seen similar questions on the forum, but not quite the same. We are about to purchase a new car (VW Golf) and it comes with a slot/cradle for ipods. Very handy if you have an ipod - we don't! Does anyone know of any adaptors to connect to the

  • Automatic Service purchase requisiton from sales order

    Gurus, We have a business scenario where , service purchase requsition needs to be created automatically from a sales order. Could you please let us know whether anybody has worked on this scenario ? Kindly also suggest if any workaround can make thi

  • Indesign cc14 - quotation marks won't change to regular.

    My quotation marks won't change to regular marks my document has french quotation marks : << >> and i need the regular ones. " " i already checked the preferences / dictionary, but they're already set to regular.