Comments or Discription in a calculation

I'm guessing the answer to this is no, but I hope someone has figured out a way.
Conditions and parameters have a description field associated with them. However, I don't see anything like this for calculations. Since some of my calculations can become fairly complicated (especially those using analytics), is there some way to add comments to the calculation to describe what it is doing?

To extend on what Rod said, I have found that a 'difficult' calculation is useful for putting in a folder so the user doesn't have to figure it out each time.
If it's a company 'standard' kind of calculation (ie: they use a particular field to determine the type of record it is such as: case when inv_number between 1 and 1000 then 'retail' when inv_number between 1001 and 2000 then 'manufacturing' ..., etc.).
Also, when there's data to 'massage', 'fudge', 'kludge', 'lie' ... whatever ... then again the same concept of having a calculation 'fix' the data and then calling the calculation the name of the item ... and then making the original item 'invisible' to the user in the folder (EUL) also comes in handy and report creators never need to know that the original column had a problem and the new one hides that fact.
But again, no commenting.
Russ

Similar Messages

  • Tax procedure for VAT calculation on Base amount + WHT amount

    Hi All,
    Needed your inputs on definition of tax procedure, to calculate VAT tax where base amount + withholding tax amount are tax base components.
    E.g. in AR line item:
         Revenue:  950 (FB70 ->Editing options:  calculate taxes on net amount check box is enabled)
         WHT: 50 (5%) (Re-grossing method using)
         VAT: 70 (7%)
    To achieve as above how to define tax procedure: current procedure definition as below.
    StepCounter-Ctyp----Description-From--To
    100--0---     -BASB--Base Amount 
    117--0---     -J1W1Output Tax----100
    118--0MWS1-Subtotal--100----117
    120--0---     -MWASOutput Tax------118
    Please through some light on this.
    Thanks in advance.
    SK

    Dear all,
    Any comments please.
    Highly appreciated calculating VAT tax on base amount and WHT (re-grossing up).
    Thanks in advance.
    SK

  • G/L Interest calculation  procedure

    Balance Interest calculation
    For term loan
    Pls send any one G/L Accounts Interest Calculation procedure
    Configuration
    It is very urgent

    Balance Interest Calculation: -
    It is a calculation of Interest on total balance of an  account or total balance of customer account. it is represented in "s".
    System defined variant for balance interest calculation type is u2018Su2019 and item interest calculation type is u2018Pu2019. Balance interest type calculation is used for G L Accounts. Item interest type calculation is used for vendors and customers.
    To display all transaction codes go to transaction code:SE16
    The Nine configuration steps for calculation of balance interest calculation are
    1) Define interest calculation type (OB46)
    2) Prepare account balance interest calculation (OBAA)
    3) Define reference interest rates (OBAC)
    4) Define time dependent terms (OB81)
    5) Define or specify interest rates (OB83)
    6) Create G L Accounts for Intesrest Gained and Interest allowed and Loan Account (FS00)
    7) Prepare gl account balance interest calculation and Define automatic posting (OBV2)
    8) Entry for Loan (F-02)
    9) Run interest programm (f.52)
    Step 01: Define interest calculation types (OB46)
    Path: SPRO>FInancial Accounting New>Financial Accounting Global Setting New>Business Transaction> Bank A/C interest calculation>Interest calculation global settings>Define interest calculation types
    Go to new entries
    Interest Id (V1) put discription Name Interest calculation type (S) and enter it will take automatically balance interest for S
    Make sure don't tick mark the box given and save it.
    Step 02: Prepare account balance interest calculation (OBAA)
    Path: SPRO>FInancial Accounting New>Financial Accounting Global Setting New>Business Transaction> Bank A/C interest calculation>Interest calculation global settings>Prepare account balance interest calculation
    Go to new entries
    Give calculation indicator as defined V1
    Interest calculation frequency : 01 (1 month)
    Calendar type : G (28-31/365)
    Give number range : 03
    Select balance plus interest.
    Save
    Step 03: Define reference interest rate (OBAC)
    Path: SPRO>FInancial Accounting New>Financial Accounting Global Setting New>Business Transaction> Bank A/C interest calculation>Interest calculation>Define reference interest rates
    Go to new entries
    Reference interest rate : V1 (same as Interest Indicator)
    Long text : 12%balanace interest
    Short text : 12% balance interest
    Date from : 01.03.2010
    Currency : INR
    Save
    Step 04: Define time dependent terms (OB81)
    Path: SPRO>FInancial Accounting New>Financial Accounting Global Setting New>Business Transaction> Bank A/C interest calculation>Interest calculation>Define time dependent terms
    Go to new entries
    Interest calculation indicator : V1
    Currency key : INR
    Effective from : 01.03.2010
    Sequential no : 01
    Term : Debit interest balance interest calculation
    Reference interest rate : V1
    Save
    Go to new entries or F8
    Interest calculation indicator : V1
    Currency : INR
    Effective from : 01.03.2010
    Sequential no : 02
    Term : credit interest balance interest calculation
    Reference interest rate : V1
    Save
    Step 05: Enter Reference Interest Rate Values (OB83)
    Path: SPRO>FInancial Accounting New>Financial Accounting Global Setting New>Business Transaction> Bank A/C interest calculation>Interest calculation>Enter interest values.
    Go to new entries
    Reference int. rate (V1)
    values effective from (01.03.2010)
    interest rate (12%)
    Before creating GL account Go to T.Code: OBD4 to create secured loans account group.
    Go to new entries
    Chart of accounts a/c group name from account to account
    Chart of Account 'TATA' secured loans 100300 100399
    TATA  INTR interest Expenses 400100 400199
    TATA  INTR interest Gained 300100 300199
    Save
    Step 06: Creation of G L Accounts (FS00)
    G L A/C no : 100305
    Company code : TATA (Tata Infotech)
    Select create button
    Account group : secured loans
    Select balance sheet account
    Short text : HSBC Bank Account
    Long text : HSBC Bank Loan Account
    Select control data tab
    Select only balances in local currencies
    Select open item
    Select line item display
    Sort key : 001
    Select create/bank/interest tab
    Field status group : G005
    Select relevant to cash flow
    Interest calculation indicator : V1
    Save
    Give G L A/C no : 400105
    Company code : TATA
    Select create button
    Account group : interest
    Select profit and loss account
    Short text : interest Allowed
    Long text : interest Allowed Account
    Select control data tab.
    Select line item display
    Sort key : 001
    Select create/bank/interest tab
    Field status group : G001
    Save
    Give G L A/C no : 300107
    Company code : TATA
    Select create button
    Account group : interest
    Select profit and loss account
    Short text : interest Gained
    Long text : interest Gained Account
    Select control data tab.
    Select line item display
    Sort key : 001
    Select create/bank/interest tab
    Field status group : G001
    Save
    Step 07: Define automatic posting account (OBV2)
    SPRO>FInancial Accounting New>Financial Accounting Global Setting New>Business Transaction> Bank A/C interest calculation>Interest posting>Prepare G L A/C balance interest calculation
    Go to accounts
    Chart of accounts : TATA
    A/C symbol currency G L A/C
    0002 INR 400105 (interest Allowed)
    2000 Inr 100305 (HSBC Bank Loan Account)
    Save
    Step 08: Entry for loan (F-02):
    Give document date : 01.03.2010
    Posting date : 01.03.2010
    Type : SA
    Company code : TATA
    Currency : INR
    Posting key : 40
    G L Account : 200005 (ICICI bank a/c)
    Enter
    Amount : 50,00,000
    Business area : IRON
    Value date : 01.03.2010
    Text : loan received
    Posting key : 50
    G L Account : 100305 (HSBC bank a/c)
    Enter
    Amount :   *
    Business area : IRON
    Text :   +
    Save
    Step 09: Interest calculation run (F.52):
    Accounting>Financial Accounting>General ledger>Periodic Processing>Interest calculation>Balances
    Give chart of accounts : TATA
    G L A/C no : 100305 (HSBC Bank Account)
    Company code : TATA
    Calculation period : 01.04.2010 to 31.12.2012
    Select leap year.
    Select post also if value date in past
    Select update master records
    Execute
    Go to system on menu bar.
    Select services
    Select batch input
    Select sessions
    Select RFSZIS00
    Select process
    Select display errors only
    Again select process
    The system gives the message: u201Cprocessing of batch input session completedu201D

  • Report Not able to generate values in output

    hi gurus,
    i am not able to get the output for this report,pls help me in correcting the code and suggest me a sloution.Urgent...............
    *& Report  ZRPP006
    *&  Modification History
    *& Change # | By     | Date     | Purpose of Change
    *& C0001 |pradeep.R  | 20070629 | Total component request for sop&Copa
    *&       |           |          |
    *&       |           |          |
    report  zrpp006 line-size 180 line-count 90
            no standard page heading.
    Class
    *class cl_gui_column_tree definition load.
    *class cl_gui_cfw definition load.
    *data tree1  type ref to cl_gui_alv_tree.
    *data mr_toolbar type ref to cl_gui_toolbar.
    Include
    *include <icon>.
    *include bcalv_toolbar_event_receiver.
    *include bcalv_tree_event_receiver.
    include zipp007.
    selection screen
    selection-screen begin of block selscrb with frame title text-s01.
    parameters: ra_SOP radiobutton group GRP default 'X',
                ra_COPA radiobutton group GRP.
    selection-screen end of block selscrb.
    Data:pa_m_frm(6) type c,
         pa_m_to(6) type c,
         pa_y_frm(4) type c,
         pa_y_to(4) type c,
         ra_mth,
         ra_yea,
         l_mode.
    *parameter: pa_m_frm(6) type c,
              pa_m_to(6) type c,
              pa_y_frm(4) type c,
              pa_y_to(4) type c..
    data: so_matnr,
          so_matkl,
          pa_stprs,
          pa_werks ,
          pa_vrsio .
    selection-screen skip 1.
    initialization.
      clear: ta_vrsio, ta_type.
      refresh: ta_vrsio, ta_type.
    *at selection-screen on value-request for pa_vrsio.
    call function 'F4IF_INT_TABLE_VALUE_REQUEST'
       EXPORTING
         retfield    = 'VRSIO'
         dynprofield = 'PA_VRSIO'
         dynpprog    = sy-cprog
         dynpnr      = sy-dynnr
         value_org   = 'S'
       TABLES
         value_tab   = ta_vrsio.
    Start-of-selection.
    if ra_SOP eq 'X'.
        submit ZRPP023 via selection-screen and return.
      elseif ra_COPA eq 'X'.
        submit ZRPP026 via selection-screen and return..
      endif.
    select * into corresponding fields of table ta_vrsio
      from p44v
      where gstru = 'S076'.
      sort ta_vrsio by vrsio.
      delete adjacent duplicates from ta_vrsio.
      move 'MONTH' to ta_type-out_type.
      append ta_type.
      move 'YEAR' to ta_type-out_type.
      append ta_type.
    at selection-screen output.
      if ra_mth = 'X'.
        loop at screen.
          if screen-name = 'PA_M_FRM'.
            screen-active = '1'.
            modify screen.
          endif.
          if screen-name = '%C001007_1000'.
            screen-active = '1'.
            modify screen.
          endif.
          if screen-name = '%C002009_1000'.
            screen-active = '1'.
            modify screen.
          endif.
          if screen-name = 'PA_M_TO'.
            screen-active = '1'.
            modify screen.
          endif.
          if screen-name = '%C003012_1000'.
            screen-active = '1'.
            modify screen.
          endif.
          if screen-name = '%C004014_1000'.
            screen-active = '1'.
            modify screen.
          endif.
          if screen-name = 'PA_Y_FRM'.
            screen-active = '0'.
            modify screen.
          endif.
          if screen-name = '%C005017_1000'.
            screen-active = '0'.
            modify screen.
          endif.
          if screen-name = '%C006019_1000'.
            screen-active = '0'.
            modify screen.
          endif.
          if screen-name = 'PA_Y_TO'.
            screen-active = '0'.
            modify screen.
          endif.
          if screen-name = '%C007022_1000'.
            screen-active = '0'.
            modify screen.
          endif.
          if screen-name = '%C008024_1000'.
            screen-active = '0'.
            modify screen.
          endif.
        endloop.
      elseif ra_yea = 'X'.
        loop at screen.
          if screen-name = 'PA_M_FRM'.
            screen-active = '0'.
            modify screen.
          endif.
          if screen-name = '%C001007_1000'.
            screen-active = '0'.
            modify screen.
          endif.
          if screen-name = '%C002009_1000'.
            screen-active = '0'.
            modify screen.
          endif.
          if screen-name = 'PA_M_TO'.
            screen-active = '0'.
            modify screen.
          endif.
          if screen-name = '%C003012_1000'.
            screen-active = '0'.
            modify screen.
          endif.
          if screen-name = '%C004014_1000'.
            screen-active = '0'.
            modify screen.
          endif.
          if screen-name = 'PA_Y_FRM'.
            screen-active = '1'.
            modify screen.
          endif.
          if screen-name = '%C005017_1000'.
            screen-active = '1'.
            modify screen.
          endif.
          if screen-name = '%C006019_1000'.
            screen-active = '1'.
            modify screen.
          endif.
          if screen-name = 'PA_Y_TO'.
            screen-active = '1'.
            modify screen.
          endif.
          if screen-name = '%C007022_1000'.
            screen-active = '1'.
            modify screen.
          endif.
          if screen-name = '%C008024_1000'.
            screen-active = '1'.
            modify screen.
          endif.
        endloop.
      endif.
    End-of-selection.
      perform get_header_data.
      perform get_top_page.
    *&      Form  display_alv
          text
    form display_alv.
    ALV ***
      g_repid = sy-repid.
      perform layout_init using gs_layout.
      perform eventtab_build using gt_events[].
      gs_variant-report = g_repid.
      g_save           = 'A'.
    perform comment_build using gt_list_top_of_page[].
    Display monthly report
      if ra_mth = 'X' and
         pa_m_frm <> 0 and
          pa_m_to <> 0.
        perform fieldcat_init_mth using gt_fieldcat[].
        perform printer_setting using print_set.
        call function 'REUSE_ALV_GRID_DISPLAY'
          exporting
               i_background_id    = 'ALV_BACKGROUND'
               i_buffer_active    = 'X'
               i_callback_program = g_repid
               i_structure_name   = 'ITAB_MSALE'
               is_layout          = gs_layout
               it_fieldcat        = gt_fieldcat[]
               i_save             = g_save
               is_variant         = gs_variant
               it_events          = gt_events[]
               it_sort            = gt_it_sort[]
               is_print           = print_set
         I_SCREEN_START_COLUMN    = 0     "Use coordinates for
         I_SCREEN_START_LINE      = 0     "display as dialog box
         I_SCREEN_END_COLUMN      = 0
         I_SCREEN_END_LINE        = 0
          importing
               e_exit_caused_by_caller = g_exit_caused_by_caller
               es_exit_caused_by_user  = gs_exit_caused_by_user
          tables
               t_outtab = itab_msale
          exceptions
               program_error = 1
               others        = 2.
        if sy-subrc = 0.
          if g_exit_caused_by_caller = 'X'.
    *"  Forced Exit by calling program
    *"  <do_something>.
          else.
    *"  User left list via F3, F12 or F15
            if gs_exit_caused_by_user-back = 'X'.       "F3
    *"    <do_something>.
            else.
              if gs_exit_caused_by_user-exit = 'X'.     "F15
    *"      <do_something>.
              else.
                if gs_exit_caused_by_user-cancel = 'X'. "F12
    *"        <do_something>.
                else.
    *"        should not occur!
    *"        <do_Abnormal_End>.
                endif.
              endif.
            endif.
          endif.
        else.
    "Fatal error callin ALVAXXX(XY) WITH ...
        endif.
    Display yearly report
      elseif ra_yea = 'X' and
              pa_y_frm <> 0 and
              pa_y_to <> 0.
        perform fieldcat_init_yr using gt_fieldcat[].
        perform printer_setting using print_set.
        call function 'REUSE_ALV_GRID_DISPLAY'
          exporting
               i_background_id    = 'ALV_BACKGROUND'
               i_buffer_active    = 'X'
               i_callback_program = g_repid
               i_structure_name   = 'ITAB_YSALE'
               is_layout          = gs_layout
               it_fieldcat        = gt_fieldcat[]
               i_save             = g_save
               is_variant         = gs_variant
               it_events          = gt_events[]
               it_sort            = gt_it_sort[]
               is_print           = print_set
         I_SCREEN_START_COLUMN    = 0     "Use coordinates for
         I_SCREEN_START_LINE      = 0     "display as dialog box
         I_SCREEN_END_COLUMN      = 0
         I_SCREEN_END_LINE        = 0
          importing
               e_exit_caused_by_caller = g_exit_caused_by_caller
               es_exit_caused_by_user  = gs_exit_caused_by_user
          tables
               t_outtab = itab_ysale
          exceptions
               program_error = 1
               others        = 2.
        if sy-subrc = 0.
          if g_exit_caused_by_caller = 'X'.
    *"  Forced Exit by calling program
    *"  <do_something>.
          else.
    *"  User left list via F3, F12 or F15
            if gs_exit_caused_by_user-back = 'X'.       "F3
    *"    <do_something>.
            else.
              if gs_exit_caused_by_user-exit = 'X'.     "F15
    *"      <do_something>.
              else.
                if gs_exit_caused_by_user-cancel = 'X'. "F12
    *"        <do_something>.
                else.
    *"        should not occur!
    *"        <do_Abnormal_End>.
                endif.
              endif.
            endif.
          endif.
        else.
    *"Fatal error callin ALV
    MESSAGE AXXX(XY) WITH ...
        endif.
      else.
      endif.
    endform.                    "display_alv
    *&      Form  get_top_page
          text
    form get_top_page.
      move 'Total Component Requirement by Sales Forecast' to
      gt_list_top_of_page-info.
      gt_list_top_of_page-typ = 'H'.
      append gt_list_top_of_page.
      concatenate 'Plant   :' pa_werks
      into gt_list_top_of_page-info separated by space.
      gt_list_top_of_page-typ = 'S'.
      append gt_list_top_of_page.
      select single vetxt into tp_vetxt
      from p44v
      where gstru = 'S076'
      and vrsio = pa_vrsio.
      concatenate 'Version :' pa_vrsio tp_vetxt
      into gt_list_top_of_page-info separated by space.
      gt_list_top_of_page-typ = 'S'.
      append gt_list_top_of_page.
      call function 'DATUMSAUFBEREITUNG'
        EXPORTING
          idate           = sy-datum
        IMPORTING
          tdat8           = l_date_string
        EXCEPTIONS
          datfm_ungueltig = 1
          datum_ungueltig = 2
          others          = 3.
      concatenate sy-uzeit(2) ':' sy-uzeit2(2) ':' sy-uzeit4(2)
      into l_time.
      concatenate 'Date/Time :' l_date_string l_time
      into gt_list_top_of_page-info separated by space.
      gt_list_top_of_page-typ = 'S'.
      append gt_list_top_of_page.
    endform.                    "get_top_page
    *&      Form  get_header_data
          text
    -->  p1        text
    <--  p2        text
    form get_header_data.
      select pmnux into ta_mat-matnr
       from s076
        where pmnux = so_matnr
        and wenux = pa_werks
        and vrsio = pa_vrsio.
        append ta_mat.
        clear ta_mat.
      endselect.
      if sy-subrc = 0.
        sort ta_mat by matnr .
        delete adjacent duplicates from ta_mat.
        loop at ta_mat.
          select matnr stlnr stlan stlal
           appending corresponding fields of table ta_mat2
           from mast
           where matnr = ta_mat-matnr
                 and werks = pa_werks.
        endloop.
        loop at ta_mat2 into wa_ta_mat.
          select stlst bmeng bmein into (tp_stlst,tp_bmeng,tp_bmein)
           from stko where stlnr = wa_ta_mat-stlnr
             and stlal = wa_ta_mat-stlal.
            wa_ta_mat-stlst = tp_stlst.
            wa_ta_mat-bmeng = tp_bmeng.
            wa_ta_mat-bmein = tp_bmein.
            append wa_ta_mat to ta_header.
          endselect.
        endloop.
        perform checking.        "checking if monthly or yearly report is being selected
      else.
        message i003(zwpp001).
      endif.
    endform.                    " get_header_data
    *&      Form  checking
          text
    form checking.
      data : date1 like vtbbewe-dbervon,
             date2 like vtbbewe-dberbis.
      data : emonths like vtbbewe-atage.
      data : lv_m_frm(6) type n,
             lv_m_to(6) type n,
             lv_y_frm(4) type n,
             lv_y_to(4) type n.
    check if the Display monthly report is being selected *****
      if ra_mth = 'X' and
           pa_m_frm <> 0 and
           pa_m_to <> 0.
    check for correct input format
        lv_m_frm = pa_m_frm.
        lv_m_to = pa_m_to.
        if lv_m_frm ge '200000' and lv_m_to ge '200000'.
    calculate the months in between
          clear date1.
          clear date2.
          concatenate pa_m_frm '01' into date1.
          concatenate pa_m_to '01' into date2.
        concatenate pa_m_to '31' into date2.
          perform months_calculate using date1 date2 changing emonths.
       check if months <= 36.
          if emonths <= 36.
            perform get_sales.
            perform retrieve_bom.
          else.
            message i000(zwpp001).
            exit.                            " error message
          endif.
        else.
          message i002(zwpp001).
        endif.
    check if the Display yearly report is being selected *****
      elseif ra_yea = 'X' and
             pa_y_frm <> 0 and
             pa_y_to <> 0.
        itab_bom-requantity = lp_s076-absat.    "for current year 2006 ."added by pradeep on 4/07/07
        itab_bom-requantity = lp_s076-absat + 1.                "ie 2007.
        itab_bom-requantity = lp_s076-absat + 2.                "ie 2008.
    check for correct input format
        lv_y_frm = pa_y_frm.
        lv_y_to = pa_y_to.
        if lv_y_frm ge '2000' and lv_y_to ge '2000'.
    calculate the months in between
          clear date1.
          clear date2.
          concatenate pa_y_frm '0101' into date1.
          concatenate pa_y_to '1201' into date2.
        concatenate pa_y_to '1231' into date2.
          perform months_calculate using date1 date2 changing emonths.
       check if months <= 36.
          if emonths <= 36.
            perform get_sales.
            perform retrieve_bom.
          else.
            message i001(zwpp001).
            exit.                            " error message
          endif.
        else.
          message i002(zwpp001).
        endif.
      else.
        exit.
      endif.
    added by pradeep on 04/07/07
    if emonths = 4.
       itab_bom-requantity = lp_s076-absat * itab_bom-comp_qty / itab_bom-xmeng.
    endif.
    if emonths = 5.
       tp_totalprice = lp_s076-absat * ta_mat-stprs.
    endif.
    if emonths = 6.
       itab_bom-requantity = lp_s076-absat * itab_bom-comp_qty / itab_bom-xmeng.
    endif.
    if emonths = 7.
       tp_totalprice = lp_s076-absat * ta_mat-stprs.
    endif.
    if emonths = 8.
       itab_bom-requantity = lp_s076-absat * itab_bom-comp_qty / itab_bom-xmeng.
    endif.
    endform.                     " checking
    *&      Form  get_sales
          text
    form get_sales.
      data: iseq type i,
            tp_sales type p decimals 2,
            tp_totalprice type p decimals 2,"added by pradeep on 03/07/07
            tp_maktx like makt-maktx,
            tp_tabix like sy-tabix,
            tp_pmnux like s076-pmnux,
            seq type i.
      data: yr_frm(6) type c,
            yr_to(6) type c.
      data: year_frm(4) type c,
            year_to(4) type c.
      data: month1(2) type c,
            month12(4) type c.
      data: totalsales like zspp003-mth1.
      data: yr_index like sy-subrc.
    check if the Display monthly report is being selected *****
      if ra_mth = 'X' and
          pa_m_frm <> 0 and
          pa_m_to <> 0.
    retrieve months
        perform get_months.
        select * into corresponding fields of table lp_s076 from s076
                                       where pmnux = so_matnr
                                       and wenux = pa_werks
                                       and vrsio = pa_vrsio
                                       and spmon ge pa_m_frm
                                       and spmon le pa_m_to.
        iseq = 1.
        seq = 0.
        loop at lp_s076.
          if sy-tabix = 1.
            write : lp_s076-pmnux to tp_pmnux.
          endif.
          select single maktx into tp_maktx from makt
                      where matnr = lp_s076-pmnux.
          clear wa.
          read table ta_s076 into wa with key
          matnr = lp_s076-pmnux.
          if sy-subrc ne 0.
            wa-seq   = iseq.
            wa-matnr = lp_s076-pmnux.
            wa-maktx = tp_maktx.
          endif.
          move lp_s076-absat to tp_sales.
          case lp_s076-spmon.
            when t_mth1.
              move tp_sales to wa-mth1.
              move t_mth1 to wa-sp1.
              ind1 = '1'.
            when t_mth2.
              move tp_sales to wa-mth2.
              move t_mth2 to wa-sp2.
              ind2 = '1'.
            when t_mth3.
              move tp_sales to wa-mth3.
              move t_mth3 to wa-sp3.
              ind3 = '1'.
            when t_mth4.
              move tp_sales to wa-mth4.
              move t_mth4 to wa-sp4.
              ind4 = '1'.
            when t_mth5.
              move tp_sales to wa-mth5.
              move t_mth5 to wa-sp5.
              ind5 = '1'.
            when t_mth6.
              move tp_sales to wa-mth6.
              move t_mth6 to wa-sp6.
              ind6 = '1'.
            when t_mth7.
              move tp_sales to wa-mth7.
              move t_mth7 to wa-sp7.
              ind7 = '1'.
            when t_mth8.
              move tp_sales to wa-mth8.
              move t_mth8 to wa-sp8.
              ind8 = '1'.
            when t_mth9.
              move tp_sales to wa-mth9.
              move t_mth9 to wa-sp9.
              ind9 = '1'.
            when t_mth10.
              move tp_sales to wa-mth10.
              move t_mth10 to wa-sp10.
              ind10 = '1'.
            when t_mth11.
              move tp_sales to wa-mth11.
              move t_mth11 to wa-sp11.
              ind11 = '1'.
            when t_mth12.
              move tp_sales to wa-mth12.
              move t_mth12 to wa-sp12.
              ind12 = '1'.
            when t_mth13.
              move tp_sales to wa-mth13.
              move t_mth13 to wa-sp13.
              ind13 = '1'.
            when t_mth14.
              move tp_sales to wa-mth14.
              move t_mth14 to wa-sp14.
              ind14 = '1'.
            when t_mth15.
              move tp_sales to wa-mth15.
              move t_mth15 to wa-sp15.
              ind15 = '1'.
            when t_mth16.
              move tp_sales to wa-mth16.
              move t_mth16 to wa-sp16.
              ind16 = '1'.
            when t_mth17.
              move tp_sales to wa-mth17.
              move t_mth17 to wa-sp17.
              ind17 = '1'.
            when t_mth18.
              move tp_sales to wa-mth18.
              move t_mth18 to wa-sp18.
              ind18 = '1'.
            when t_mth19.
              move tp_sales to wa-mth19.
              move t_mth19 to wa-sp19.
              ind19 = '1'.
            when t_mth20.
              move tp_sales to wa-mth20.
              move t_mth20 to wa-sp20.
              ind20 = '1'.
            when t_mth21.
              move tp_sales to wa-mth21.
              move t_mth21 to wa-sp21.
              ind21 = '1'.
            when t_mth22.
              move tp_sales to wa-mth22.
              move t_mth22 to wa-sp22.
              ind22 = '1'.
            when t_mth23.
              move tp_sales to wa-mth23.
              move t_mth23 to wa-sp23.
              ind23 = '1'.
            when t_mth24.
              move tp_sales to wa-mth24.
              move t_mth24 to wa-sp24.
              ind24 = '1'.
            when t_mth25.
              move tp_sales to wa-mth25.
              move t_mth25 to wa-sp25.
              ind25 = '1'.
            when t_mth26.
              move tp_sales to wa-mth26.
              move t_mth26 to wa-sp26.
              ind26 = '1'.
            when t_mth27.
              move tp_sales to wa-mth27.
              move t_mth27 to wa-sp27.
              ind27 = '1'.
            when t_mth28.
              move tp_sales to wa-mth28.
              move t_mth28 to wa-sp28.
              ind28 = '1'.
            when t_mth29.
              move tp_sales to wa-mth29.
              move t_mth29 to wa-sp29.
              ind29 = '1'.
            when t_mth30.
              move tp_sales to wa-mth30.
              move t_mth30 to wa-sp30.
              ind30 = '1'.
            when t_mth31.
              move tp_sales to wa-mth31.
              move t_mth31 to wa-sp31.
              ind31 = '1'.
            when t_mth32.
              move tp_sales to wa-mth32.
              move t_mth32 to wa-sp32.
              ind32 = '1'.
            when t_mth33.
              move tp_sales to wa-mth33.
              move t_mth33 to wa-sp33.
              ind33 = '1'.
            when t_mth34.
              move tp_sales to wa-mth34.
              move t_mth34 to wa-sp34.
              ind34 = '1'.
            when t_mth35.
              move tp_sales to wa-mth35.
              move t_mth35 to wa-sp35.
              ind35 = '1'.
            when t_mth36.
              move tp_sales to wa-mth36.
              move t_mth36 to wa-sp36.
              ind36 = '1'.
          endcase.
         move seq to itab_seq-seq.
         append itab_seq.
          tp_tabix = sy-tabix.
          if sy-subrc = 0.
         modify table ta_s076 from wa.
            modify ta_s076 from wa index tp_tabix.
            if lp_s076-pmnux = tp_pmnux.
              seq = seq + 1.
              move seq to itab_seq.
              append itab_seq.
            endif.
          else.
            append wa to ta_s076.
            if lp_s076-pmnux = tp_pmnux.
              seq = seq + 1.
              move seq to itab_seq.
              append itab_seq.
            endif.
          endif.
          iseq = iseq + 1.
        endloop.                " endloop for lp_s076.
        itb_sales[] = ta_s076[].
    itb_sales12[] = ta_s076[].
    check if the Display yearly report is being selected *****
      elseif ra_yea = 'X' and
               pa_y_frm <> 0 and
               pa_y_to <> 0.
        clear year1.
        clear year2.
        clear year3.
        perform get_years.
        loop at ta_mat.
          loop at ta_yr.
            clear yr_index.
            yr_index = sy-tabix.
            case yr_index.
              when '1'.
                year1 = ta_yr-year.
              when '2'.
                year2 = ta_yr-year.
              when '3'.
                year3 = ta_yr-year.
            endcase.
            clear yr_frm.
            clear yr_to.
            year_frm = ta_yr-year.
            year_to = ta_yr-year.
            month1 = '01'.
            month12 = '12'.
            concatenate year_frm month1 into yr_frm.
            concatenate year_to month12 into yr_to.
            select * into corresponding fields of table lp_s076 from s076
                                     where pmnux = ta_mat-matnr
                                     and wenux = pa_werks
                                     and vrsio = pa_vrsio
                                     and spmon ge yr_frm
                                     and spmon le yr_to.
          calculate total sales.
            totalsales = 0.
            loop at lp_s076.
              at first.
                sum.
                totalsales = lp_s076-absat.
              endat.
              at end of absat."added by pradeep on 4/07/07
                sum.
                tp_totalprice = lp_s076-absat * ta_mat-stprs.
                itab_bom-requantity = lp_s076-absat * itab_bom-comp_qty / itab_bom-xmeng.
              endat.
            endloop.          "endloop for lp_s076
            select single maktx into tp_maktx from makt
               where matnr = ta_mat-matnr.
            read table ta_s076 into wa with key
              matnr = ta_mat-matnr.
            if sy-subrc ne 0.
              wa-matnr = lp_s076-pmnux.
              wa-maktx = tp_maktx.
            endif.
            case yr_index.
              when '1'.
                move totalsales to wa-sales_y1.
                move tp_totalprice to wa-sales_y1."added by pradeep
                move ta_yr-year to wa-year1.
                ind1 = '1'.
              when '2'.
                move totalsales to wa-sales_y2.
                move tp_totalprice to wa-sales_y2.
                move ta_yr-year to wa-year2.
                ind2 = '1'.
              when '3'.
                move totalsales to wa-sales_y3.
                move tp_totalprice to wa-sales_y3.
                move ta_yr-year to wa-year3.
                ind3 = '1'.
            endcase.
            tp_tabix = sy-tabix.
            if sy-subrc = 0.
                     modify table ta_s076 from wa.
              modify ta_s076 from wa index tp_tabix.
            else.
              append wa to ta_s076.
            endif.
          endloop.        "endloop for ta_yr
        endloop.        "endloop for ta_mat
        itb_sales[] = ta_s076[].
      else.
        exit.
      endif.
    endform.                   "get_sales
    *&      Form  get_months
          text
    form get_months.
      move pa_m_frm to t_mth1.
      perform get_next_few_months
      using t_mth1 '1'
      changing t_mth2.
      perform get_next_few_months
      using t_mth2 '1'
      changing t_mth3.
      perform get_next_few_months
      using t_mth3 '1'
      changing t_mth4.
      perform get_next_few_months
      using t_mth4 '1'
      changing t_mth5.
      perform get_next_few_months
      using t_mth5 '1'
      changing t_mth6.
      perform get_next_few_months
      using t_mth6 '1'
      changing t_mth7.
      perform get_next_few_months
      using t_mth7 '1'
      changing t_mth8.
      perform get_next_few_months
      using t_mth8 '1'
      changing t_mth9.
      perform get_next_few_months
      using t_mth9 '1'
      changing t_mth10.
      perform get_next_few_months
      using t_mth10 '1'
      changing t_mth11.
      perform get_next_few_months
      using t_mth11 '1'
      changing t_mth12.
      perform get_next_few_months
      using t_mth12 '1'
      changing t_mth13.
      perform get_next_few_months
      using t_mth13 '1'
      changing t_mth14.
      perform get_next_few_months
      using t_mth14 '1'
      changing t_mth15.
      perform get_next_few_months
      using t_mth15 '1'
      changing t_mth16.
      perform get_next_few_months
      using t_mth16 '1'
      changing t_mth17.
      perform get_next_few_months
      using t_mth17 '1'
      changing t_mth18.
      perform get_next_few_months
      using t_mth18 '1'
      changing t_mth19.
      perform get_next_few_months
      using t_mth19 '1'
      changing t_mth20.
      perform get_next_few_months
      using t_mth20 '1'
      changing t_mth21.
      perform get_next_few_months
      using t_mth21 '1'
      changing t_mth22.
      perform get_next_few_months
      using t_mth22 '1'
      changing t_mth23.
      perform get_next_few_months
      using t_mth23 '1'
      changing t_mth24.
      perform get_next_few_months
      using t_mth24 '1'
      changing t_mth25.
      perform get_next_few_months
      using t_mth25 '1'
      changing t_mth26.
      perform get_next_few_months
      using t_mth26 '1'
      changing t_mth27.
      perform get_next_few_months
      using t_mth27 '1'
      changing t_mth28.
      perform get_next_few_months
      using t_mth28 '1'
      changing t_mth29.
      perform get_next_few_months
      using t_mth29 '1'
      changing t_mth30.
      perform get_next_few_months
      using t_mth30 '1'
      changing t_mth31.
      perform get_next_few_months
      using t_mth31 '1'
      changing t_mth32.
      perform get_next_few_months
      using t_mth32 '1'
      changing t_mth33.
      perform get_next_few_months
      using t_mth33 '1'
      changing t_mth34.
      perform get_next_few_months
      using t_mth34 '1'
      changing t_mth35.
      perform get_next_few_months
      using t_mth35 '1'
      changing t_mth36.
    endform.                    "get_months
    *&      Form  get_years
          text
    form get_years.
      data : tp_yr_frm(4) type n.
      data : tp_yr_to(4) type n.
      data : yr_diff(4) type n.
      move pa_y_frm to tp_yr_frm.
      move pa_y_to to tp_yr_to.
      move tp_yr_frm to ta_yr-year.
      append ta_yr.
      yr_diff = tp_yr_to - tp_yr_frm.
    *number of years = 3
      if yr_diff = 2.
        do 2 times.
          tp_yr_frm = tp_yr_frm + 1.
          move tp_yr_frm to ta_yr-year.
          append ta_yr.
        enddo.
    *number of years = 2
      elseif yr_diff = 1.
        tp_yr_frm = tp_yr_frm + 1.
        move tp_yr_frm to ta_yr-year.
        append ta_yr.
      else.
        exit.
      endif.
    endform.                    "get_years
    *&      Form  get_next_few_months
          text
         -->LV_CURR_MONTH  text
         -->LV_MONTHS      text
         -->LV_TARGET_MTH  text
    form get_next_few_months using lv_curr_month lv_months
                             changing lv_target_mth.
      data : tp_month_curr like sy-datum,
             tp_month_plus like sy-datum.
      concatenate lv_curr_month '01' into tp_month_curr.
      call function 'SG_PS_ADD_MONTH_TO_DATE'
        EXPORTING
          months  = lv_months
          olddate = tp_month_curr
        IMPORTING
          newdate = tp_month_plus.
      move tp_month_plus(6) to lv_target_mth.
    endform.                    " get_months
    *&      Form  months_calculate
          text
         -->P_DATE1  text
         -->P_DATE2  text
         <--P_EMONTHS  text
    form months_calculate  using    p_date1
                                    p_date2
                           changing p_emonths.
      call function 'FIMA_DAYS_AND_MONTHS_AND_YEARS'
        exporting
          i_date_from          = p_date1
             I_KEY_DAY_FROM       =
          i_date_to            = p_date2
             I_KEY_DAY_TO         =
             I_FLG_SEPARATE       = ' '
       importing
             E_DAYS               =
          e_months             = p_emonths.
             E_YEARS              =
    endform.                    " months_calculate
    *&      Form  retrieve_bom
          text
    -->  p1        text
    <--  p2        text
    form retrieve_bom .
    retrieve BOM components
      sort ta_header by matnr.
      loop at ta_header where stlan = '1' and stlst = '01'.
        tp_bmeng = '1'.
        perform get_bom tables ta_stpo using
                                   ta_header-matnr ta_header-werks  ta_header-stlan ta_header-stlal tp_bmeng.
    requirement quantity calculation for active bom
        perform calculation1.
    retrieve BOM components for pgm
        sort itab_bom2 by idnrk ascending.
        delete adjacent duplicates from itab_bom2 comparing matnr idnrk.
       loop at itab_bom2.         " commented by weihong
        tp_stlan = '1'.
        tp_stlal = '02'.
        perform get_pgm tables ta_stpo12 using
                                   itab_bom2-matnr ta_header-werks  tp_stlan tp_stlal.
       endloop.          " endloop for itab_bom2.(commented by weihong)
    requirement quantity calculation for inactive bom
        perform calculation2.
        refresh : itab_bom1, itab_bom2, itab_pgm, temp_bom1,itab_path.
        clear : itab_bom1, itab_bom2, itab_pgm, temp_bom1,itab_path.
      endloop.      " endloop for ta_header.
    **itab_msale itab_ysale
    *break-point.
      perform display_alv.
    endform.                "retrieve bom
    *&      Form  get_bom
          text
         -->LV_MATNR   text
         -->LV_WERKS   text
         -->LV_STLAN   text
         -->LV_STLAL   text
    form get_bom tables lt_stpo structure stpox
                 using lv_matnr like mast-matnr
                       lv_werks like mast-werks
                       lv_stlan like mast-stlan
                       lv_stlal like stko-stlal
                       lv_emeng like stko-bmeng .
      data: ta_topmat type cstmat,
            tp_dstst like csdata-xfeld,
            ta_matcat type cscmat occurs 0,
            tp_index like sy-tabix,
            tp_stufe like stpox-stufe,
            tp_diff like stpox-stufe,
            tp_indx like sy-tabix,
            tp_date like sy-datum,
            lv_stufe like stpox-stufe,
            lv_wegxx like stpox-wegxx,
            lv_stprs like stpox-stprs,
            lv_waers like stpox-waers,
           lv_cuky_new like cdpos-cuky_new,
           lv_value_new like cdpos-value_new,
            lv_index like sy-tabix,
            lv_datum like sy-datum,"added by pradeep on 02-07-07
            nxt_index like sy-tabix.
    added by weihong.
      data: tp_mtart like mara-mtart,
            tp_matkl like mara-matkl,
            tp_stprs like stpox-stprs,
            tp_bomlv1 like mast-matnr,
            tp_bomlv2 like mast-matnr,
            tp_bomlv3 like mast-matnr,
            tp_bomlv4 like mast-matnr,
            tp_indln type i.
      write : lv_matnr to itab_bom1-matnr.
      write : lv_matnr to itab_bom2-matnr.
      write : lv_matnr to itab_path-matnr.

    Hi gurus,actually this program selecion screen is linked to ..as
    First screen is .Sop
                          .copa
    Again for sop is having a selection screen and in this it is divide based on month and year seperately in two more screens.
    same for copa also....
    so pls tell me a correct solution where to correct and get values.
    Priority is very highhhhhhhhhhhhhh,so pls help me in sorting out this.

  • How to declare in anonymous block

    Declare
    CURSOR c_je2acct_othr
    IS
    SELECT j.jemq_num, j.ml_retail_account,
    -- (CASE WHEN j.exer_type = 4 THEN j.sar_shares ELSE j.shares END) shares, -- removed * -1 from sar_shares Manu 12/02/04
    /* Commented 02/01/07*/
    (CASE WHEN j.exer_type = 4 THEN
    fn_get_shares(u.user_id,u.exer_num,u.soc_sec,j.
    sar_shares)
    ELSE (case when u.exer_type=2 and u.opts_exer!=u.shrs_sold and j.shares=u.shrs_sold then 0 else j.shares end)
    END) shares,
    -- removed * -1 from sar_shares Manu 12/02/04
    j.name_first,
    j.name_last, j.exer_type, j.ml_sec_num, j.ivr_plan_num,
    j.exer_dt, j.grant_dt, j.user_id, j.mlu_rowid, j.settle_dt,
    j.exer_num, j.plan_type, j.grant_num, j.acct_num_othr,
    j.add_cancel,
    /* (CASE WHEN j.exer_type = 4 THEN j.sar_cash_amount * -1 -- turned negative Manu 12/02/04 ml_retail distr
    commented the above line for calculation of proceeds into other account for sar sale.
    (CASE WHEN j.exer_type = 4 THEN
    Pk_Xop_Citibank_Forex.fn_get_netamount(u.user_id,u.
    exer_num,u.soc_sec,
    u.sar_cash_amount,NVL(u.comm_value, 0),
    NVL(u.tot_fee, 0),
    NVL(u.multi_curr_handling_fee, 0))
    -- Removed the negative as on ml_exer_upload all values are +ve.
    ELSE
    ( (DECODE(u.exer_type,0,u.opts_exer * u.mkt_prc,u.shrs_sold * u.mkt_prc
    - ( ROUND((u.opts_exer * NVL (u.opt_prc, 0)),2)
    -- SPIF 39060 Added a Round of condition.
    + DECODE (NVL (u.shrs_wthld_for_taxes, 'N'),
    'Y', 0,
    ROUND (u.tot_tax, 2)
    + u.tot_fee
    + NVL(u.multi_curr_handling_fee,0)
    + u.comm_value
    - u.backup_withholding
    END ) AS gl_amt,
    T.je_othr_mlacct_jemsg AS vc_trailer_desc,
    u.opts_exer ,
    u.shrs_sold,
    u.rsu_type
    FROM TB_XOP_JEMQ j, TB_ML_EXER_UPLOAD u, TB_FC_COMPY T
    WHERE j.q_flag = 'N' AND u.je_flag = 'Y'
    AND j.entry_dttime >= TRUNC (SYSDATE)
    AND j.entry_dttime < TRUNC (SYSDATE) +1
    AND j.source = 'X'
    AND j.acct_num_othr != ' '
    and (case when u.exer_type=2 and u.opts_exer!=u.shrs_sold then  (case when j.shares=u.shrs_sold then 0 else 1 end) else 1 end)=1 FIx for PCTUP00566081
    AND ( disp_flag <> 'D' OR disp_flag IS NULL ) Added by MARAN ARUNACHALAM on 01/25/2011 for PCTUP00493542 Fix
    and j.current_status = '2Q'  removed not required now in new plan
    AND NOT EXISTS (
    SELECT 1
    FROM TB_XOP_JEMQ j2
    WHERE j2.prev_jemq = j.jemq_num
    AND source = 'T'
    AND j.add_cancel = j2.add_cancel
    AND j.user_id = j2.user_id
    AND j.exer_num = j2.exer_num)
    AND j.mlu_rowid = u.ROWID
    AND 'CMS'||T.compy_acronym||'_USER' = j.user_id
    ORDER BY add_cancel DESC;
    v_mlac_mesg VARCHAR2(1000);
    -- JE_OTHR_MLACCT_JEMSG
    BEGIN
    dbms_output.put_line('success');
    FOR v_je2acct_othr IN c_je2acct_othr
    LOOP
    dbms_output.put_line('success1');
    BEGIN
    dbms_output.put_line('success2');
    IF v_je2acct_othr.add_cancel = 'C'
    THEN
    dbms_output.put_line('success3');
    UPDATE TB_XOP_JEMQ
    SET add_cancel = DECODE(current_status,
    'RJ',
    add_cancel,
    'C'),
    q_flag = DECODE(current_status, 'RJ', q_flag, 'N'),
    activ_dt = DECODE(current_status,
    'RJ',
    activ_dt,
    SYSDATE)
    WHERE prev_jemq = v_je2acct_othr.jemq_num
    AND user_id = v_je2acct_othr.user_id
    AND exer_num = v_je2acct_othr.exer_num
    AND source ='T';
    dbms_output.put_line('success4');
    ELSIF v_je2acct_othr.add_cancel = 'A'
    THEN
    dbms_output.put_line('success5');
    -- manipulating amount and shares to transfer when different exercise types
    v_je2acct_othr.gl_amt :=( CASE
    WHEN v_je2acct_othr.exer_type = 0 THEN 0
    WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer
    != v_je2acct_othr.shrs_sold
    THEN v_je2acct_othr.gl_amt
    WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer =
    v_je2acct_othr.shrs_sold
    THEN v_je2acct_othr.gl_amt
    ELSE v_je2acct_othr.gl_amt
    END );
    ---- Commented on 11/01/2006 For Fixing 30585
    /* v_je2acct_othr.shares :=( CASE
    WHEN v_je2acct_othr.exer_type = 0 THEN v_je2acct_othr.opts_exer
    WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer != v_je2acct_othr.shrs_sold
    THEN v_je2acct_othr.opts_exer - v_je2acct_othr.shrs_sold
    WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer = v_je2acct_othr.shrs_sold
    THEN 0
    ELSE v_je2acct_othr.shares
    END );*/
    ---- Commented on 11/01/2006 For Fixing 30585
    v_je2acct_othr.shares :=( CASE
    WHEN v_je2acct_othr.exer_type = 0 THEN v_je2acct_othr.
    Shares
    --- Replaced opts_exer with the Shares amount from the previous journal for fixing 30585
    WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer
    != v_je2acct_othr.shrs_sold and v_je2acct_othr.shares!=0 and v_je2acct_othr.plan_type <> 0 -- Added plantype condition for CQ:PCTUP00493542
    THEN v_je2acct_othr.Shares - v_je2acct_othr.shrs_sold
    --- Replaced opts_exer with the Shares amount from the previous journal for fixing 30585
    WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer =
    v_je2acct_othr.shrs_sold
    THEN 0
    ELSE v_je2acct_othr.shares
    END );
    dbms_output.put_line('success6');
    IF LENGTH(TRIM(v_je2acct_othr.acct_num_othr))=8 OR TRIM(v_je2acct_othr.acct_num_othr) IS NULL
    THEN
    v_mlac_mesg :=NULL;
    ELSE
    v_mlac_mesg :='Check the ml a/c length';
    dbms_output.put_line('success7');
    END IF;
    INSERT INTO TB_XOP_JEMQ
    (jemq_num,
    prev_jemq,
    ml_retail_account,
    wcma_shares,
    shares, wcma_taxes, tax_amt,
    wcma_reimburse,
    reimburse_amt,
    name_first,
    name_last, exer_type,
    ml_sec_num, wcma_bulking, bulking_amt,
    ivr_plan_num,
    exer_dt, grant_dt,
    user_id, source,
    mlu_rowid, settle_dt,
    exer_num, plan_type,
    grant_num,
    vc_trailer_desc, rsu_type
    VALUES (Pk_Xop_Get_Jemqnum.fn_xop_get_jemqnum,
    v_je2acct_othr.jemq_num,
    v_je2acct_othr.acct_num_othr,
    -- 2nd ml_retail_account,
    v_je2acct_othr.ml_retail_account,
    -- move shares from old acct to 2nd acct above
    v_je2acct_othr.shares,
    --this is SHARES
    --wcma_taxes
    0,
    --tax_amt,
    v_je2acct_othr.ml_retail_account,
    -- move gl_amt from old acct to 2nd acct above
    v_je2acct_othr.gl_amt * -1,
    v_je2acct_othr.name_first,
    v_je2acct_othr.name_last, v_je2acct_othr.
    exer_type,
    v_je2acct_othr.ml_sec_num, ' ',
    --wcma_bulking,
    0,
    --bulking_amt,
    v_je2acct_othr.ivr_plan_num,
    v_je2acct_othr.exer_dt, v_je2acct_othr.
    grant_dt,
    v_je2acct_othr.user_id, 'T',
    --source
    v_je2acct_othr.mlu_rowid, v_je2acct_othr.
    settle_dt,
    v_je2acct_othr.exer_num, v_je2acct_othr.
    plan_type,
    v_je2acct_othr.grant_num,
    v_je2acct_othr.vc_trailer_desc,
    v_je2acct_othr.
    rsu_type
    dbms_output.put_line('success8');
    END IF;
    EXCEPTION
    WHEN OTHERS
    THEN
    Pr_Xop_Log_Errors ( 'Code :'
    || NVL(v_mlac_mesg,SQLERRM)
    || ' at '
    || USER
    || 'at sub exec block in pop_je2acct_othr'
    END;
    dbms_output.put_line('success9'); -- end of begin within loop
    END LOOP;
    --COMMIT;
    EXCEPTION
    WHEN OTHERS
    THEN
    Pr_Xop_Log_Errors ( 'Code :'
    || NVL(v_mlac_mesg,SQLERRM)
    || ' at '
    || USER
    || 'at pk_xop_jemq.pop_je2acct_othr'
    dbms_output.put_line('success10');
    END;}
    {ORA-06550: line 10, column 31:
    PL/SQL: ORA-00904: "FN_GET_SHARES": invalid identifier
    ORA-06550: line 6, column 11:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 81, column 17:
    PLS-00364: loop index variable 'V_JE2ACCT_OTHR' use is invalid
    ORA-06550: line 81, column 14:
    PL/SQL: Statement ignored}
    HI friends, as i am getting two errors when running code in the anonymous block, then how to declare that 2 errors in declare section plz guide me}

    Noone, will read your code unless it is formatted like below. See the comments added
    DECLARE
      CURSOR c_je2acct_othr
      IS
        SELECT j.jemq_num,
          j.ml_retail_account,
          -- (CASE WHEN j.exer_type = 4 THEN j.sar_shares ELSE j.shares END) shares, -- removed * -1 from sar_shares Manu 12/02/04
          /* Commented 02/01/07*/
          CASE
            WHEN j.exer_type = 4
    --"The current user is not seeing the below function fn_get_shares.Privilege issue probably.
            THEN fn_get_shares(u.user_id,u.exer_num,u.soc_sec,j. sar_shares)
            ELSE (
              CASE
                WHEN u.exer_type=2
                AND u.opts_exer!=u.shrs_sold
                AND j.shares    =u.shrs_sold
                THEN 0
                ELSE j.shares
              END)
          END) shares,
          -- removed * -1 from sar_shares Manu 12/02/04
          j.name_first,
          j.name_last,
          j.exer_type,
          j.ml_sec_num,
          j.ivr_plan_num,
          j.exer_dt,
          j.grant_dt,
          j.user_id,
          j.mlu_rowid,
          j.settle_dt,
          j.exer_num,
          j.plan_type,
          j.grant_num,
          j.acct_num_othr,
          j.add_cancel,
          /* (CASE WHEN j.exer_type = 4 THEN j.sar_cash_amount * -1 -- turned negative Manu 12/02/04 ml_retail distr
          commented the above line for calculation of proceeds into other account for sar sale.
          CASE
            WHEN j.exer_type = 4
            THEN Pk_Xop_Citibank_Forex.fn_get_netamount(u.user_id,u. exer_num,u.soc_sec, u.sar_cash_amount,NVL(u.comm_value, 0), NVL(u.tot_fee, 0), NVL(u.multi_curr_handling_fee, 0))
              -- Removed the negative as on ml_exer_upload all values are +ve.
            ELSE ( (DECODE(u.exer_type,0,u.opts_exer * u.mkt_prc,u.shrs_sold * u.mkt_prc )) - ( ROUND((u.opts_exer * NVL (u.opt_prc, 0)),2)
              -- SPIF 39060 Added a Round of condition.
              + DECODE (NVL (u.shrs_wthld_for_taxes, 'N'), 'Y', 0, ROUND (u.tot_tax, 2) ) + u.tot_fee + NVL(u.multi_curr_handling_fee,0) + u.comm_value ) - u.backup_withholding )
          END )                  AS gl_amt,
          T.je_othr_mlacct_jemsg AS vc_trailer_desc,
          u.opts_exer ,
          u.shrs_sold,
          u.rsu_type
        FROM TB_XOP_JEMQ j,
          TB_ML_EXER_UPLOAD u,
          TB_FC_COMPY T
        WHERE j.q_flag       = 'N'
        AND u.je_flag        = 'Y'
        AND j.entry_dttime  >= TRUNC (SYSDATE)
        AND j.entry_dttime   < TRUNC (SYSDATE) +1
        AND j.source         = 'X'
        AND j.acct_num_othr != ' '
          --and (case when u.exer_type=2 and u.opts_exer!=u.shrs_sold then (case when j.shares=u.shrs_sold then 0 else 1 end) else 1 end)=1 -- FIx for PCTUP00566081
          --AND ( disp_flag <> 'D' OR disp_flag IS NULL ) -- Added by MARAN ARUNACHALAM on 01/25/2011 for PCTUP00493542 Fix
          --and j.current_status = '2Q' -- removed not required now in new plan
        AND NOT EXISTS
          (SELECT 1
          FROM TB_XOP_JEMQ j2
          WHERE j2.prev_jemq = j.jemq_num
          AND source         = 'T'
          AND j.add_cancel   = j2.add_cancel
          AND j.user_id      = j2.user_id
          AND j.exer_num     = j2.exer_num
      AND j.mlu_rowid = u.ROWID
      AND 'CMS'
        ||T.compy_acronym
        ||'_USER' = j.user_id
      ORDER BY add_cancel DESC;
      v_mlac_mesg VARCHAR2(1000);
      -- JE_OTHR_MLACCT_JEMSG
    BEGIN
      dbms_output.put_line('success');
      FOR v_je2acct_othr IN c_je2acct_othr
      LOOP
        dbms_output.put_line('success1');
        BEGIN
          dbms_output.put_line('success2');
          IF v_je2acct_othr.add_cancel = 'C' THEN
            dbms_output.put_line('success3');
            UPDATE TB_XOP_JEMQ
            SET add_cancel  = DECODE(current_status, 'RJ', add_cancel, 'C'),
              q_flag        = DECODE(current_status, 'RJ', q_flag, 'N'),
              activ_dt      = DECODE(current_status, 'RJ', activ_dt, SYSDATE)
            WHERE prev_jemq = v_je2acct_othr.jemq_num
            AND user_id     = v_je2acct_othr.user_id
            AND exer_num    = v_je2acct_othr.exer_num
            AND source      ='T';
            dbms_output.put_line('success4');
          ELSIF v_je2acct_othr.add_cancel = 'A' THEN
            dbms_output.put_line('success5');
            -- manipulating amount and shares to transfer when different exercise types
    --"You cannot assign values to the recor variable declared for a loop. Either define seperate variables or use explicit record variable"
            v_je2acct_othr.gl_amt :=
              CASE
              WHEN v_je2acct_othr.exer_type = 0 THEN
                0
              WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer != v_je2acct_othr.shrs_sold THEN
                v_je2acct_othr.gl_amt
              WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer = v_je2acct_othr.shrs_sold THEN
                v_je2acct_othr.gl_amt
              ELSE
                v_je2acct_othr.gl_amt
              END );
            ---- Commented on 11/01/2006 For Fixing 30585
            /* v_je2acct_othr.shares :=( CASE
            WHEN v_je2acct_othr.exer_type = 0 THEN v_je2acct_othr.opts_exer
            WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer != v_je2acct_othr.shrs_sold
            THEN v_je2acct_othr.opts_exer - v_je2acct_othr.shrs_sold
            WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer = v_je2acct_othr.shrs_sold
            THEN 0
            ELSE v_je2acct_othr.shares
            END );*/
            ---- Commented on 11/01/2006 For Fixing 30585
            v_je2acct_othr.shares :=
              CASE
              WHEN v_je2acct_othr.exer_type = 0 THEN
                v_je2acct_othr. Shares
                --- Replaced opts_exer with the Shares amount from the previous journal for fixing 30585
              WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer != v_je2acct_othr.shrs_sold AND v_je2acct_othr.shares!=0 AND v_je2acct_othr.plan_type 0 -- Added plantype condition for CQ:PCTUP00493542
                THEN
                v_je2acct_othr.Shares - v_je2acct_othr.shrs_sold
                --- Replaced opts_exer with the Shares amount from the previous journal for fixing 30585
              WHEN v_je2acct_othr.exer_type = 2 AND v_je2acct_othr.opts_exer = v_je2acct_othr.shrs_sold THEN
                0
              ELSE
                v_je2acct_othr.shares
              END );
            dbms_output.put_line('success6');
            IF LENGTH(TRIM(v_je2acct_othr.acct_num_othr))=8 OR TRIM(v_je2acct_othr.acct_num_othr) IS NULL THEN
              v_mlac_mesg                               :=NULL;
            ELSE
              v_mlac_mesg :='Check the ml a/c length';
              dbms_output.put_line('success7');
            END IF;
            INSERT
            INTO TB_XOP_JEMQ
                jemq_num,
                prev_jemq,
                ml_retail_account,
                wcma_shares,
                shares,
                wcma_taxes,
                tax_amt,
                wcma_reimburse,
                reimburse_amt,
                name_first,
                name_last,
                exer_type,
                ml_sec_num,
                wcma_bulking,
                bulking_amt,
                ivr_plan_num,
                exer_dt,
                grant_dt,
                user_id,
                source,
                mlu_rowid,
                settle_dt,
                exer_num,
                plan_type,
                grant_num,
                vc_trailer_desc,
                rsu_type
              VALUES
                Pk_Xop_Get_Jemqnum.fn_xop_get_jemqnum,
                v_je2acct_othr.jemq_num,
                v_je2acct_othr.acct_num_othr,
                -- 2nd ml_retail_account,
                v_je2acct_othr.ml_retail_account,
                -- move shares from old acct to 2nd acct above
                v_je2acct_othr.shares,
                --this is SHARES
                --wcma_taxes
                0,
                --tax_amt,
                v_je2acct_othr.ml_retail_account,
                -- move gl_amt from old acct to 2nd acct above
                v_je2acct_othr.gl_amt * -1,
                v_je2acct_othr.name_first,
                v_je2acct_othr.name_last,
                v_je2acct_othr. exer_type,
                v_je2acct_othr.ml_sec_num,
                --wcma_bulking,
                0,
                --bulking_amt,
                v_je2acct_othr.ivr_plan_num,
                v_je2acct_othr.exer_dt,
                v_je2acct_othr. grant_dt,
                v_je2acct_othr.user_id,
                'T',
                --source
                v_je2acct_othr.mlu_rowid,
                v_je2acct_othr. settle_dt,
                v_je2acct_othr.exer_num,
                v_je2acct_othr. plan_type,
                v_je2acct_othr.grant_num,
                v_je2acct_othr.vc_trailer_desc,
                v_je2acct_othr. rsu_type
            dbms_output.put_line('success8');
          END IF;
        EXCEPTION
        WHEN OTHERS THEN
          Pr_Xop_Log_Errors ( 'Code :' || NVL(v_mlac_mesg,SQLERRM) || ' at ' || USER || 'at sub exec block in pop_je2acct_othr' );
        END;
        dbms_output.put_line('success9'); -- end of begin within loop
      END LOOP;
      --COMMIT;
    EXCEPTION
    WHEN OTHERS THEN
      Pr_Xop_Log_Errors ( 'Code :' || NVL(v_mlac_mesg,SQLERRM) || ' at ' || USER || 'at pk_xop_jemq.pop_je2acct_othr' );
      dbms_output.put_line('success10');
    END;
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 

  • Bulk Collect matter

    hi,
    I want to insert data in lead_bms_time table using collection. This query fetch records from loop.
    how can i insert as fast as in table .
    Oracle Database 10g.
    create or replace procedure bms_act_lead_times(p_abc_id number,p_div_id number,p_item_code varchar2,p_act_lt number)
    as
      v_post_proc number := 0;
      v_proc number := 0;
      v_pre_proc number := 0;
      v_cnt number := 0;
      v_tot number :=0;
      v_org_id number;
    begin
    select distinct operating_unit into v_org_id
    from org_organization_definitions
    where organization_id = p_div_id;
    fnd_client_info.set_org_context(v_org_id);
    delete from websupp.lead_bms_time
          where abc_id = p_abc_id
             and organization_id = p_div_id;
    commit;          
                for j in (
                           select trunc(rt.receipt_date) receipt_date,
                                    rt.po_num
                             from rcv_vrc_txs_vendint_v rt,
                                     websupp.BMS_COMP_EXPLORE ce --websupp.comp_exp ce
                            where ce.child_item_id = rt.item_id
                               and ce.organization_id = rt.organization_id
                               and rt.transaction_type = 'RECEIVE'
                              and rt.organization_id = p_div_id
                               and ce.child_item = p_item_code
                              and (rt.transaction_date) >= add_months(add_months(trunc(last_day(sysdate)),-1),(-1*p_act_lt))+1
                              and (rt.transaction_date) <= add_months(trunc(last_day(sysdate)),-1)+1     
    --                          and rt.receipt_num = i.receipt_num
               loop
                     --v_post_proc := i.deliver_date - j.receipt_date;
                    for k in (select trunc(pol.creation_date) po_date,
                                               poh.po_header_id,
                                         pol.po_line_id
                                from po_headers_all poh,
                                         po_lines_all pol
                                 where poh.po_header_id = pol.po_header_id
                                    and poh.org_id = pol.org_id
                                    and poh.segment1 = j.po_num
                    loop
                      v_proc := j.receipt_date - k.po_date;
                      for r in (select  trunc(prl.creation_date) pr_date
                                      from po_requisition_lines_all prl,
                                             po_line_locations_all pll
                                    where pll.line_location_id = prl.line_location_id
                                        and pll.po_header_id = k.po_header_id
                                       and pll.po_line_id = k.po_line_id
                        loop
                           v_pre_proc := k.po_date - r.pr_date;
                         end loop;
                    end loop;
              -- end loop;
               v_tot := v_tot + nvl(v_pre_proc,0)+nvl(v_proc,0); ----+nvl(v_post_proc,0);
          end loop;
           insert into lead_bms_time values(p_abc_id,p_div_id,p_item_code,v_tot,sysdate);
           commit;
    exception
    when others then raise; ---return 0;     
    end;Thanks.

    >
    How can i use INSERT statement before loop?
    >
    The simplest way is to modify you code and replace the first two loops with table expressions.
    So instead of
    for j in (
       select trunc(rt.receipt_date) receipt_date,  rt.po_num
    loop
       for k in (select trunc(pol.creation_date) po_date,
      loopReplace those two with a table expression
    WITH j as (
       select trunc(rt.receipt_date) receipt_date,  rt.po_num
      k as (select trunc(pol.creation_date) po_date,
             from j,
                    po_headers_all poh,
                    po_lines_all pol
        where poh.po_header_id = pol.po_header_id
           and poh.org_id = pol.org_id
            and poh.segment1 = j.po_num
    select ... -- this replaces the 'r' loop and queries the 'k' table expression instead.Also - you may have a bug in your date calculations
          and (rt.transaction_date) >= add_months(add_months(trunc(last_day(sysdate)),-1),(-1*p_act_lt))+1
          and (rt.transaction_date) <= add_months(trunc(last_day(sysdate)),-1)+1     The code above (2nd line) will INCLUDE data for the 1st day of the terminating month if the time component is 00:00:00 and that data (if there is any) shouldl probably belong to the next period.
    In other words your code is equivalent to the BETWEEN operator which INCLUDES both endpoints.
    The second line condition should probably not include the equal sign.
    Also since those start/end dates are basically constants I would creating two new variables, v_start_date and v_end_date, and precalculate those values before using them in the query.
    Oracle should only do those computations one time but precalculation will make the query less cluttered and more readable.
    And you can add comments to explain what the calculations do.
    >
    -- calculate the start date as the first of the month passed as the p_act_lt parameter
    v_start_date := . . .
    -- calculate the end date as the end of the month prior to SYSDATE
    v_end_date := . . .

  • [svn] 4394: Adding last changes and comments on behalf of Kaushal for his radial and linear gradient transform calculations .

    Revision: 4394
    Author: [email protected]
    Date: 2009-01-05 13:13:51 -0800 (Mon, 05 Jan 2009)
    Log Message:
    Adding last changes and comments on behalf of Kaushal for his radial and linear gradient transform calculations.
    QE: Not yet.
    Doc: No
    Checkintests: Pass
    Modified Paths:
    flex/sdk/trunk/modules/fxgutils/src/java/flash/fxg/swf/AbstractFXGGraphics.java
    flex/sdk/trunk/modules/fxgutils/src/java/flash/fxg/swf/TypeHelper.java

    After posting I and lots of research I realized that I need to dive into
    PaperVision 3D as way to get where I need to go.
    However, if anyone has a solution to adding text to this code which rotates with the cube - let me know.
    Thanks

  • Comment fait ont les exposant avec la calculatrice scientifique ??

    jaimerais utiliser ma calculatrice mais ne sais pas comment
    faire pour faire un exposant (puissance) a mon nombre

    Google translate:
    Hello!
    I recently purchased an iPod Touch because the former broke. I started to use this iPod before you even have synchronized with my PC.
    Upon arriving home, I synced the iPod with the data backup of the old Ipod. After this synchronization, all the pictures I had taken were replaced by old photos. How can I retrieve the photographs taken before synchronization?
    - Did you backup the the first iPod after you took the photos that were missing? If not then they are not in the backup.
    - Was the date of the backup that you restored from consistent with having the missing photos?
    - If you had PhotoStream turned on for the first iPod then you may be able to get them from yur PhotoStream. See:
    iOS: Importing personal photos and videos from iOS devices to your computer

  • Comment obtenir des calculs exacts avec la précision affichée (les arrondis engendrent des résultats faux)

    Comment obtenir des calculs exacts avec la précision affichée (les arrondis engendrent des résultats faux)

    Apprenez à vous servir d'un ordinateur.
    Écrire "les arrondis engendrent des résultats faux" prouve simplement que vous n'avez rien compris à ce que vous faites.
    Quand vous demandez à Numbers d'afficher les nombres avec deux décimales, cela s'applique à l'affichage, pas au contenu des cellules.
    1234,567 sera affiché 1234,57 mais la valeur stockée restera égale à 1234,567.
    De ce fait un gamin de cinq ans peut comprendre que la somme des arrondis affichés peut être différente de l'arrondi de la somme des valeurs stockées.
    La solution est simple et a été décrite ici à de multiples reprises : travailler de façàn cohérente.
    Si vous devez calculer la somme de valeurs arrondies, faites en sorte que les valeurs stockées soient égales aux valeur affichées.
    Calculer un montant de TVA avec la formule
    = brut * 0,196 est ridicule  puisqu'on a de fortes chances d'avoir trois chiffres après la virgule.
    Le véritable montant de la TVA se calcule avec
    =ARRONDI(brut * 0,196;2)
    Prenez-soin d'utiliser des formules correctes et vous aurez des résultats corrects ou plutot des résultats correspondant à votre attente.
    Yvan KOENIG (VALLAURIS, France) jeudi 11 août 2011 12:40:45
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.8 and 10.7.0
    My iDisk is : <http://public.me.com/koenigyvan>
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Bonjour, suite à la mise à jour de numbers j'ai perdu toutes mes feuilles de calcul est ce que l'un de vous saurez comment les retrouver ?

    Bonjour
    Après avoir fait la dernière mise à jour numbers sous iOS 703 je n'ai plus aucune des mes feuilles de calcul
    Je ne sais même pas si il y avait une sauvegarde quelque part
    De plus en ouvrant numbers ma page est apparu puis plus rien mais plus aucune feuilles
    Je ne sais pas comment faire pour retrouver mes feuilles
    Quelqu'un peut il m'aider ?
    Merci à tous.

    If I read the translation properly, I think that the iPad may have switched app stores when you updated the iOS. If that is what happened, change to store to your store.
    Launch the App Store app and swipe to the bottom of the screen in the featured tab. Tap on your Apple ID. Then tap on View Apple ID in the window that pops up. Enter your password. Then go to Country/Region in the next pop up window and tap the flag in that line to take you to a window where you can change to your country's store.

  • Why does commenting out calculated member formulas in BIDs cause several minutes of CPU spike and non-responsive BIDs?

    I'm using SQL Server 2012.  I have noticed that commenting out calculated member formulas in BIDs (like even just 10 lines of formula) can cause BIDs to throttle all the CPU and become unresponsive for minutes.  What could be the cause of that?

    Hi Lee,
    According to your description, you get high CPU usage when commenting out the calculated member formulas. Right?
    With your information, we are not sure this is a MDX Query performance issue or the BIDS issue.  We suggest you optimize your MDX query and diagnose the Formula Engine performance. Please refer to the links below:
    Query Performance Tuning in Microsoft Analysis Services: Part 2
    Analysis Services Query Performance Top 10 Best Practices
    If possible, please post some screenshots or detail information about calculated member formulas so that we can have some deep analysis.
    Best Regards,
    Simon Hou
    Simon Hou
    TechNet Community Support

  • Comment calculer la taille d'une pièce

    Bonjour, s'il vous plait qui peut m'aider pour une programmation dans laquelle je peux calculer la taille de n'importe quels pièces aprés avoir l'acquiser sur labview et merci d'avance.

    Salut,
    Menu Fichier : Enregistrer-sous un autre : Fichier PDF Optimisé
    Plus de détails ici :
    http://help.adobe.com/fr_FR/acrobat/using/WS58a04a822e3e50102bd615109794195ff-7c88.w.html# WS58a04a822e3e50102bd615109794195ff-7c87.w

  • Besoin d'idées de programmation :Comment calculer une distance entre 2 obstacles avec NXT minstorm

    salut
    je dois déterminer la distance avec le NXT mindstorm entre deux obstacles  et ensuite comparer cette distance a la taille de ma voiture et faire un creneau comme sur la video que j'ai mi en piece jointe http://dl.free.fr/obRxbi3EV Mais je bloque est ce que quelqu'un aurait des idées qui pourrait m'orienter un peu. Je laisse mon vi
    Pièces jointes :
    why not.vi ‏26 KB

    Je vois un peu ton problème, c'est plus au niveau de la conception de l'algorithme et de la mise en place de celui-ci sous labview.
    REAPEAT
    Faire rouler la voiture à l'infini
    Repeat 
            test capteur de position > à une certaine distance
            if capteur de position < distance
                ralentir moteur
                repeat
                          lecture capteur position
                until capteur position > à une certaine distance ( fin du premier obstacle et donc début de mesure de la course)
    Repeat
               test capteur de position
               read motor (pour avoir la distance parcourue)
    until test capteur position < distance
    If distance parcourue > longueur voiture do créneau
    else
          continue
    UNTIL STOP
    Cela peut être un algo (c'est vite fait et sans test cel apeut aider)
    Greg S.
    CNRS
    LV 7.1 8.2 8.6 2009 2011 2012 2013
    LPMC - CNRS
    N'oubliez pas de complimenter cela fait toujours plaisir.

  • Month calculations: DATE() vs EDATE()

    In a recent topic (Challenge to get a date correctly), I mentioned using the DATE function to calculate a date that is (for example) one month later than a given one. Specifically, if cell A1 contains the given date, then I suggested using this formula for a date one month later:
    =DATE(YEAR(A1),MONTH(A1)+1,DAY(A1))
    Yvan Koenig suggested instead using the simpler EDATE formula, here equivalent to:
    EDATE(A1,1)
    There is, as it turns out, more than simplicity in favor of Yvan's approach. While one might expect the two formulas always to produce the same results, they do not! This is easily seen by constructing the following three column table with a column header:
    1. In cell A2, enter the last day of the first month of this year (January 31, 2008 in the U.S. system, for example). In the cell below it, enter the last day of the second month of this year (Feburary 29, 2008, for example).
    2. Next, select both cells & use the circular fill handle, drawing down to fill the column with a year or so of last-day-of month values.
    3. Select cell B1 (a header cell) & enter in the formula bar & press return:
    =DATE(YEAR(A),MONTH(A)+1,DAY(A))
    4. Likewise, in cell C1 enter:
    =EDATE(A,1)
    Note that the B & C column values are sometimes the same, sometimes not. The same results occur if the "1" in both formulas is replaced with another number of months.
    What seems to be happening is the 'MONTH(A)+n' expression uses the number of days in the month of the "A" cell value as the basis for the 'n months later' calculation, which is not the convention usually used for such things as billing cycles. The EDATE formula follows the normal convention, & is thus the preferred choice for almost all uses imaginable ... unless perhaps you are the one being billed.
    This also applies to 'YEAR(A) + n' calculations.
    So, it would seem that any calculation involving the DATE(year, month, day) form with an arithmetic operator in the year or month element should be used only with great care, if at all.
    BTW, the comments about the month unit of calendar time having "no real purpose today" in http://www.cl.cam.ac.uk/~mgk25/iso-time.html may be of interest.

    I'm aware of the blue warning triangle appearing in these "overflow" situations; however, even when it does not, the results may be different -- for example, with a starting date of January 31st, adding one month in my long formula produces a month argument that is in bounds but (for 2008) yields a date 2 days later than with the EDATE method.
    I don't view this so much a bug as a consequence of the vague nature of the "n months later" or of the "month offset" concept. As the cited scholarly article points out, the concept of the months of the year are of somewhat obscure mystic origins, & there lengths were arbitrarily set, often for reasons more political than practical. Between the 1st & 28th day of any month, the concept is unambiguous -- it is the same numbered day in the other month, but for the 29th through 31st day of the month it is not, depending on the starting month.
    From what little I have been able to discover from casual research, the EDATE results are the standard more by custom than by any well-defined rule: what we mean by the offset references the first, last, or some near-the-end-of-the-month day number, whichever seems the most suitable at the time.
    I do not have Excel on my Macs, but since the functions are similar, I would be interested in learning how that application behaves with this table.

  • Can we show comments in adhoc query?

    Hello All,
           Can we put comments in Adhoc query?
           I have a comment icon in infotype 9903.
           I need to fetch that particular comments and show in a query output. It is not a field.
           Can we do this? If yes, then please let me know how?
    Cheers,
    Darshna.

    I did it sometime back. A bit complicated process.
    Create an infoobject, manually enter the values "keyfig1" and "keyfig2".
    Include this infoobject in the filters and restrict it using a "ready for input" variable.
    Now create two formula variables.
    Write a customer exit such that when you select "keyfig1", first formula variable's value should be set to 1 and other one's to 0.
    Then in the query create two calculated key figures, multiply both with the formula variable. Also supress column (all active value == 0).
    Then it will show the key figure which you have selected.
    Pravender

Maybe you are looking for

  • Should I use a servlet? - please help

    Hi, This is my problem: I have a class (say, DBClass) that connects to the database - it has general functions for insertion, updation, and deletion. I have some other classes that use the DBClass to perform insert, update, delete operations on diffe

  • I dont have imovie on my iphone 6 64gb now after that i restored it from itunes

    i bought my iphone 6 64 gb and i had imovie and all the apples on it preinstalled now that i restored it from itunes i dont have the apps and when i go to app store it asks me to buy them i want them for free as i had them when i first used my phone

  • Database copy problem

    Hello, I have cloned the databse to a new server using a cold backup. I used alter database backup controlfile to trace as '/home/oracle/control.sql' on the source database and recreated the controlfiles on the target database. Everything works fine.

  • Need workflow for Advanced Analysis for Office for Sizing

    Hi, I am in the process of sizing for BO solution . Part of that exercise is to find out how much cpu and memory are required for AAO? So i thought trace the AAO workflow and understand which BO services/servers it requires. If anyone any idea about

  • Itunes 11.1.4 erased my library on install OS 10.9.1

    I clicked on update this pass Friday for itunes 11.1.4. Upone iTunes reopening my library was empty. I tried several methods of importing my library via old library/ and or xml files. This did not work. I spent 2 1/2 days reimporting all my music/app