Need urgrnt Help in sechduiling Agreement

Dear SAP guru
                         I have maintained sechduiling agreement for a material I(with type 2).I have put the requirement in MD61.I have maintained the delivery time in material amster. Say that I have given the requirement on 24t/08/2011/25/08/2011,30-08-2011, as 45, 55,70 respectively. I have maintained the fixed lot sizes and safety stocks also. when I run MRP i am expecting the system should create the sechduiling agrrement for the date  24, 25, 30/08/2011, but in ME38 in delivery sechdule all it is displaying the same  date as 27/08/2011.
Please help me
Bhupendra Singh
09971435349
Edited by: Bhupendrasingh on Aug 23, 2011 2:11 PM

Checke the GR processing time field value, may that has to be corrected to get the schedules correctly.

Similar Messages

  • Problem with subroutine- need urgrnt help

    hai all,
    need help in subroutine.
    in a report program,
    i had calculated to get the total collection amount and need to generate a list for every day.
    on next day that collection amount must come as a poeninig balance at the top of the list.
    this i had done using two subroutines.
    i have to call the subroutine for opening balance for previous day's collection  first.  after that in have to calculate the todays collection.
    how can i have this please give me a suggession.
    thanks in advance.
    this is my report.
    i want the 'Progressive Total C/O ' from subroutine form f002_item_data. of today to be come in
    'Progressive Total B/F -
    ' ,106 w_total_bf.  of  the  subroutine form f001_progressive_total on next day..
    here is the code.....
    *& Report  ZVR023_COLL_STATEMENT                                       *
    report  zvr023_coll_statement           no standard page heading        .
          MODULE. MSD                                              *
          Objective :                                                   *
          Program   : Updates Tables (   )    Downloads data (  )       *
                      Outputs List   ( X  )                             *
          Date Created                                                  *
          Author                                                *
          Location                                                      *
          LDB                .....                                      *
          External Dependencies                                         *
    Amendment History                                                  *
    Who        Change ID    Reason                                      *
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯                                     *
    XXXXXXXXX  AADDMMYYYY Where XXXX = Developers Name................. *
               AA- Developers Initial ................................  *
          Includes                                                      *
    *INCLUDE   :                                                           *
          Tables                                                        *
    tables   : vbak,bsid,kna1,t001,adrc,vbrk,knvv.
          Types                    Begin with TY_                       *
    types : begin of ty_cust,
            belnr type bseg-belnr,
            wrbtr type bseg-wrbtr,
            xref1 type bseg-xref1,
            kunnr type kna1-kunnr, " sarang
            bschl type bseg-bschl,
            hkont type bseg-hkont,
            end of ty_cust.
    types : begin of ty_bp,
            kunnr type vbak-kunnr,
            bukrs type bseg-bukrs,
            budat type bkpf-budat,
            end of ty_bp.
    types : begin of ty_kna1,
            kunnr type kna1-kunnr,
            name1 type kna1-name1,
            ort01 type kna1-ort01,
            end of ty_kna1.
    types   : begin of ty_lst,
              vbeln      type vbrk-vbeln,                          " INVOICE NO
              fkart      type vbrk-fkart,
              posnr      type vbrp-posnr ,
              fkimg      type vbrp-fkimg ,                         " qty
              fkdat      type vbrk-fkdat,                          " date
              vkorg      type vbrk-vkorg,                          " sales org
              vtweg      type vbrk-vtweg,                          " division
              spart      type vbrk-spart,                          " distribution
              knumv      type vbrk-knumv,                          " Number of the document condition
              matnr      type vbrp-matnr ,
              med_prod   type jptmg0-med_prod,
              kunrg      type vbrk-kunrg,
              kwert      type konv-kwert,
              kbetr      type konv-kbetr,
              netwr      type vbrk-netwr,
    Address Details
             KUNRG type vbrk-KUNRG,
              name1      type kna1-name1,
              stras      type kna1-stras,
              pstlz      type kna1-pstlz,
    ***Added For Billing
             bukrs       type vbrk-bukrs,                          " Company code
             xblnr       type vbrk-xblnr,                          " Bill Ref
             ismpublication type mara-ismpublication,
    Condition Type
             kschl_zj01  type konv-kschl,
             kschl_zdis  type konv-kschl,
             kschl_znet  type konv-kschl,
             kwert_zj01  type konv-kawrt,                          " Base Condition
             kwert_zdis  type konv-kawrt,
             kwert_znet  type konv-kawrt,
             adrnr  type kna1-adrnr,
             end of ty_lst.
    types   : begin of ty_lst1,
              vbeln      type vbrk-vbeln,                          " INVOICE NO
              fkart      type vbrk-fkart,
              fkdat      type vbrk-fkdat,                          " date
              fkimg      type vbrp-fkimg,                          " qty
              kunrg      type vbrk-kunrg,                          " Payer
              fkimg_1    type vbrp-fkimg,                          " qty
              fkimg_2    type vbrp-fkimg,                          " qty
              fkimg_3    type vbrp-fkimg,                          " qty
              fkimg_4    type vbrp-fkimg,                          " qty
              fkimg_5    type vbrp-fkimg,                          " qty
              matnr      type vbrp-matnr,
              med_prod   type jptmg0-med_prod,
              kwert      type konv-kwert,
              kbetr      type konv-kbetr,
              netwr      type vbrk-netwr,
    Address Details
            KUNRG      type vbrk-KUNRG,
              name1      type kna1-name1,
              stras      type kna1-stras,
              pstlz      type kna1-pstlz,
    ***Added For Billing
             bukrs type vbrk-bukrs ,
             xblnr type vbrk-xblnr,
             ismpublication type mara-ismpublication,
    ****SPLIT FOR RATE
             kbetr_1   type   konv-kbetr,
             kbetr_2   type   konv-kbetr,
             kbetr_3   type   konv-kbetr,
    Condition Type
             kschl_zj01 type konv-kschl,
             kschl_zdis type konv-kschl,
             kschl_znet type konv-kschl,
             kwert_zj01 type konv-kawrt,                          " Base Condition
             kwert_zdis type konv-kawrt,
             kwert_znet type konv-kawrt,
             end of ty_lst1.
    types   : begin of ty_condition,
              kschl type konv-kschl,                                " Condition Type
              kwert type konv-kwert,                                " Condition Value
              knumv type konv-knumv,                                " Document Condi
              kposn type konv-kposn,
              kbetr type konv-kbetr,                                " Condition Rate
              end of ty_condition.
    types : begin of ty_bkpf ,
    belnr type bkpf-belnr,
    gjahr type bkpf-gjahr,
    bukrs type bkpf-bukrs,
    end of ty_bkpf.
          Constants                Begin with C_                        *
    *CONSTANTS:                                                            *
          Data                     Begin with W_                        *
    data     : w_cnt type i .
    *DATA     : W_DMBTR  TYPE BSID-DMBTR.   " Open Value
    *DATA     : W_KWERT TYPE  VBRP-FKIMG.   " Invoice Value
    *DATA     : W_QTY_CON TYPE  VBRP-FKIMG.   " QTY
    *DATA     : W_TO_QTY_CON TYPE  VBRP-FKIMG.   " QTY
    *DATA     : W_DIFF TYPE  BSID-DMBTR.   " W_DIFF Bt Open & Invoice
    *DATA     : W_DMBTR_CR  TYPE BSID-DMBTR.   " Cr Value
    *DATA     : W_DMBTR_DR  TYPE BSID-DMBTR.   " Dr Value
    *DATA     : W_DMBTR_TO  TYPE BSID-DMBTR.   " Total Value
    *DATA :     W_KDGRP(2) .
    *DATA  :    W_CNT_IS TYPE I.
    *DATA  :    W_CNT_IS1 TYPE I.
    *DATA  :    W_CNT_IS2 TYPE I.
    *DATA  :    W_CNT_FIRST TYPE I.
    *DATA  :    W_CNT_ITAB TYPE I.
    *DATA  :    W_CNT_FIRST1(2).
    *DATA  :    W_CNT_TAB(62),
              W_CNT_TAB_HEA(62),
    *data:           W_CNT_POS TYPE I.
    Variable for balance window
    data : w_open_bal type dmshb_x8,
           w_total_bf type dmshb_x8,
           w_sub_tot  type dmshb_x8,
           w_total_co type dmshb_x8,
           w_bill_bal type dmshb_x8,
           w_drn_bal type dmshb_x8,
           w_othr_chr type dmshb_x8,
           w_total_bal type dmshb_x8,
           w_coll_bal type dmshb_x8,
           w_unsd_cr  type  dmshb_x8, "Unsold Credit
           w_inceve  type  dmshb_x8, "Incentive
           w_cr_nt   type  dmshb_x8. "Cr Note
    data     : w_pos  type bseg-wrbtr.   " Total Value
    data     : w_neg  type bseg-wrbtr.   " Total Value
    data : w_du_start_date like sy-datum,
           w_du_end_date like sy-datum .
    **vARIABLE DEFINED FOR CONSOLIDATED WINDOW
    data    : w_prod_cnt type i .
    data    : w_prod_ch(2)  .
    data    : w_prod_rate type i .
          Infotypes                   ( HR Module Specific)             *
    *INFOTYPES :                                                           *
          Internal tables          Begin with IT_                       *
    data : it_bp type table of ty_bp with header line,
           it_bp1 type table of ty_bp with header line,
           it_bp2 type table of ty_bp with header line,
           it_bp3 type table of ty_bp with header line,
           it_kna1 type table of ty_kna1 with header line,
           it_cust type table of ty_cust with header line,
           it_cust1 type table of ty_cust with header line,
           it_bkpf type table of ty_bkpf with header line,
           it_cust2 type table of ty_cust with header line,
           it_cust3 type table of ty_cust with header line.
    data : it_pos like rfposxext occurs 1 with header line,
    it_check like rfposxext occurs 1 with header line,
    it_pos_bc1 like rfposxext occurs 1 with header line,
    it_pos_bc like rfposxext occurs 1 with header line,
    it_pos_nc like rfposxext occurs 1 with header line,
           it_pos1 like rfposxext occurs 1 with header line,
           it_sec like rfposxext occurs 1 with header line.
    data : it_bal like rfposxext occurs 1 with header line.
    data : w_text(100) type c.
    data : w_cnt1(3).
    data : l_date like mara-ismpublperiod .
    data : p_date1 like  jkpaz-jkpavon.
    data : l_day_c(2).
    data : l_month_c(2).
    data : l_base_yr_c(4).
    data : w_text1(100) type c.
    data : w_text2(100) type c.
          Field Symbols            Begin with FS_                       *
    *FIELD-SYMBOLS:                                                        *
    field-symbols:  type ty_condition.
          Insert                                                        *
    *INSERT   :                                                            *
          Select Options          Begin with SO_                        *
    selection-screen skip 1.
    selection-screen:  begin of block b1 with frame title text-001.
    select-options  :  so_bukrs for vbrk-bukrs no intervals no-extension obligatory  .
    select-options  :  so_kunrg for vbrk-vkorg no intervals no-extension obligatory,
                       so_vkbur for knvv-vkbur no intervals no-extension ,
                       so_fkdat for bsid-budat  no-extension obligatory ,
                       so_bdat1 for bsid-budat  no-display ,
                       so_bdat3 for bsid-budat  no-display ,
                       so_kunnr for kna1-kunnr no-display.
    selection-screen:  end of block b1.
          Parameters              Begin with PR_                        *
    *PARAMETERS     :                                                      *
    selection-screen begin of block b3 with frame title text-003.
    parameters pr_3 radiobutton group rad1.
    parameters pr_4 radiobutton group rad1.
    selection-screen end of block b3.
    selection-screen begin of block b2 with frame title text-002.
    parameters pr_1 radiobutton group rad.
    parameters pr_2 radiobutton group rad.
    selection-screen end of block b2.
    *INITIALISATION   :
          At selection-screen                                           *
    *AT SELECTION-SCREEN.
          S T A R T   O F   S E L E C T I O N                           *
    start-of-selection.
      if pr_3 is not initial.
    Code commented/added by Praveen on 20.07.2006
       SELECT kunnr INTO CORRESPONDING FIELDS OF TABLE it_bp1 FROM knvv
                                       WHERE vkorg IN so_kunrg
                                         AND kunnr GE '0004000000'
                                         AND kunnr LE '0004999999'.
        select kunnr into corresponding fields of table it_bp1 from knvv
                                        where vkorg in so_kunrg
                                          and aufsd <> '01'
                                          and kunnr ge '0004000000'
                                          and kunnr le '0004999999' .
                                         and
                                         PLTYP ne 'HB'.
    *ends here
      endif.
      if pr_4 is not initial.
        clear so_kunnr[].
        clear so_kunnr.
        so_kunnr-sign = 'I'.
        so_kunnr-option = 'BT'.
        so_kunnr-low =  '0001000000'.
        so_kunnr-high = '0001999999'.
        append so_kunnr.
        so_kunnr-sign = 'I'.
        so_kunnr-option = 'BT'.
        so_kunnr-low =  '0002000000'.
        so_kunnr-high = '0002999999'.
        append so_kunnr.
        so_kunnr-sign = 'I'.
        so_kunnr-option = 'BT'.
        so_kunnr-low =  '0007000000'.
        so_kunnr-high = '0007999999'.
        append so_kunnr.
    Code commented/added by Praveen on 20.07.2006
        select kunnr into corresponding fields of table it_bp1 from knvv
                                        where vkorg in so_kunrg and
                                            kunnr in so_kunnr and
                                            vkbur in so_vkbur.
                                       AND kunnr GE '0001000000'
                                       AND kunnr LE '0001999999'   .
        select kunnr into corresponding fields of table it_bp1 from knvv
                                           where vkorg in so_kunrg and
                                               aufsd <> '01' and
                                               kunnr in so_kunnr and
                                               vkbur in so_vkbur.
                                       AND kunnr GE '0001000000'
                                       AND kunnr LE '0001999999'   .
    ends here
      endif.
      if pr_1 = 'X'.
        perform cust_prog.
        perform cust_line.
        perform f001_progressive_total.
        perform f002_item_data.
      elseif pr_2 = 'X'.
        perform cust_line.
        perform f002_item_data.
      endif.
    *&      Form  cust_prog
          text
    form cust_prog.
      clear it_bp3[].
      p_date1 = so_fkdat-low.
      call function 'Z_VF053_DATE_GET_YEAR_MONTH'
        exporting
          i_date  = p_date1
        importing
          e_dd    = l_day_c
          e_month = l_month_c
          e_year  = l_base_yr_c.
      ranges so_bdat2 for bsid-budat.
      clear : so_bdat3[].
      if l_day_c > 01.
        l_day_c = '01'.
        concatenate   l_base_yr_c l_month_c l_day_c     into l_date.
        so_bdat2-low = l_date.
        so_bdat2-high = so_fkdat-low - 1.
      else.
        so_bdat2-low = '00000000'.
        so_bdat2-high = '00000000'.
      endif.
      so_bdat2-sign = 'I'.
      so_bdat2-option = 'BT'.
      append so_bdat2 to so_bdat3.
      select kunnr bukrs budat into corresponding fields of table it_bp3 from bsid
                                         for all entries in it_bp1
                                         where bukrs in so_bukrs
                                           and kunnr = it_bp1-kunnr
                                           and budat in so_bdat3.
    select kunnr bukrs budat
    appending corresponding fields of table it_bp3
    from bsad
    for all entries in it_bp1
    where bukrs in so_bukrs
    and kunnr = it_bp1-kunnr
    and budat in so_bdat3.
      sort it_bp3 by kunnr .
      delete adjacent duplicates from it_bp3 comparing kunnr.
      sort it_bp3 by kunnr .
      clear w_total_bf.
    endform.                    "cust_prog
    *&      Form  cust_line
          text
    form cust_line.
      clear it_bp[].
      select kunnr bukrs budat
      into corresponding fields of table it_bp
      from bsid
      for all entries in it_bp1
      where bukrs in so_bukrs
      and kunnr = it_bp1-kunnr
      and budat in so_fkdat.
      select kunnr bukrs budat
      appending corresponding fields of table it_bp
      from bsad
      for all entries in it_bp1
      where bukrs in so_bukrs
      and kunnr = it_bp1-kunnr
      And budat in so_fkdat.
      sort it_bp by kunnr .
      delete adjacent duplicates from it_bp comparing kunnr.
      sort it_bp by kunnr .
    endform.                    "cust_line
    *&      Form  f001_progressive_total
          text
    form f001_progressive_total.
      if not it_bp3[] is initial.
        clear : w_text ,w_cnt,p_date1,l_base_yr_c, l_month_c,l_day_c,l_date.
       w_cnt1 = sy-tabix .
       CONCATENATE w_cnt1 '  Feaching Data  '  INTO w_text.
       CALL FUNCTION 'SAPGUI_PROGRESS_INDICATOR'
         EXPORTING
           text = w_text.
        ranges so_bdat2 for bsid-bldat.
        clear : so_bdat1[].
        p_date1 = so_fkdat-low.
        call function 'Z_VF053_DATE_GET_YEAR_MONTH'
          exporting
            i_date  = p_date1
          importing
            e_dd    = l_day_c
            e_month = l_month_c
            e_year  = l_base_yr_c.
        if l_day_c > 01.
          l_day_c = '01'.
          concatenate   l_base_yr_c l_month_c l_day_c     into l_date.
          so_bdat2-low = l_date.
          so_bdat2-high = so_fkdat-low - 1.
        else.
          l_day_c = so_fkdat-low.
          so_bdat2-low = l_date.
          so_bdat2-high = '00000000'.
        endif.
        so_bdat2-sign = 'I'.
        so_bdat2-option = 'BT'.
        append so_bdat2 to so_bdat1.
        export so_bdat1 to memory id 'DATE1'.
        export it_bp3 to memory id 'IT_BP3'.
        clear : so_bdat1, it_bp3.
        submit  z_rfitemar1
                with x_aisel = 'X'
                with x_norm = 'X'
                with dd_bukrs-low = so_bukrs-low                "#EC *
                and return.
        clear : it_pos[], it_pos .
        import it_pos from memory id 'zit_pos'.
        free memory id 'zit_pos'.
        delete it_pos where blart <> 'DZ'.
    Here Plz Clear all the varible to avoid overlap
        clear : w_open_bal,w_du_start_date,w_du_end_date.
        select belnr bukrs gjahr into corresponding fields of table it_bkpf
        from bkpf  for all entries in it_pos where belnr = it_pos-belnr and gjahr = it_pos-gjahr
    and bukrs = it_pos-bukrs and xreversal = ' '.
    endif.
        loop at it_pos.
          clear it_bkpf.
          read table it_bkpf with key bukrs = it_pos-bukrs belnr = it_pos-belnr gjahr = it_pos-gjahr.
          if sy-subrc eq 0.
            append it_pos to it_check.
          endif.
        endloop.
        it_pos[] = it_check[].
    ***opening bal
    since runtime error is coming while summing the alternate way is being used ... done by jayakumar on 11 10 06
       LOOP AT it_pos .
         SUM .
         w_open_bal = it_pos-dmshb .
         EXIT .
       ENDLOOP .
        loop at it_pos .
       read table it_cust3 with key belnr = it_pos-belnr.
       it_pos-dmshb = it_cust3-wrbtr.
          w_open_bal = w_open_bal + it_pos-dmshb .
        endloop .
        if w_open_bal < 0 .
          w_open_bal = w_open_bal * -1.
        endif.
        w_total_bf = w_total_bf + w_open_bal.
    endif.
      write :20 'Progressive Total B/F -
    ' ,106 w_total_bf.
      skip 1 .
    endform.                    "f001_progressive_total
    *&      Form  f002_item_data
          text
    form f002_item_data.
      if not it_bp[] is initial.
        select * into corresponding fields of table it_kna1 from kna1
                              for all entries in it_bp
                              where kunnr = it_bp-kunnr .
        export so_fkdat to memory id 'DATE'.
        export it_bp to memory id 'IT_BP'.
        clear : so_fkdat, it_bp.
        submit  z_rfitemar1
                with x_aisel = 'X'
                with x_norm = 'X'
                with dd_bukrs-low = so_bukrs-low                "#EC *
                and return.
       DELETE it_pos WHERE u_xreversal <> ' '.
        clear : it_pos[], it_pos .
        import it_pos from memory id 'zit_pos'.
        free memory id 'zit_pos'.
        delete it_pos where blart <> 'DZ'.
        sort it_pos by belnr.
       APPEND LINES OF it_pos TO it_pos1.
       DELETE ADJACENT DUPLICATES FROM it_pos COMPARING belnr." commented by sarang
        clear : it_cust[], it_cust.
        if not it_pos[] is initial.
          select belnr wrbtr xref1 kunnr bschl 
          into corresponding fields of table it_cust
          from bseg
          for all entries in it_pos
          where belnr = it_pos-belnr
          and bukrs = it_pos-bukrs
          and gjahr = it_pos-gjahr
          and bschl in ('15','40') . 
         it_cust2[] = it_cust[].
          delete it_cust where bschl ne 15.
          delete it_cust2 where bschl ne 40.
          sort it_pos by konto.
        else.
          write : 20 '**No Transaction to Display**'.
        endif.
       DELETE it_pos WHERE u_xreversal = 'X'.
        tables bkpf.
        loop at it_pos.
          select single  * from bkpf where belnr = it_pos-belnr and bukrs = it_pos-bukrs and gjahr = it_pos-gjahr and xreversal = ' '.
          if sy-subrc = 0.
            append it_pos to it_pos_bc1.
          endif.
        endloop.
        clear it_pos.
        it_pos[] = it_pos_bc1[].
        sort it_pos by konto belnr xref3.
        loop at it_pos.
          read table it_cust2 with key belnr = it_pos-belnr.
          on change of it_pos-konto or "IT_CUST2-xref1 or
          it_pos-belnr.
            it_pos_bc[] = it_pos[].
            delete it_pos_bc[] where konto ne it_pos-konto.
            delete it_pos_bc[] where belnr ne it_pos-belnr.
            loop at it_pos_bc.
              sum.
              exit.
            endloop.
            append it_pos_bc to it_pos_nc.
          endon.
        endloop.
        free it_pos.
        it_pos[] = it_pos_nc[].
        data : w_amt1 type bseg-dmbtr,
              w_amt2 type bseg-dmbtr.
        clear : w_amt1 , w_amt2.
        sort it_pos by budat belnr konto.
        data : w_ch(5) type c,
               w_i type i.
        w_i = 0.
        loop at it_pos where shkzg = 'H' .
          clear w_text.
          w_i = w_i + 1 .
          w_ch = w_i.
          read table it_cust with key belnr = it_pos-belnr  kunnr = it_pos-konto.
          read table it_kna1 with key kunnr = it_pos-konto .
         CONCATENATE it_kna1-name1 INTO w_text.
          w_text = it_kna1-name1.
         CONDENSE w_text NO-GAPS.
          write : / w_ch left-justified  , 07 it_pos-budat ,20 it_pos-belnr(10) ,31 it_pos-konto(10),42 w_text(60).
          read table it_cust2 with key belnr = it_pos-belnr.
          if it_cust2-xref1 = 'Cash Payment' or it_cust2-xref1 = 'Cash'.
            if it_pos-dmshb < 0 .
             it_pos-dmshb = it_pos-dmshb * -1 .
              it_pos-dmshb = it_cust2-wrbtr.
            else.                              "+PM28072006
             it_pos-dmshb = it_pos-dmshb * -1 . "+PM28072006
              it_pos-dmshb = it_cust2-wrbtr.
            endif.
            write : 72 it_pos-dmshb.
            w_amt1 = w_amt1 + it_pos-dmshb.
          else.
            if it_pos-dmshb < 0 .
             it_pos-dmshb = it_pos-dmshb * -1 .
               it_pos-dmshb = it_cust2-wrbtr.
            else.                            "+PM28072006
             it_pos-dmshb = it_pos-dmshb * -1."+PM28072006
              it_pos-dmshb = it_cust2-wrbtr.
            endif.
            write : 87  it_pos-dmshb.
            w_amt2 = w_amt2 + it_pos-dmshb.
          endif .
        endloop .
      else.
        write : 20 '**No Transaction to Display**'.
      endif.
      clear : it_cust1[] ,w_pos .
      it_cust1[] = it_cust[] .
      sort it_cust1 by wrbtr.
      delete it_cust1 where xref1 <> 'Cash Payment' .
      delete it_cust1 where xref1 <> 'Cash' .
      loop at it_cust1.
        sum .
        w_pos = it_cust1-wrbtr .
        exit .
      endloop .
      clear :it_cust1[],w_neg .
      it_cust1[] = it_cust[] .
      sort it_cust1 by wrbtr.
      delete it_cust1 where xref1 = 'Cash Payment' .
      delete it_cust1 where xref1 = 'Cash' .
      loop at it_cust1.
        sum .
        w_neg = it_cust1-wrbtr .
        exit .
      endloop .
      if w_pos < 0.
        w_pos = w_pos * -1 .
      else.                 "+PM28072006
        w_pos = w_pos * -1. "+PM28072006
      endif.
      if w_neg < 0.
        w_neg = w_neg * -1 .
      else.                 "+PM28072006
        w_neg = w_neg * -1. "+PM28072006
      endif.
      write sy-uline(125) .
      write : /20 'Total Collection Amount -
    >'.
      write : 76 w_amt1 ,91 w_amt2.
      w_sub_tot = w_amt1 + w_amt2.
      if w_sub_tot < 0.
        w_sub_tot = w_sub_tot * -1.
      endif.
      write : 106 w_sub_tot.
      if pr_1 = 'X'.
        w_total_co = w_total_bf + w_sub_tot.
        if w_total_co < 0.
          w_total_co = w_total_co * -1.
        endif.
        write : /20 'Progressive Total C/O -
    >'.
        write : 106 w_total_co.
      endif.
      write sy-uline(125) .
    endform.                    "f002_item_data
         ENDIF .
    *END-OF-SELECTION.
          E N D       O F   S E L E C T I O N                           *
          At line selection                                             *
    *AT LINE-SELECTION.
          User Command Processing                                       *
    *AT USER-COMMAND.
          Top Of Page                                                   *
    top-of-page.
      select single * from t001 where bukrs = so_bukrs-low .
      select single * from adrc where addrnumber = t001-adrnr . "EC *
      write : /05  t001-butxt.
    CONCATENATE adrc-house_num1 '-' adrc-street INTO w_text1.
    CONCATENATE adrc-city1 '-' adrc-post_code1 INTO w_text2.
    WRITE : /05  w_text1 .
    WRITE : /05  w_text2 .
      write : /05  'Sales Organisation:', so_kunrg-low.
      write : /05  'Sales Office:', so_vkbur-low.
      skip 1.
      if pr_3 = 'X'.
        write : /05 'Agent Circulation Collection Statement From ' , so_fkdat-low , ' to ' ,so_fkdat-high .
      else.
        write : /05 'Advertisement  Collection Statement From ' , so_fkdat-low , ' to ' ,so_fkdat-high .
      endif.
      if pr_3 = 'X'.
        write  :/ sy-uline(125) .
        write :/07 'Date' ,20 'Doc No',31 'Code' ,42 'Agent Name & Place',84 'BY CASH' ,97 'BY CHQ/DD' ,115 'Prog. Total'.
        write  :/ sy-uline(125) .
      else.
       write  :/ sy-uline(125) .
       write :/07 'Date' ,20 'Doc No',31 'Code' ,42 'Advertisers Name' ,  84 'BY CASH' ,97 'BY CHQ/DD' ,115 'Prog. Total'.
       write  :/ sy-uline(125) .
      endif .
          End Of Page                                                   *
    END-OF-PAGE.END-OF-PAGE.

    Hello Selvi
    There is no need to use two subroutine. Actually, this would be bad programming. Instead use a switch for your subroutine which determines whether the calculation should be done for the actual and the previous day, e.g.:
    PERFORM do_calculation
                                     USING 'X'          " 'X' = calculate for previous day as well
                                     USING p_date   " current date
                              CHANGING gt_list.   " itab with list data
    And that's how the subroutine could look like:
    FORM do_calculation
                             USING VALUE(ud_calculate_previous_day)  TYPE c
                                        VALUE(ud_date)                             TYPE d
                      CHANGING ct_list    TYPE <table type>.
    * define local data
      DATA:
         ld_date_prev  TYPE d,
         lt_list_prev     TYPE <table type>.  " list for previous day
    * Do the calculations for the current day
      IF ( ud_calculate_previous_day = 'X' ).
        ld_date_prev = ud_date - 1.
        PERFORM do_calculation
                                         USING ' '  " ' ' = no calculation for previous day
                                                    ld_date_prev
                                  CHANGING lt_list_prev.   " itab with list data
      ENDIF.
    * Post-processing after calculation for both days
    ENDFORM.
    Regards
      Uwe

  • I need urgrnt help in working with JasperReports

    I just want to know how can I pass a query to a JasperReport. I've just gone thru the JasperReports.sourceforge.net but couldn't make it. Please if someone can make it.
    Thanx for the interest.

    Well if you have looked at a sample JRXML file (it is the begining point for generating a report using JasperReports), that comes with the JasperReports, you will see the query (with in <queryString> </queryString> tags).
    One such sample file I have come across is under %JasperReports Home%/demo/samples/query/QueryReport.jrxml

  • I'm hoping to buy a ipad air or ipad mini 2 to read PDFs, which one is the best....???? (need a help)

    I'm hoping to buy a ipad air or ipad mini 2 to read PDFs, which one is the best....????
    (need a help)

    I agree with Ralph. It all depends on what you're comfortable reading on.
    Most retailers have demo devices, go to a store and play with them and see which one works best for you

  • I need your help, I also like to make friends

    In hangzhou, zhejiang province, I come from China, I was able to visit here because of my cell phone was locked.I need a SIM unlocked, I'm not sure I'm youdao translation is correct, but I am a very sincere need your help.
    What happened is that one of my friends in the United States from the United States back to a local on the iphone.After I received very happy, but it has a lock.My mood fell the bottom, after a period of time trying to find the answer I will come to verizon's official website, to look not to understand a foreign language Chinese friends, this is very difficult.
    I want to see this post you the friend can help me, can see the official friends??
    I can't to the United States, my friend is no longer the United States for the time being.So can only rely on you.I don't have your official phone CARDS, even if have also used in China.How could you let me sad!!!!!!!!!!!
    For the Chinese New Year is coming soon, in China is equivalent to you Christmas.I hope my New Year's to receive this gift.
    Private info removed as required by the Terms of Service.
    Message was edited by: Admin Moderator

    Sorry I don't speak or read Chinese but you cannot unlock the iPhone connected to Verizon Wireless unless its active on verizon. After a certain number of months the device can then be unlocked by verizon to use in China.
    Have your friend in the USA activate the iPhone on their account then after awhile it can be unlocked.
    There has recently been an agreement for cell providers to unlock devices easier, and to do it withing a few days. However since it was not made as a rule of law, the providers will skirt around the requirement they agreed to. Very typical of cellular providers.
    Good Luck

  • Basic Output program need some help...Please

    import java.io.*;
    class FileOutputDemo
    public static void main(String args[])
    int one=1, two=2, three=3;
         FileOutputStream out; // declare a file output object
         PrintStream p; // declare a print stream object
         try
              // Create a new file output stream
              // connected to "myfile.html"
              out = new FileOutputStream("myfile.html");
              // Connect print stream to the output stream
              p = new PrintStream( out );
              p.printf ("This is written to a file %d", one);
              p.close();
         catch (Exception e)
              System.err.println ("Error writing to file");
    }Hello I am new to java, and I hope someone help me to modify the above code in order to make it work as the following:
    I have a list of integer values like 1, 2, 3, 4? 10
    And I want the program to substitute the integer values (the integer declared list) subsequently one by one to output a new html file as the following output:
    This is written to a file 1
    This is written to a file 2
    This is written to a file3 ?etc
    Also this substitution has to be outputted to a new file every time.
    Thank you very much in advance for your kind help
    if i have to post this anywhere else please advise me..
    Adam

    import java.io.*;
    public class FileOutputDemo
        public static void main(String[] args) {
             FileOutputStream out; // declare a file output object
             PrintStream p; // declare a print stream object
             try
                  // Create a new file output stream
                  // connected to "myfile.html"
                  out = new FileOutputStream("myfile.html");
                  p = new PrintStream( out );
                  int[] arrayOfInts = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
                for (int element : arrayOfInts)
                     p.printf (element + " ");
                  p.close();
                  // Connect print stream to the output stream
             catch (Exception e)
                  System.err.println ("Error writing to file");
    }ok .... guys i really understand what do you mean,
    i only need your help to make the program print one integer at a time from the array to a seprate file ....what do you suggest ... any hints
    Thanks

  • Remote App on iPad connects but drops after about  20 mins. Need to turn  off wait about 1 minute then turn on wifi on iMac before it can reconnect. Need some help please.

    Remote App on iPad connects but drops after about  20 mins. Need to turn  off wait about 1 minute, then turn on wifi on iMac before it can reconnect. Need some help please.
    Already gone through troubleshooting guide a zillion times. Thanks.

    This worked for me... A little time consuming but once you get rolling it goes GREAT... Thanks....
    I got my artwork and saved it to my Desktop
    Opened up Microsoft Paint and clicked on "File" and "Open" and found it to get it on the screen to resize it
    Clicked "resize" and a box for changing it opened up
    Checked the box "Pixels" and "Unchecked maintain aspect ratio"
    Set Horizontal for 640 and Vertical for 480
    Clicked on "OK" and went back to "File" and did a "Save As" and chose JPEG Picture
    It came up "File Already Existed" and clicked "OK" (really did not care about the original artwork I found because wrong size)
    Went to iTunes and on the movie right clicked on "Get Info", clicked on "Details", then "Artwork"
    Go to the little box on the top left that shows your old artwork and click on it to get the little blue border to appear around it and hit "Delete" to make it gone
    Click on "Add Artwork" and find it where you put the one from above on your Desktop and hit "Open" and OK and your new artwork is now there and all good.
    Sounds like a lot of steps to follow but after around 5 or so you will fly through it. This worked perfect on my iPhone 6 Plus and I have artwork on my Home Videos now.

  • Need your help in Remodeling concept

    Hi Gurus need your help in time estimations
    I have a cube with data and now I need to add 10 new info objects to the cube which are including Date fields (BUDAT, BLDAT) these 10 fields will be populated to the cube from a Z table in ECC as we donu2019t have these fields in the cube we have to go for remodeling of the cube
    My client requires how much time it will take to complete this
    Now I want to know how much time it would take to do this (if any customer exits and user exits are required) and addition if new fields will have any effect on the current queries
    Please advice in this
    Thank you

    The time taken will depends on a lots of factor like server speed, available memory, background jobs etc. Apart from this, the time will also depends on how much the cube is filled i.e. the no. of records in the cube. Its very abstract to tell you the exact time taken for this. But, please make sure that you have the backup of the cube which you are going to re-model. T0 say, I think 3-4 hours should be ok for the remodelling.
    Thanks.
    Shambhu

  • Need your help on performance issue please

    Hello everyone!
    I need your help to understand an effect I notice with a Thread class I built. I currently work on enhancement of my application Playlist Editor (see http://www.lightdev.com/page74.htm) and a new release will be available soon.
    Among other extensions the new release will have a title filter function which is based on audio data that is recursively read from ID3 tags of files found in a given root directory. The data collection is done by a CollectionThread class which reads into a data model class AudioDataModel and the entire process works fine, no problem with that.
    However, when my application is started for the first time the CollectionThread runs approximately 3 minutes to collect data from approximately 4300 audio files on an Intel Pentium M 1,4 GHz, 512 MB RAM, Windows XP SP2. When the application is shut down and started again, it takes only a few seconds to do the same task for all subsequent launches.
    I already tried to start the application with java option -Xms40m to increase initial heap size. This increases performance in general but the effect is still the same, i.e. first run lasts significantly longer than subsequent runs.
    I also tried to build a pool mechanism which creates many empty objects in the data model and then releases them to contain the actual data at is being read in but this did not lead to better performance.
    It must have to do with how Java (or Windows?) allocates and caches memory. I wonder whether there is a way to pre-allocate memory or if there are any other ideas to improve performance so that the process always only takes seconds instead of minutes?
    I attach the key classes to this message. Any help or ideas is much appreciated!
    Thanks a lot a best regards
    Ulrich
    PS: You can use the news subscription service at
    http://www.lightdev.com/dynTemplate.php4?id=80&dynPage=subscribe.php4 to be informed when the new release of Playlist Editor is available.
    All classes posted here do not need debugging, they already have proven to run error free. The classes are only posted for information for the interested reader - no need to go through all the stuff in detail - only if it interests you.
    My application calls class CollectionThread wich is a subclass of InfoThread. CollectionThread recursively goes through a directory and file structure and stores found ID3 tag information in instances of class ID3v11Tag which in turn gets stored in one instance of class AudioDataModel. All classes are shown below.
    This is the mentioned CollectionThread
    * Light Development Playlist Editor
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.app.playlisteditor.data;
    import com.lightdev.lib.util.InfoThread;
    import java.io.File;
    * A class to collect audio data from a given storage location.
    * <p>
    * <code>CollectionThread</code> uses ID3 tag information to gain data.
    * </p>
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software as well as any licensing notes
    *      inside this documentation
    * @version 1, October 13, 2004
    public class CollectionThread extends InfoThread {
       * constructor
       * @param model  AudioDataModel  the data model to collect data to
      public CollectionThread(AudioDataModel model) {
        this.model = model;
       * constructor, creates a new empty AudioDataModel
      public CollectionThread() {
        this(new AudioDataModel());
       * set the data model to collect data to
       * @param model AudioDataModel  the model to collect data to
      public void setModel(AudioDataModel model) {
        this.model = model;
       * get the data model associated to this thread
       * @return AudioDataModel  the data model
      public AudioDataModel getModel() {
        return model;
       * set the directory to collect data from
       * @param rootDir File  the directory to collect data from
      public void setRootDirectory(File rootDir) {
        this.rootDir = rootDir;
       * do te actual work of this thread, i.e. iterate through a given directory
       * structure and collect audio data
       * @return boolean  true, if work is left
      protected boolean work() {
        boolean workIsLeft = true;
        maxValue = -1;
        filesProcessed = 0;
        if(getStatus() < STATUS_HALT_PENDING) {
          countElements(rootDir.listFiles());
        if(getStatus() < STATUS_HALT_PENDING) {
          workIsLeft = collect(rootDir.listFiles());
        return workIsLeft;
       * count the elements in a given file array including its subdirectories
       * @param files File[]
      private void countElements(File[] files) {
        int i = 0;
        while (i < files.length && getStatus() < STATUS_HALT_PENDING) {
          File file = files;
    if (file.isDirectory()) {
    countElements(file.listFiles());
    i++;
    maxValue++;
    * recursively read data into model
    * @param files File[] the file array representing the content of a given directory
    private boolean collect(File[] files) {
    int i = 0;
    while(i < files.length && getStatus() < STATUS_HALT_PENDING) {
    File file = files[i];
    if(file.isDirectory()) {
    collect(file.listFiles());
    else if(file.getName().toLowerCase().endsWith("mp3")) {
    try {
    model.addTrack(file);
    catch(Exception e) {
    fireThreadException(e);
    i++;
    filesProcessed++;
    fireThreadProgress(filesProcessed);
    return (i<files.length);
    /** the directory to collect data from */
    private File rootDir;
    /** the data model to collect data to */
    private AudioDataModel model;
    /** the number of files this thread processed so far while it is running */
    private long filesProcessed = 0;
    This is class InfoThread
    * Light Development Java Library
    * Copyright (C) 2003, 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.lib.util;
    import java.util.Vector;
    import java.util.Enumeration;
    * Abstract class <code>InfoThread</class> implements a status and listener concept.
    * An <code>InfoThread</code> object actively informs all objects registered as listeners about
    * status changes, progress and possible exceptions. This way the status of a running
    * thread does not require a polling mechanism to be monitored.
    * <p>
    * <code>InfoThread</code> implements the following working scheme
    * </p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software
    * @version Version 1, October 13, 2004
    public abstract class InfoThread extends Thread {
       * construct an <code>InfoThread</code> object
       * <p>This class is meant to be used when a <code>Thread</code> object is needed that actively
       * informs other objects about its status</code>. It is a good idea therefore to register
       * one or more listeners with instances of this class before doing anything
       * else.</p>
       * @see addInfoThreadListener
      public InfoThread() {
       * set the amount of time this thread shall idle after it is through with one
       * work cycle and before a next work cycle is started. This influences the time
       * other threads have for their work.
       * @param millis long  the number of milliseconds to idle after one work cycle
      public void setIdleMillis(long millis) {
        idleMillis = millis;
       * Causes this thread to begin execution; the Java Virtual Machine calls the <code>run</code>
       * method of this thread. Calls method <code>prepareThread</code> before calling
       * <code>run</code>.
       * @see run
       * @see prepareThread
      public synchronized void start() {
        setStatus(STATUS_INITIALIZING);
        prepareThread();
        setStatus(STATUS_READY);
        super.start();
       * call method <code>start</code> instead of this method.
       * calling this method directly will lead to an exception
       * @see start
      public void run() {
        //System.out.println("InfoThread.run");
        if (status == STATUS_READY) {
          boolean workIsLeft = true;
          setStatus(STATUS_RUNNING);
          while (status < STATUS_STOP_PENDING && workIsLeft) {
            if (status < STATUS_HALT_PENDING) {
              workIsLeft = work();
              if(!workIsLeft) {
                setStatus(STATUS_WORK_COMPLETE);
            if (status == STATUS_HALT_PENDING) {
              setStatus(STATUS_HALTED);
            else if (status == STATUS_STOP_PENDING) {
              setStatus(STATUS_STOPPED);
            else {
              try {
                sleep(idleMillis);
              catch (InterruptedException e) {
                fireThreadException(e);
        else {
          // error: Thread is not ready to run
        setStatus(STATUS_THREAD_FINISHED);
       * stop this thread. This will terminate the thread irrevokably. Use method
       * <code>haltThread</code> to pause a thread with the possiblity to resume work later.
       * @see haltThread
      public void stopThread() {
        switch (status) {
          case STATUS_RUNNING:
            setStatus(STATUS_STOP_PENDING);
            break;
          case STATUS_HALT_PENDING:
            // exception: the thread already is about to halt
            break;
          case STATUS_STOP_PENDING:
            // exception: the thread already is about to stop
            break;
          default:
            // exception: a thread can not be stopped, when it is not running
            break;
       * halt this thread, i.e. pause working allowing to resume later
       * @see resumeThread
      public void haltThread() {
        switch (status) {
          case STATUS_RUNNING:
            setStatus(STATUS_STOP_PENDING);
            break;
          case STATUS_HALT_PENDING:
            // exception: the thread already is about to halt
            break;
          case STATUS_STOP_PENDING:
            // exception: the thread already is about to stop
            break;
          default:
            // exception: a thread can not be halted, when it is not running
            break;
       * resume this thread, i.e. resume previously halted work
       * @see haltThread
      public void resumeThread() {
        if(status == STATUS_HALTED || status == STATUS_HALT_PENDING) {
          setStatus(STATUS_RUNNING);
        else {
          // exception: only halted threads or threads that are about to halt can be resumed
       * this is the method to prepare a thread to run. It is not implemented in this abstract
       * class. Subclasses of <code>InfoThread</code> can implement this method to do anything
       * that might be required to put their thread into STATUS_READY. This method is called
       * automatically by method <code>start</code>.  When implementing this method, it should
       * call method <code>fireThreadException</code> accordingly.
       * @see start
       * @see fireThreadException
      protected void prepareThread() {
        // does nothing in this abstract class but might be needed in subclasses
       * this is the main activity method of this object. It is not implemented in this abstract
       * class. Subclasses of <code>InfoThread</code> must implement this method to do something
       * meaningful. When implementing this method, it should call methods
       * <code>fireThreadProgress</code> and <code>fireThreadException</code> accordingly.
       * @return boolean true, if work is left, false if not
       * @see fireThreadProgress
       * @see fireTreadException
      protected abstract boolean work();
       * add an <code>InfoTreadListener</code> to this instance of <code>InfoThread</code>
       * @param l InfoThreadListener  the listener to add
       * @see removeInfoThreadListener
      public void addInfoThreadListener(InfoThreadListener l) {
        listeners.add(l);
       * remove an <code>InfoTreadListener</code> from this instance of <code>InfoThread</code>
       * @param l InfoThreadListener  the listener to remove
      public void removeInfoThreadListener(InfoThreadListener l) {
        listeners.remove(l);
       * notify all <code>InfoThreadListener</code>s of a status change
       * @param fromStatus int  the status tis thread had before the change
       * @param toStatus int  the status this thread has now
      protected void fireThreadStatusChanged(int fromStatus, int toStatus) {
        Enumeration e = listeners.elements();
        while(e.hasMoreElements()) {
          Object l = e.nextElement();
          if(l instanceof InfoThreadListener) {
            ((InfoThreadListener) l).threadStatusChanged(this, fromStatus, toStatus);
       * notify all <code>InfoThreadListener</code>s of an exception in this thread
       * @param ex Exception  the exception that occurred
      protected void fireThreadException(Exception ex) {
        Enumeration e = listeners.elements();
        while(e.hasMoreElements()) {
          Object l = e.nextElement();
          if(l instanceof InfoThreadListener) {
            ((InfoThreadListener) l).threadException(this, ex);
       * notify all <code>InfoThreadListener</code>s of the progress of this thread
       * @param progressValue long  a value indicating the current thread progress
      protected void fireThreadProgress(long progressValue) {
        Enumeration e = listeners.elements();
        while(e.hasMoreElements()) {
          Object l = e.nextElement();
          if(l instanceof InfoThreadListener) {
            ((InfoThreadListener) l).threadProgress(this, progressValue, maxValue);
       * set the status of this thread and notify all listeners
       * @param newStatus int  the status this thread is to be changed to
      private void setStatus(int newStatus) {
        //System.out.println("InfoThread.setStatus oldStatus=" + status + ", newStatus=" + newStatus);
        int fromStatus = status;
        status = newStatus;
        fireThreadStatusChanged(fromStatus, newStatus);
       * get the current status of this thread
       * @return int  the status
      public int getStatus() {
        return status;
       * cleanup before actual destruction.
      public void destroy() {
        //System.out.println("InfoThread.destroy");
        cleanup();
        super.destroy();
       * cleanup all references this thread maintains
      private void cleanup() {
        //System.out.println("InfoThread.cleanup");
        listeners.removeAllElements();
        listeners = null;
      /* ----------------------- class fields start ------------------------ */
      /** storage for the objects this thread notifies about status changes and progress */
      private Vector listeners = new Vector();
      /** indicator for the status of this thread */
      private int status = STATUS_NONE;
      /** maximum value for threadProgress */
      protected long maxValue = -1;
      /** the idle time inside one work cycle in milliseconds */
      protected long idleMillis = 1;
      /* ----------------------- class fields end -------------------------- */
      /* ----------------------- constants start --------------------------- */
      /** constant value indicating that no status has been set so far */
      public static final int STATUS_NONE = 0;
      /** constant value indicating that the thread is currently initializing */
      public static final int STATUS_INITIALIZING = 1;
      /** constant value indicating that the thread is ready to run */
      public static final int STATUS_READY = 2;
      /** constant value indicating that the thread is running */
      public static final int STATUS_RUNNING = 3;
      /** constant value indicating that the thread is about to halt */
      public static final int STATUS_HALT_PENDING = 4;
      /** constant value indicating that the thread is halted */
      public static final int STATUS_HALTED = 5;
      /** constant value indicating that the work of this thread is complete */
      public static final int STATUS_WORK_COMPLETE = 6;
      /** constant value indicating that the thread is about to stop */
      public static final int STATUS_STOP_PENDING = 7;
      /** constant value indicating that the thread is stopped */
      public static final int STATUS_STOPPED = 8;
      /** constant value indicating that the thread is finished */
      public static final int STATUS_THREAD_FINISHED = 9;
      /* ----------------------- constants end --------------------------- */
    }this is the InfoThreadListener interface
    * Light Development Java Library
    * Copyright (C) 2003, 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.lib.util;
    * An interface classes interested to receive events from objects
    * of class <code>InfoThread</code> need to implement.
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software
    * @version Version 1, October 13, 2004
    public interface InfoThreadListener {
       * method to receive a status change notification from a thread
       * @param thread InfoThread  the thread which status changed
       * @param fromStatus int  the status which the thread had before the change
       * @param toStatus int  the status which the thread has now
      public void threadStatusChanged(InfoThread thread, int fromStatus, int toStatus);
       * method to receive a notification about the progress of a thread
       * @param thread InfoThread  the thread which notified about its progress
       * @param progressValue long  the value (e.g. 10 if 100 percent completed, 20 of 1 million files processed, etc.)
      public void threadProgress(InfoThread thread, long progressValue, long maxValue);
       * method to receive a notifiaction about the fact that an exception occurred in a thread
       * @param thread InfoThread  the thread for which an exception occurred
       * @param e Exception  the exception that occurred
      public void threadException(InfoThread thread, Exception e);
    }This is class AudioFileDescriptor
    * Light Development Java Library
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.lib.audio;
    import java.io.FileNotFoundException;
    import java.io.IOException;
    import java.io.RandomAccessFile;
    import java.io.Serializable;
    import java.text.DecimalFormat;
    * This class models characteristics of an audio file such as the absolute path
    * of the file, its tag contents (if any) and the play duration, etc.
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software
    * @version Version 1, October 13, 2004
    public class AudioFileDescriptor implements Serializable, Comparable {
      public AudioFileDescriptor(String absolutePath) throws FileNotFoundException, IOException {
        load(absolutePath);
      public boolean equals(Object o) {
        if(o != null && o instanceof AudioFileDescriptor) {
          return ((AudioFileDescriptor) o).getAbsolutePath().equalsIgnoreCase(this.getAbsolutePath());
        else {
          return false;
      public void load(String absolutePath) throws FileNotFoundException, IOException {
        this.absolutePath = absolutePath;
        RandomAccessFile rf = new RandomAccessFile(absolutePath, "r");
        if(id3v11Tag == null) {
          id3v11Tag = new ID3v11Tag(rf, false);
        else {
          id3v11Tag.readTag(rf, rf.length() - 128);
        rf.close();
      public String getAbsolutePath() {
        return absolutePath;
      public ID3v11Tag getID3v11Tag() {
        return id3v11Tag;
      public void setID3v11Tag(ID3v11Tag tag) {
        this.id3v11Tag = tag;
      public String toString() {
        DecimalFormat df = new DecimalFormat("00");
        return id3v11Tag.getArtist() + ", " + id3v11Tag.getAlbum() + " - " +
            df.format(id3v11Tag.getTrackNumber()) + " " + id3v11Tag.getTitle();
       * Compares this object with the specified object for order.
       * @param o the Object to be compared.
       * @return a negative integer, zero, or a positive integer as this object is less than, equal to,
       *   or greater than the specified object.
       * @todo Implement this java.lang.Comparable method
      public int compareTo(Object o) {
        return toString().compareTo(o.toString());
      private String absolutePath;
      private ID3v11Tag id3v11Tag;
      private transient long duration = -1;
      private transient int type = TYPE_UNKNOWN;
      public static final transient int TYPE_UNKNOWN = 0;
      public static final transient int TYPE_MP3 = 1;
    }This is class ID3V11Tag into which the data is actually stored
    * Light Development Java Library
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.lib.audio;
    import java.io.File;
    import java.io.RandomAccessFile;
    import java.io.IOException;
    import java.io.Serializable;
    import java.text.DecimalFormat;
    * This class is a very simple implementation of an ID3v11Tag. It models an ID3 tag
    * pretty much the same way as it is physically stored inside an audio file.
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software
    * @version Version 1, October 13, 2004
    public class ID3v11Tag implements Serializable, Comparable {
       * construct an ID3v11Tag and read tag content from a given file
       * <p>This constructor can be used for cases where a RandomAccessFile has already
       * been opened and will be closed elsewhere</p>
       * @param rf RandomAccessFile  the open file to read from
       * @param isAtTagStartPos boolean  true, if the file pointer is at the
       * position where the ID3 tag starts; when false, the pointer is positioned accordingly here
       * @throws IOException
      public ID3v11Tag(RandomAccessFile rf, boolean isAtTagStartPos) throws IOException {
        if(isAtTagStartPos) {
          readTag(rf);
        else {
          readTag(rf, rf.length() - 128);
       * construct an ID3v11Tag and read tag content from a file at a given location
       * <p>This constructor opens and closes the audio file for reading</p>
       * @param absolutePath String  the absolute path to the audio file to open
       * @throws IOException
      public ID3v11Tag(String absolutePath) throws IOException {
        RandomAccessFile rf = new RandomAccessFile(absolutePath, "r");
        readTag(rf, rf.length() - 128);
        rf.close();
       * construct an ID3v11Tag and read tag content from a given file
       * <p>This constructor opens and closes the audio file for reading</p>
       * @param audioFile File  the audio file to read from
       * @throws IOException
      public ID3v11Tag(File audioFile) throws IOException {
        this(audioFile.getAbsolutePath());
       * get a string representation of this object
       * @return String
      public String toString() {
        DecimalFormat df = new DecimalFormat("00");
        return getArtist() + ", " + getAlbum() + " - " + df.format(getTrackNumber()) + " " + getTitle();
       * position to file pointer and read the tag
       * @param rf RandomAccessFile  the file to read from
       * @param jumpPos long  the position to jump to (the tag start position)
       * @throws IOException
      public void readTag(RandomAccessFile rf, long jumpPos) throws IOException {
        rf.seek(jumpPos);
        readTag(rf);
       * read the tag from a given file, assuming the file pointer to be at the tag start position
       * @param rf RandomAccessFile  the file to read from
       * @throws IOException
      public void readTag(RandomAccessFile rf) throws IOException {
        rf.read(tagBuf);
        if(tag.equalsIgnoreCase(new String(tagBuf))) {
          rf.read(title);
          rf.read(artist);
          rf.read(album);
          rf.read(year);
          rf.read(comment);
          rf.read(trackNo);
          rf.read(genre);
      public String getTitle() {
        return new String(title).trim();
      public String getArtist() {
        return new String(artist).trim();
      public String getAlbum() {
        return new String(album).trim();
      public String getYear() {
        return new String(year).trim();
      public String getComment() {
        return new String(comment).trim();
      public int getGenreId() {
        try {
          int id = new Byte(genre[0]).intValue();
          if(id < GENRE_ID_MIN || id > GENRE_ID_MAX) {
            return GENRE_ID_OTHER;
          else {
            return id;
        catch(Exception ex) {
          return GENRE_ID_OTHER;
      public String getGenreName() {
        return genreNames[getGenreId()];
      public int getTrackNumber() {
        try {
          return (int) trackNo[0];
        catch(Exception e) {
          return 0;
       * Compares this object with the specified object for order.
       * @param o the Object to be compared.
       * @return a negative integer, zero, or a positive integer as this object is less than, equal to,
       *                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Hi Franck,
    thank you, mate. I did what you suggested (changed class attached) but that did not change the mentioned behaviour.
    The first run is approximately 75 seconds with Java option -Xms40m and approx. double without, the second run and all subsequent runs are only 2-3 seconds each (!!!) even when terminating and re-starting the application between thread runs.
    I'm pretty clueless about that, any more help on this anyone?
    Thanks a lot and best regards
    Ulrich
    PS: BTW, I forgot to post the class that is filled with data by class CollectionThread, so here it is
    * Light Development Playlist Editor
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.app.playlisteditor.data;
    import java.io.File;
    import com.lightdev.lib.audio.ID3v11Tag;
    import javax.sound.sampled.UnsupportedAudioFileException;
    import java.io.IOException;
    import java.io.Serializable;
    import com.lightdev.lib.audio.AudioFileDescriptor;
    import com.lightdev.lib.ui.SortListModel;
    import java.util.Iterator;
    * Storage model for audio data.
    * <p>
    * <code>AudioDataModel</code> can be used to store ID3 tag data collected from
    * a directory with audio files to perform queries and reports on the found data.
    * </p>
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software as well as any licensing notes
    *      inside this documentation
    * @version 1, October 15, 2004
    public class AudioDataModel extends SortListModel implements Serializable {
       * constructor
      public AudioDataModel() {
       * add an audio track from a given audio file
       * <p>This will attempt to read ID3 tag data from the file.</p>
       * @param audioFile File  the file to add audio data for
       * @throws IOException
      public void addTrack(File audioFile) throws IOException {
        AudioFileDescriptor afd = new AudioFileDescriptor(audioFile.getAbsolutePath());
        if (!data.contains(afd)) {
          data.add(afd);
       * get all tracks for agiven combination of genre name, artist name and album name. Any of
       * the parameters may be null or AudioDataModel.FILTER_ALL
       * <p>Ugly code, I know, but it simply hard codes all combinations of the the mentioned
       * parameters. Any more elegant implementations welcome.</p>
       * @param genreName String  a genre name to get tracks for
       * @param artistName String  an artist name to get tracks for
       * @param albumName String  an album name to get tracks for
       * @return SortListModel   the found tracks in a list model
      public SortListModel getTracks(String genreName, String artistName, String albumName) {
        SortListModel foundTracks = new SortListModel();
        Iterator e = data.iterator();
        while(e.hasNext()) {
          AudioFileDescriptor afd = (AudioFileDescriptor) e.next();
          ID3v11Tag tag = afd.getID3v11Tag();
          if(genreName == null || genreName.equalsIgnoreCase(FILTER_ALL)) {
            if(artistName == null || artistName.equalsIgnoreCase(FILTER_ALL)) {
              if (tag.getAlbum().equalsIgnoreCase(albumName))
                foundTracks.add(afd);
            else {
              if(albumName == null || albumName.equalsIgnoreCase(FILTER_ALL)) {
                if (tag.getArtist().equalsIgnoreCase(artistName))
                  foundTracks.add(afd);
              else {
                if (tag.getArtist().equalsIgnoreCase(artistName) &&
                    tag.getAlbum().equalsIgnoreCase(albumName))
                  foundTracks.add(afd);
          else {
            if(artistName == null || artistName.equalsIgnoreCase(FILTER_ALL)) {
              if(albumName == null || albumName.equalsIgnoreCase(FILTER_ALL)) {
                if (tag.getGenreName().equalsIgnoreCase(genreName))
                  foundTracks.add(afd);
              else {
                if (tag.getGenreName().equalsIgnoreCase(genreName) &&
                    tag.getAlbum().equalsIgnoreCase(albumName))
                  foundTracks.add(afd);
            else {
              if(albumName == null || albumName.equalsIgnoreCase(FILTER_ALL)) {
                if (tag.getGenreName().equalsIgnoreCase(genreName) &&
                    tag.getArtist().equalsIgnoreCase(artistName))
                  foundTracks.add(afd);
              else {
                if (tag.getGenreName().equalsIgnoreCase(genreName) &&
                    tag.getArtist().equalsIgnoreCase(artistName) &&
                    tag.getAlbum().equalsIgnoreCase(albumName))
                  foundTracks.add(afd);
        foundTracks.sort();
        return foundTracks;
       * list all artists in this model
       * @return SortListModel
      public SortListModel listArtists() {
        SortListModel artists = new SortListModel();
        artists.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String artistName = tag.getArtist();
          if (artists.indexOf(artistName) < 0) {
            artists.add(artistName);
        artists.sort();
        return artists;
       * list all artists in this model having titles belonging to a given genre
       * @param genreName String  name of the genre artists are searched for
       * @return SortListModel
      public SortListModel listArtists(String genreName) {
        SortListModel artists = new SortListModel();
        artists.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String artistName = tag.getArtist();
          String genre = tag.getGenreName();
          if (artists.indexOf(artistName) < 0 && genre.equalsIgnoreCase(genreName)) {
            artists.add(artistName);
        artists.sort();
        return artists;
       * list all genres in this model
       * @return SortListModel
      public SortListModel listGenres() {
        SortListModel genres = new SortListModel();
        genres.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String genreName = tag.getGenreName();
          if (genres.indexOf(genreName) < 0) {
            genres.add(genreName);
        genres.sort();
        return genres;
       * list all albums in this model
       * @return SortListModel
      public SortListModel listAlbums() {
        SortListModel albums = new SortListModel();
        albums.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String albumName = tag.getAlbum();
          if (albums.indexOf(albumName) < 0) {
            albums.add(albumName);
        albums.sort();
        return albums;
       * list all albums in this model having titles belonging to a given genre
       * @param genreName String  name of the genre albums are searched for
       * @return SortListModel
      public SortListModel listAlbums(String genreName) {
        SortListModel albums = new SortListModel();
        albums.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String albumName = tag.getAlbum();
          String genre = tag.getGenreName();
          if (albums.indexOf(albumName) < 0 && genre.equalsIgnoreCase(genreName)) {
            albums.add(albumName);
        albums.sort();
        return albums;
       * list all albums in this model having titles belonging to a given genre and artist
       * @param genreName String  name of the genre albums are searched for
       * @param artistName String  name of the artist albums are searched for
       * @return SortListModel
      public SortListModel listAlbums(String genreName, String artistName) {
        SortListModel albums = new SortListModel();
        albums.add(FILTER_ALL);
        Iterator e = data.iterator();
        while (e.hasNext()) {
          ID3v11Tag tag = ((AudioFileDescriptor) e.next()).getID3v11Tag();
          String albumName = tag.getAlbum();
          String genre = tag.getGenreName();
          String artist = tag.getArtist();
          if(genreName == null || genreName.equalsIgnoreCase(FILTER_ALL)) {
            if (albums.indexOf(albumName) < 0 &&
                artist.equalsIgnoreCase(artistName))
              albums.add(albumName);
          else {
            if (albums.indexOf(albumName) < 0 &&
                genre.equalsIgnoreCase(genreName) &&
                artist.equalsIgnoreCase(artistName))
              albums.add(albumName);
        albums.sort();
        return albums;
       * get the number of audio tracks stored in this data model
       * @return int  the number of tracks
      public int getTrackCount() {
        return data.size();
      /** constant to select all items of a given part */
      public static final String FILTER_ALL = "    all";
    }...and here the changed CollectionThread now caching found File objects in a vector
    * Light Development Playlist Editor
    * Copyright (C) 2004 Ulrich Hilger
    * This program is free software; you can redistribute it and/or
    * modify it under the terms of the GNU General Public License
    * as published by the Free Software Foundation; either version 2
    * of the License, or (at your option) any later version.
    * This program is distributed in the hope that it will be useful,
    * but WITHOUT ANY WARRANTY; without even the implied warranty of
    * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    * GNU General Public License for more details.
    * You should have received a copy of the GNU General Public License
    * along with this program; if not, write to the Free Software
    * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
    package com.lightdev.app.playlisteditor.data;
    import com.lightdev.lib.util.InfoThread;
    import java.io.File;
    import java.util.Vector;
    import java.util.Enumeration;
    * A class to collect audio data from a given storage location.
    * <p>
    * <code>CollectionThread</code> uses ID3 tag information to gain data.
    * </p>
    * <p>See <a href="http://www.id3.org">http://www.id3.org</a> for details about
    * ID3 tags.</p>
    * @author Ulrich Hilger
    * @author Light Development
    * @author <a href="http://www.lightdev.com">http://www.lightdev.com</a>
    * @author <a href="mailto:[email protected]">[email protected]</a>
    * @author published under the terms and conditions of the
    *      GNU General Public License,
    *      for details see file gpl.txt in the distribution
    *      package of this software as well as any licensing notes
    *      inside this documentation
    * @version 1, October 13, 2004
    public class CollectionThread extends InfoThread {
       * constructor
       * @param model  AudioDataModel  the data model to collect data to
      public CollectionThread(AudioDataModel model) {
        this.model = model;
       * constructor, creates a new empty AudioDataModel
      public CollectionThread() {
        this(new AudioDataModel());
       * set the data model to collect data to
       * @param model AudioDataModel  the model to collect data to
      public void setModel(AudioDataModel model) {
        this.model = model;
       * get the data model associated to this thread
       * @return AudioDataModel  the data model
      public AudioDataModel getModel() {
        return model;
       * set the directory to collect data from
       * @param rootDir File  the directory to collect data from
      public void setRootDirectory(File rootDir) {
        this.rootDir = rootDir;
       * this is the method to prepare a thread to run.
      protected void prepareThread() {
        maxValue = -1;
        filesProcessed = 0;
        innerCount = 0;
        fileList = new Vector();
       * do the actual work of this thread, i.e. iterate through a given directory
       * structure and collect audio data
       * @return boolean  true, if work is left
      protected boolean work() {
        boolean workIsLeft = true;
        if(getStatus() < STATUS_HALT_PENDING) {
          countElements(rootDir.listFiles());
        if(getStatus() < STATUS_HALT_PENDING) {
          workIsLeft = collect(); //collect(rootDir.listFiles());
          fileList.clear();
          fileList = null;
        return workIsLeft;
       * count the elements in a given file array including its subdirectories
       * @param files File[]
      private void countElements(File[] files) {
        int i = 0;
        while (i < files.length && getStatus() < STATUS_HALT_PENDING) {
          File file = files;
    if (file.isDirectory()) {
    countElements(file.listFiles());
    else {
    fileList.add(file);
    i++;
    maxValue++;
    * read data into model
    * @param files File[] the file array representing the content of a given directory
    * @return boolean true, if work is left
    private boolean collect(/*File[] files*/) {
    Enumeration files = fileList.elements();
    while(files.hasMoreElements() && getStatus() < STATUS_HALT_PENDING) {
    File file = (File) files.nextElement();
    try {
    model.addTrack(file);
    catch(Exception e) {
    fireThreadException(e);
    filesProcessed++;
    if(++innerCount > 99) {
    innerCount = 0;
    fireThreadProgress(filesProcessed);
    return false;
    int i = 0;
    while(i < files.length && getStatus() < STATUS_HALT_PENDING) {
    File file = files[i];
    if(file.isDirectory()) {
    collect(file.listFiles());
    else if(file.getName().toLowerCase().endsWith("mp3")) {
    try {
    model.addTrack(file);
    catch(Exception e) {
    fireThreadException(e);
    i++;
    filesProcessed++;
    fireThreadProgress(filesProcessed);
    return (i<files.length);
    /** the directory to collect data from */
    private File rootDir;
    /** the data model to collect data to */
    private AudioDataModel model;
    /** the number of files this thread processed so far while it is running */
    private long filesProcessed = 0;
    /** a list to temporary store found files */
    private Vector fileList;
    /** counter to determine when to fire progress messages */
    private int innerCount = 0;

  • TS1702 I need some help the apps were downloading slowly

    The apps downloaded but it didn't cause it's stuck in downloading mode what should I do?
    The iOS 6 update didn't work.
    Please I need some help.
    The apps didn't download.
    Talking Angela and Ginger didn't download.
    Talking Santa didn't update.

    Try moving the existing backup file to a safe location so that iTunes has to create an entire new file.  The backup file is located here. You can delete that backup once you get a successfull backup.
    iTunes places the backup files in the following places:
    Mac: ~/Library/Application Support/MobileSync/Backup/
    Windows XP: \Documents and Settings\(username)\Application Data\Apple Computer\MobileSync\Backup\
    Windows Vista and Windows 7: \Users\(username)\AppData\Roaming\Apple Computer\MobileSync\Backup\
    Note: If you do not see the AppData or Application Data folders, you may need to show hidden files (Windows XP,  Windows Vista and Windows 7), or iTunes may not be installed in the default location. Show hidden files and then search the hard drive for the Backup directory.

  • I'm suddenly in need of help with my Firefox browser (6.0.2)

    Hi there,
    I'm suddenly in need of help with my Firefox browser (6.0.2)
    (OS: I use Windows XP).
    When I open up the browser, all I see is a completely blank white screen, with all the toolbars at the top.
    I know that my physical connections are fine: I've tested the modem, turned the pc off and on etc. and I can also receive/send emails.
    This problem started today, 8th September, 2011 and has never happened before.
    Is it a coincidence that Firefox updated itself just before I logged off yesterday evening? Could it be something to do with this particular new update?
    I've also noted that just before I "open up" Firefox, I now get a small box saying:
    [JAVASCRIPT APPLICATION]
    Exc In Ev handl: TypeError: This oRoot.enable is not a function
    This has never appeared before - I hope it offers a clue a to what is wrong.
    The Browser is not stuck in Safe Mode, by the way.
    Obviously, I can't search for any solutions to the problem on the internet, as I can't physically see any websites!
    (A friend is sending this query on my behalf from their pc)
    Any light you could throw on this confusing problem would be much appreciated. I'd rather not have to uninstall and reinstall Firefox if possible.
    If the only option is to uninstall Firefox and reinstall it from your site, then I'm also in trouble (I can't see the internet or make any downloads).
    In that case, would you be able to send the .exe file as an attachment to my email address? If so, please let me know and I'll give you further details.
    Many thanks in advance.

    A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.
    Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    * https://support.mozilla.com/kb/Server+not+found
    * https://support.mozilla.com/kb/Firewalls
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode

  • I need your help with a decision to use iPhoto.  I have been a PC user since the mid 1980's and more recently have used ACDSee to manage my photo images and Photoshop to edit them.  I have used ProShow Gold to create slideshows.  I am comfortable with my

    I need your help with a decision to use iPhoto.  I have been a PC user since the mid 1980’s and more recently have used ACDSee to manage my photo images and Photoshop to edit them.  I have used ProShow Gold to create slideshows.  I am comfortable with my own folder and file naming conventions. I currently have over 23,000 images of which around 60% are scans going back 75 years.  Since I keep a copy of the originals, the storage requirements for over 46,000 images is huge.  180GB plus.
    I now have a Macbook Pro and will add an iMac when the new models arrive.  For my photos, I want to stay with Photoshop which also gives me the Bridge.  The only obvious reason to use iPhoto is to take advantage of Faces and the link to iMovie to make slideshows.  What am I missing and is using iPhoto worth the effort?
    If I choose to use iPhoto, I am not certain whether I need to load the originals and the edited versions. I suspect that just the latter is sufficient.  If I set PhotoShop as my external editor, I presume that iPhoto will keep track of all changes moving forward.  However, over 23,000 images in iPhoto makes me twitchy and they are appear hidden within iPhoto.  In the past, I have experienced syncing problems with, and database errors in, large databases.  If I break up the images into a number of projects, I loose the value of Faces reaching back over time.
    Some guidance and insight would be appreciated.  I have a number of Faces questions which I will save for later. 

    Bridge and Photoshop is a common file-based management system. (Not sure why you'd have used ACDSEE as well as Bridge.) In any event, it's on the way out. You won't be using it in 5 years time.
    Up to this the lack of processing power on your computer left no choice but to organise this way. But file based organisation is as sensible as organising a Shoe Warehouse based on the colour of the boxes. It's also ultimately data-destructive.
    Modern systems are Database driven. Files are managed, Images imported, virtual versions, lossless processing and unlimited editing are the way forward.
    For a Photographer Photoshop is overkill. It's an enormously powerful app, a staple of the Graphic Designers' trade. A Photographer uses maybe 15% to 20% of its capability.
    Apps like iPhoto, Lightroom, Aperture are the way forward - for photographers. There's the 20% of Photoshop that shooters actually use, coupled with management and lossless processing. Pop over to the Aperture or Lightroom forums (on the Adobe site) and one comment shows up over and over again... "Since I started using Aperture/ Lightroom I hardly ever use Photoshop any more..." and if there is a job that these apps can do, then the (much) cheaper Elements will do it.
    The change is not easy though, especially if you have a long-standing and well thought out filing system of your own. The first thing I would strongly advise is that you experiment before making any decisions. So I would create a Library, import 300 or 400 shots and play. You might as well do this in iPhoto to begin with - though if you’re a serious hobbyist or a Pro then you'll find yourself looking further afield pretty soon. iPhoto is good for the family snapper, taking shots at birthdays and sharing them with friends and family.
    Next: If you're going to successfully use these apps you need to make a leap: Your files are not your Photos.
    The illustration I use is as follows: In my iTunes Library I have a file called 'Let_it_Be_The_Beatles.mp3'. So what is that, exactly? It's not the song. The Beatles never wrote an mp3. They wrote a tune and lyrics. They recorded it and a copy of that recording is stored in the mp3 file. So the file is just a container for the recording. That container is designed in a specific way attuned to the characteristics and requirements of the data. Hence, mp3.
    Similarly, that Jpeg is not your photo, it's a container designed to hold that kind of data. iPhoto is all about the data and not about the container. So, regardless of where you choose to store the file, iPhoto will manage the photo, edit the photo, add metadata to the Photo but never touch the file. If you choose to export - unless you specifically choose to export the original - iPhoto will export the Photo into a new container - a new file containing the photo.
    When you process an image in iPhoto the file is never touched, instead your decisions are recorded in the database. When you view the image then the Master is presented with these decisions applied to it. That's why it's lossless. You can also have multiple versions and waste no disk space because they are all just listings in the database.
    These apps replace the Finder (File Browser) for managing your Photos. They become the Go-To app for anything to do with your photos. They replace Bridge too as they become a front-end for Photoshop.
    So, want to use a photo for something - Export it. Choose the format, size and quality you want and there it is. If you're emailing, uploading to websites then these apps have a "good enough for most things" version called the Preview - this will be missing some metadata.
    So it's a big change from a file-based to Photo-based management, from editing files to processing Photos and it's worth thinking it through before you decide.

  • Letter/report generation...morgalr, i need your help!!

    may i know the details or some sample source code of how to generate the html and import it to MS Word...i need your help urgently...may i have your email to contact u?.....please help, it is urgent!!!

    You need not use an applet to write an HTML file, any application file will do fine, actually applications may be prefered due to system security and file creation. Basically the html files are just text files using HTML. Look at any book on HTML and you will be able to get the style and form down along with the syntax.
    As for calling MS word, do a search on the web for a product called JPrint. It is done by a company called Neva and they also have a product called "coroutine". It is coroutine that you want. Coroutine is a native level interface for Java to Comm. The docs that come with coroutine should be saficient to get you going on the project.

  • I want to get iBook, Facebook and Skype to my iphone 4.2.1 through my iTune, but I coudn't because it is said that it requires a newer version of iOS. Please I need your help. Thanks

    I want to get iBook, Facebook and Skype to my iphone 4.2.1 through my iTune, but I coudn't because it is said that it requires a newer version of iOS. Please I need your help. Thanks

    If your iPhone can't be updated to a higher iOS version then the only way to get them is if you downloaded versions of them which were compatible with iOS 4.2.1 and you still have copies of those versions somewhere e.g. on your computer or on a backup - only the current version of each app is available in the store, and as apps (and other content) are tied to the account that downloads them, you will need to have older copies that are linked to your id

  • HT4759 Please I need a help I cannot backup my ipad and can not get into the icloud storage.  What would I do to get into my ipad?  please I need your help

    Please I need a help.  I cannot backup my ipad and can not get into the iclous storage to delet them, because its read icloud storage is full.  Please do you have a knowledge of how I can get rid of the message and get into the ipad?

    Welcome to the Apple Community.
    You might try a forced shutdown to begin with, hold down the top and home buttons together until the device shuts down, then restart it.

Maybe you are looking for

  • High Availibity solution for Sharepoint Service Applications

    I have a scenario with the three nodes SP1 , SP2 and DR-SP with server 2012 standard, each running SharePoint 2013 enterprise, All of three nodes are members of single SharePoint farm that spans two data centers.Primary Data Center have two nodes SP1

  • F-Secure Key: Password history

    Please implement automated versioning and history for passwords. It is too easy now to accidentally change a password as it is, and there is no way to revert or look back what the previous password was.

  • How to down the media smart package for lap top

    Hi, Well were to begin I bought my second Hp computer in the USA as my daughter live there, I just recently decided to reboot but that turned into a nightmare it did not work either way from recovery or from the  disc's you supplied. So I installed s

  • Will my Bootcamp Windows Install Remain after SSD Install

    I currently have a i5 Mac Mini 5.1 with the standard 500gb hard drive installed. Presently the drive is split as 340gb for OSX and 160gb for Windows 8.1 running under Bootcamp. My plan is to install a 250gb SSD in addition to the original 500gb HDD o

  • Online Alert- System Notification?

     I have had a few skype calls from this address usa.da8.osx.system.voice.alarm with the header Online Alert- System Notification. I ignored the first few calls then accidently accepted a call to get a recording then blocked them. Today I get anothe