2nd Previous Period from the current period

Hi MM Gurus,
Is it possible in MM to open a 2nd previous from the current period?
Please advise,
Thanks,
Themba

hi,
> Check the OSS NOTE 487381
You can only open the last period via using the MMPI..using indicator allow back posting...
Other than this you can open pervious periods for sandbox techniques. as well ....but SAP don't recommend it...
check few posted threads on SDN...
Regards
Priyanka.P
Edited by: Priyanka Paltanwale on Jun 2, 2009 9:52 AM

Similar Messages

  • Calculate previous Sunday from the current day

    Hi Gurus,
    Can anybody tell what is the name of the function module which caluclates the previous Sunday from the Current system date. or any other idea how to calculate previous sunday from the current system date in Query.
    Thanks
    Liza

    Hello,
    See my previous thread to you for a similar Re: Find out previous Monday based on 0CALDAY
    Thanks
    Chandran

  • Previous quarter from the current date using Date functions

    hi all,
    how can i get the value of the previous quarter and previous month using using NOW() function in the formula.
    regards,
    Rk
    Edited by: Rk on Feb 13, 2009 9:28 AM

    Hi Pk,
    This "DSTR(DADD(NOW(),-1,'Q'),'YYYYQ')" will give you just an year 2008 (if you run this today).
    But this "DSTR(DADD(NOW(),-1,'Q'),'YYYYMM)" will give you an year and month of prev quarter
    200811(if you run this today)
    Ola

  • Changing the Current Period to last month

    Hello,
    I am trying to change the Current period to last month so I will be able to
    re-enter a material update document from 31.12.2006
    Can anyone tell me where do I change the Current posting period ?
    -Mark

    Hello Mark,
    You can open / Initialize previous period with MMPI transaction, however, using this T-code please go through <b>OSS note 487381</b>, the main contents as as follow:
    Before you start period closing with initialization, you must be aware of the consequences of period closing with initialization.This note describes the possible data inconsistencies that might occur if you carry out the initialization in a productive system.The resulting inconsistencies are not to be traced back to a system error but they are a result of the period closing program with initialization
    The initialization of the posting period to a previous or to any posting period may lead to the loss of the information of the inventory balances of the previous periods.The book value of the current posting period is taken as the basis also for values of the previous period in this case.
    If you want to continue working with this new posting period, in addition you should execute report Z_DEL_HIST_ENTRIES attached so that history entries greater or equal to the new posting period will be deleted.
    Hope this helps.
    Regards
    Arif Mansuri
    Reward if answer is helpful

  • Fetch the netprice from the validity period which always matches with the

    Let me describe the same.
    Suppose the PO creation date is 04.07.2007
    The conditions for an item in a contract for the PO are as follows;
    1. Validity from 04.07.2007 validity to 04.07.2007 Netprice = 100.00
    2. Validity from 05.07.2007 validity to 31.12.9999 Netprice = 200.00
    We need to always fetch the netprice from the validity period which always matches with the PO creation date. here the value 100.00 should be the correct netpr as the PO creation date matches with the first validity period.
    But the program is fetching the netprice 200.000 which belongs to the second validity period. That is beacuse the select statement which fetches the data for contracts collects on the basis of EKKO-kdate and ekko-kdtab.the fields kdate and kdtab retrieves the validity period of the contract which is from 04.07.2007 to 31.072007. This data is then used to retrieve the netpr data from EKPO and it fetched 200.00 as it retrives the netprice of current data in contract validity and h not with respect to PO creation date.
    This data is then used to fetch the get the netpr data from EKPO.
    what we need is the netprice for that validity period of item(Conditions) that matches with the PO creation date..
    Below is the code where I'm selecting the data from ekko and ekpo for the contracts data..Can you please add the code snippet to the below attachesd subroutine to get the required data from KONV and KONP so that we can retrieve the correct Netprice.
    FORM select_contracts USING p_s_cebeln LIKE s_cebeln[]
    p_c_k_bstyp TYPE ebstyp
    p_p_bukrs TYPE bukrs
    p_p_ekorg TYPE ekorg
    p_p_ekgrp TYPE bkgrp
    *Begin of Mod-004
    fp_p_cernam type ty_r_ernam
    p_p_cernam TYPE ernam
    *End of Mod-004
    p_s_werks LIKE s_werks[]
    p_s_matnr LIKE s_matnr[]
    p_s_lifnr LIKE s_lifnr[]
    p_s_val_dt LIKE s_val_dt[].
    *mod-002
    data : l_amount type BAPICURR_D, " Net price
    l_waers TYPE waers, " Currency Key
    l_eff_amount type BAPICURR_D. " Effective value
    data: l_v_netpr type bprei.
    *mod-002
    SELECT ebeln
    bukrs
    bstyp
    aedat
    ernam
    lifnr
    zterm
    ekorg
    ekgrp
    waers
    wkurs
    kdatb
    kdate
    inco1
    INTO TABLE i_ekko
    FROM ekko
    WHERE ebeln IN p_s_cebeln
    AND bstyp EQ p_c_k_bstyp
    AND bukrs EQ p_p_bukrs
    AND ekorg EQ p_p_ekorg
    AND ekgrp EQ p_p_ekgrp
    *Begin of Mod-004
    AND ernam EQ p_p_cernam
    AND ernam IN fp_p_cernam
    *End of Mod-004
    AND lifnr IN p_s_lifnr
    AND ( kdatb IN p_s_val_dt OR kdate IN p_s_val_dt ).
    IF sy-subrc EQ 0.
    Populates internal table i_ekpo using EKPO table.
    SELECT ebeln
    ebelp
    loekz
    txz01
    matnr
    werks
    ktmng
    menge
    meins
    bprme
    netpr
    peinh
    webaz
    mwskz
    uebto
    untto
    erekz
    pstyp
    knttp
    repos
    webre
    konnr
    ktpnr
    ean11
    effwr
    xersy
    aedat
    prdat
    INTO TABLE i_ekpo
    FROM ekpo
    FOR ALL ENTRIES IN i_ekko
    WHERE ebeln = i_ekko-ebeln
    and aedat = i_ekko-aedat
    AND werks IN p_s_werks
    AND matnr IN p_s_matnr.
    LOOP AT i_ekpo INTO rec_ekpo.
    MOVE rec_ekpo-ebeln TO rec_contr-ebeln.
    MOVE rec_ekpo-ebelp TO rec_contr-ebelp.
    MOVE rec_ekpo-loekz TO rec_contr-loekz.
    MOVE rec_ekpo-txz01 TO rec_contr-txz01.
    MOVE rec_ekpo-matnr TO rec_contr-matnr.
    MOVE rec_ekpo-werks TO rec_contr-werks.
    MOVE rec_ekpo-ktmng TO rec_contr-ktmng.
    MOVE rec_ekpo-menge TO rec_contr-menge.
    MOVE rec_ekpo-meins TO rec_contr-meins.
    MOVE rec_ekpo-bprme TO rec_contr-bprme.
    MOVE rec_ekpo-netpr TO rec_contr-netpr.
    move l_v_netpr TO rec_contr-netpr.
    mod-002
    read table i_ekko into rec_ekko with key
    ebeln = rec_ekpo-ebeln.
    l_waers = rec_ekko-waers.
    CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_EXTERNAL'
    EXPORTING
    currency = l_waers
    amount_internal = rec_contr-netpr
    IMPORTING
    AMOUNT_EXTERNAL = l_amount.
    rec_contr-netpr = l_amount.
    mod-002
    MOVE rec_ekpo-peinh TO rec_contr-peinh.
    MOVE rec_ekpo-webaz TO rec_contr-webaz.
    MOVE rec_ekpo-mwskz TO rec_contr-mwskz.
    MOVE rec_ekpo-uebto TO rec_contr-uebto.
    MOVE rec_ekpo-untto TO rec_contr-untto.
    MOVE rec_ekpo-erekz TO rec_contr-erekz.
    MOVE rec_ekpo-pstyp TO rec_contr-pstyp.
    MOVE rec_ekpo-knttp TO rec_contr-knttp.
    MOVE rec_ekpo-repos TO rec_contr-repos.
    MOVE rec_ekpo-webre TO rec_contr-webre.
    MOVE rec_ekpo-konnr TO rec_contr-konnr.
    MOVE rec_ekpo-ktpnr TO rec_contr-ktpnr.
    MOVE rec_ekpo-ean11 TO rec_contr-ean11.
    MOVE rec_ekpo-effwr TO rec_contr-effwr.
    mod-002
    CALL FUNCTION 'BAPI_CURRENCY_CONV_TO_EXTERNAL'
    EXPORTING
    currency = l_waers
    amount_internal = rec_contr-effwr
    IMPORTING
    AMOUNT_EXTERNAL = l_eff_amount.
    rec_contr-effwr = l_eff_amount.
    *mod-002
    MOVE rec_ekpo-xersy TO rec_contr-xersy.
    APPEND rec_contr TO i_contr.
    CLEAR: rec_ekpo,rec_contr.
    mod-002
    CLEAR : rec_ekko,l_amount, l_eff_amount,l_waers.
    mod-002
    ENDLOOP.
    Modifying i_contr using i_ekko.
    SORT i_ekko BY ebeln.
    LOOP AT i_contr INTO rec_contr.
    READ TABLE i_ekko INTO rec_ekko WITH KEY
    ebeln = rec_contr-ebeln
    BINARY SEARCH.
    MOVE rec_ekko-bukrs TO rec_contr-bukrs.
    MOVE rec_ekko-bstyp TO rec_contr-bstyp.
    MOVE rec_ekko-aedat TO rec_contr-aedat.
    MOVE rec_ekko-ernam TO rec_contr-ernam.
    MOVE rec_ekko-lifnr TO rec_contr-lifnr.
    MOVE rec_ekko-zterm TO rec_contr-zterm.
    MOVE rec_ekko-ekorg TO rec_contr-ekorg.
    MOVE rec_ekko-ekgrp TO rec_contr-ekgrp.
    MOVE rec_ekko-waers TO rec_contr-waers.
    MOVE rec_ekko-wkurs TO rec_contr-wkurs.
    MOVE rec_ekko-kdatb TO rec_contr-kdatb.
    MOVE rec_ekko-kdate TO rec_contr-kdate.
    MOVE rec_ekko-inco1 TO rec_contr-inco1.
    MODIFY i_contr FROM rec_contr.
    ENDLOOP.
    ENDIF.
    REFRESH: i_ekko,
    i_ekpo.
    CLEAR : rec_ekko,
    rec_ekpo,
    rec_contr.
    ENDFORM. "select_contracts
    Thanks.

    Hi,
    Please get the valid condition ( based on date ) from A016 (MK & LPA). With the appropriate KNUMH read the Condition header. You can access the different condition items viz., PB00, RA00 etc., for the values from table KONP. Further if you have Value scales / Quantity scales, you can read the data from KONM, KONW.
    An additional tips: in KONP, if you have a condition like RA00 - Rebate, the value will be multiplied by 10 and saven in database to accomodate the discount to the third decimal.
    I could not completely understand your requirements like nature of development ( Is it a Report / SAP Script ??) you are working etc., so that I could help you precisely.
    Hope this helps,
    Best Regards, Murugesh AS
    Message was edited by:
            Murugesh Arcot

  • MR21 - no accounting doc. for the current period

    Hi,
    we are facing the following problem.
    Each month, our accounting team is doing the price change through MR21. They are posting it to the last day of a previous period. Each month there are two accounting documents - one posted to the last day of the previous period and one to the first day of a new period.
    As I understand this is a standard behaviour since the tick in OMRN is missing. (It was not ticked for previous few years).
    However this month, there was no accounting document for the current period.
    We have patched SAP_APPL in the time between these two activities.
    I have checked that MM period was changed several days before they have done MR21. There were many material movements (sales) concerning the affected material masters. Materials are priced by the standard price.
    I have tried to check OMRN for the affected company code and do the MR21 with no results - as it does not effect MR21 whether it is checked or not.
    I havent found any note for this so far.
    Any help appreciated.

    Hi,
       If the issue occurred after upgrade, you may check for SAP notes or raise an OSS ticket to SAP.
    Regards,
    AKPT

  • Get the Current Period

    Hi!
    I need to know from SDK the current period used in the company.
    I know that:
    In all SAP Business One releases up to 2005 A SP1 there is a 'current' period setting that indicates the period enabled for data entry and posting.
    Only one period can be set as the current period. Beginning with Release 2007 A, all periods will be enabled and the 'current' period setting will no longer be used. When the add-on attempts to read a value from the 'Company.CurrentPeriod', instead of the value period value, it will receive the numeric value '-1'.
    What alternative can I use?

    Hi All,
    So, B1 period is determined by automatically, based on posting date. But if you use several numbering series for the same document, you can set up different series for different posting periods using period indicator.
    Ex:
    year - 2009 Period Indicatior - 2009
    year - 2010 Period Indicatior - 2010
    Numbering series:
    for series in 2009 - Indicatior is set to 2009
    for series in 2010 - Indicatior is set to 2010
    If you open the A/R Invoice form, you will see series belongs to Period indicator 2010. if you change the posting date to 2009.12.01, you will see the series on the form belongs to Period indicator 2009.
    If we change the example
    Ex:
    year - 2009 Period Indicatior - 2009
    year - 2010 Period Indicatior - 2009
    Numbering series:
    for series in 2009 - Indicatior is set to 2009
    for series in 2010 - Indicatior is set to 2009
    IN this case on the form you can select each series (belongs to 2009 and 2010).
    This means: series displayed and selected automatically based on posting date and period indicator. (by this you can set up different numbering series by periods - Period indication of posting periods cas be change until the first booking!)
    SAP B1 is automatically set the numbering series of a document by posting date which is simiral to the following query (A/R Invoice object type = 13)
    select T1.* from ofpr T0  inner join NNM1 T1 on T0.Indicator  = T1.Indicator
    where convert(datetime,getdate(),112) between T0.F_RefDate and T0.T_RefDate  and T1.Locked  ='N'  and T1.ObjectCode = '13'
    Regards,
    J.

  • Extension of posting period days in ob29 for the current period.

    Dear Experts,
    I ahve requirment to extended the current period days  from 25 days to 28 days.
    My client is using the April to march fiscal year.Now he wants to extended in 9th period (dec) 25 days to 28 days.
    Please how can i do this now, because alreday postings are done in this month.
    Regards
    Kaparthi

    Hi mate,
    Here is the period table.
    OB29 - Select the Fiscal year Variant - click on Period from Left side structure. Usually, they looks as below.
    Month           Days                 Period           Year shift
    1     31     10     -1
    2     29     11     -1
    3     31     12     -1
    4     30     1     0
    5     31     2     0
    6     30     3     0
    7     31     4     0
    8     31     5     0
    9     30     6     0
    10     31     7     0
    11     30     8     0
    12     31     9     0
    Try this in DEV
    Thanks
    Edited by: nkonnipati on Dec 23, 2011 10:04 AM

  • How to change the current period in material master

    hi everybody,
    as i have installed sap 4.7 ides version on my home pc for practice , but hwenver i am creating the new material  master in the system , i observe that in accounting1 tab the current period is 12 2002 , how should i change the current posting period so that i can start the transaction in current uear 2009 and then later i can work in 2010 ....
    i have tried  the transaction mmrv, mmpv, mmpi through some resources but i didnt know how to do the settings in the system in IMG (SPRO) kindly help me through , i have wasted lot of time in this..
    i hope MM team will help me out of this...
    AMIT BATHLA

    Hi,
    Check in OMSY Transaction that, Which current month and year is having your comapny code.
    and go to T.Code MMPV
    enter Next Month of that cureent period and Year
    and Execute. You find the message that your current period has changed.
    Do the same process month by month till reaches to current period and year.
    Let me know if you have further queries.
    Padma.

  • Should OKP1 being all closed and only be opened for the current period ?

    Guyz,
    In OB52 (Financial closing period) , only "open period" being input on it. So, basically the closing period in OB52 is by opening the period provided to be posting.
    Then how about OKP1?
    It's provided to lock the actual period , actual transactions, or to lock the plan period or plan transactions..but the question is:
    a. Should it be all closed (ticked mark all transactions & all periods) except for the current period that is provided to be posting as period determined in OB52...For example, it is now June, then all periods & transactions other than June is being ticked mark.
    OR
    b. Should it be all opened except for the period that is being closed? For example, it is now June, so periods & transactions of period January to May are being ticked mark (closed).
    Which of the options is the best practice?
    Need your answers asap plz.... Thanking you ..

    Hello,
    For example in OB52, if you have opened for June, i.e.,
    06 of 2009 to 06 of 2009 (1st Period)
    In such case,
    In OKP1, you need to only untick June for all the months and close all remaining months (Untick June and tick all other months and transactions).
    Note that your planning activities for all the year must have been completed. Otherwise, you cannot enter the plan values.
    Regards,
    Ravi

  • PERSG previous bet different from the current PERSG using info-type pa0000

    Hi Friends,
    Please guid me how get the PERSG previous bet different from the current PERSG
    using info type pa0000.
    Regards,
    Durga

    Folks,
    even after having repaired the inbox folder under "properties" a few times, I still had some e-mails where the contents are different from the subject line.
    In other words in the inbox there are two e-mails: one with subject line "abc", and another one with subject line "def".
    When I display the e-mail with the subject line "abc", the contents are from the e-mail with the subject line "def" in the in-basket.
    What else can be done to correct this problem?
    Thanks and best regards.
    Fred Kunz-Shirzad
    Chemin Ronzeures 6A
    1297 Founex VD
    Switzerland
    [email protected]

  • Wrong period displayed for current period in HR Report Category

    Dear Friends,
    I have used HR report category (X_M00002) in my program that only shows two options (radiobutton) for period selection:
    1. Current Period
    2. Other Period
    Problem is that when I select current period and press enter key it takes 01.2006 (i.e. 01.04.2006 to 30.04.2006) instead of current period 01.2010.
    What could the possible error be?
    Regards,
    Amit

    Hi Amit
    The current period will not be set based on the current calendar month and year. The current period will be based on the current period for the payroll area which you have entered. You can check the current period of a given payroll area from the transaction PA03.
    Hope this answers your question.
    Regards
    Ranganath

  • How can i stay logged in on iPhone Skype after i delete the app from the 'current' apps?

    How can i stay logged in on iPhone Skype after i delete the app from the 'current' apps?
    Thanks for ur answers !

    You are correct. There is no other way to recover this material, and yes it would have been a good idea to backup the iPhone prior to the restore. Remember that a restore to a previous date deletes everything on the device and puts it back to the state of things on the date you choose. The texts and contacts would be gone. Did you possibly sync the contacts with a supported application on the computer? That is the only other way to recover contacts. They are designed to be synced with a supported application on the computer, or with a cloud service such as iCloud, Google or Yahoo.

  • Get three previous records of the current record

    Hi,
    I need to get three previous records of the current record in an Oracle Form
    Sorry for the lengthy explanation:
    I have a table name: ARCHIVE_DATA with column name: coll_time and its data type DATE.
    SQL> SELECT COLL_TIME FROM ARCHIVE_DATA;
    COLL_TIME
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    10 rows selected.
    SQL> select to_char(coll_time,'dd-mon-yyyy:HH:MI:SS') from ARCHIVE_DATA;
    TO_CHAR(COLL_TIME)
    12-aug-2005:02:42:00
    12-aug-2005:02:43:00
    12-aug-2005:02:44:00
    12-aug-2005:02:45:00
    12-aug-2005:02:46:00
    12-aug-2005:02:47:00
    12-aug-2005:02:48:00
    12-aug-2005:02:49:00
    12-aug-2005:02:50:00
    12-aug-2005:02:51:00
    10 rows selected.
    This is the Requirement:
    In a Form's Block(BLK1), for example: the current_record is the fifth record from the top
    (i.e. 12-aug-2005:02:46:00)
    When the fifth record is the current_record and When I click a button, three previous records of the
    current_record should be populated on the screen.
    See what I did:
    I created another table same as the first table(ARCHIVE_DATA) and its name is: THREE_RECS.
    I am inserting three records from the first table(ARCHIVE_DATA) into the second table: THREE_RECS
    which are less than the current record and ORDER BY DESC.
    CANVAS:
    Two blocks (BLK1, BLK2) based on ARCHIVE_DATA and THREE_RECS are on the same CANVAS.
    But the first block (BLK1) which is based on the first table:ARCHIVE_DATA is populated with one record and the
    second block (BLK2) is empty.
    So when I click a particular button (ex: prev_recs), the second block(BLK2) should be populated with
    three previous records of the current record( :BLK1.COLL_TIME)
    (off course :BLK2 populates with one record and use arrows or scrollbar to get the other two records)
    This is the code I wrote in the trigger and followed by the error:
    1 BEGIN
    2 DECLARE
    3 cursor c1 IS
    4           SELECT MONITOR_ID,
    5               SAMPLE_ID,
    6               COLL_TIME,
    7               DEW_POINT
    8          FROM ARCHIVE_DATA;
    9 cursor c2(passing_date IN date) IS
    10           SELECT MONITOR_ID,
    11               SAMPLE_ID,
    12               COLL_TIME,
    13               DEW_POINT
    14          FROM (SELECT MONITOR_ID,
    15               SAMPLE_ID,
    16               COLL_TIME,
    17               DEW_POINT
    18          FROM ARCHIVE_DATA
    19          ORDER BY COLL_TIME desc)
    20      WHERE COLL_TIME < passing_date;
    21     BEGIN
    22     FOR cur_rec in c1
    23     LOOP
    24          IF (cur_rec.COLL_TIME = to_date(:BLK.COLL_TIME,'dd-mon-yyyy:HH24:mi:ss')) then
    25     FOR second_cur_rec in c2(second_cur_rec.COLL_TIME)
    26          LOOP
    27      IF c2%rowcount < 4 then
    28               BEGIN
    29               INSERT INTO THREE_RECS
    30                    values(second_cur_rec.MONITOR_ID,
    31                         second_cur_rec.SAMPLE_ID,
    32                         second_cur_rec.COLL_TIME,
    33                         second_cur_rec.DEW_POINT);
    34               COMMIT;
    35               END IF;
    36 END LOOP;
    37 END IF;
    38 END LOOP;
    39 END;
    40 END;
    This is the error I am getting:
    Error 103 at line 14
    Encountered the symbol "(" when expecting one of the following
    a PL/SQL variable or double quoted string
    an expanded name
    an expanded name link
    a table reference __expression
    a key word
    Resuming parse at line 126, column 46
    Thanks in advance

    Why not just a simple select that doesn't involve a second table and PL/SQL?
    sql>select * from t1 order by dt;
    DT
    08/12/2005 02:42:00am
    08/12/2005 02:43:00am
    08/12/2005 02:44:00am
    08/12/2005 02:45:00am
    08/12/2005 02:46:00am
    08/12/2005 02:47:00am
    08/12/2005 02:48:00am
    08/12/2005 02:49:00am
    08/12/2005 02:50:00am
    08/12/2005 02:51:00am
    10 rows selected.
    sql>select dt
      2    from (select dt, row_number() over (order by dt desc) rn
      3            from t1
      4           where dt < to_date('12-aug-2005:02:46:00', 'dd-mon-yyyy:hh:mi:ss'))
      5   where rn <= 3
      6   order by dt;
    DT
    08/12/2005 02:43:00am
    08/12/2005 02:44:00am
    08/12/2005 02:45:00am
    3 rows selected.If the use of an analytical function (row_number()) is a problem with Forms, then the query can also be done as:
    sql>select dt
      2    from (select dt
      3            from (select dt
      4                    from t1
      5                   where dt < to_date('12-aug-2005:02:46:00', 'dd-mon-yyyy:hh:mi:ss')
      6                   order by dt desc)
      7           where rownum <= 3)
      8   order by dt;
    DT
    08/12/2005 02:43:00am
    08/12/2005 02:44:00am
    08/12/2005 02:45:00am
    3 rows selected.

  • Get three previous records of the current record in an Oracle Form

    Hi,
    I need to get three previous records of the current record in an Oracle Form
    Sorry for the lengthy explanation:
    I have a table name: ARCHIVE_DATA with column name: coll_time and its data type DATE.
    SQL> SELECT COLL_TIME FROM ARCHIVE_DATA;
    COLL_TIME
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    12-AUG-05
    10 rows selected.
    SQL> select to_char(coll_time,'dd-mon-yyyy:HH:MI:SS') from ARCHIVE_DATA;
    TO_CHAR(COLL_TIME)
    12-aug-2005:02:42:00
    12-aug-2005:02:43:00
    12-aug-2005:02:44:00
    12-aug-2005:02:45:00
    12-aug-2005:02:46:00
    12-aug-2005:02:47:00
    12-aug-2005:02:48:00
    12-aug-2005:02:49:00
    12-aug-2005:02:50:00
    12-aug-2005:02:51:00
    10 rows selected.
    This is the Requirement:
    In a Form's Block(BLK1), for example: the current_record is the fifth record from the top
    (i.e. 12-aug-2005:02:46:00)
    When the fifth record is the current_record and When I click a button, three previous records of the
    current_record should be populated on the screen.
    See what I did:
    I created another table same as the first table(ARCHIVE_DATA) and its name is: THREE_RECS.
    I am inserting three records from the first table(ARCHIVE_DATA) into the second table: THREE_RECS
    which are less than the current record and ORDER BY DESC.
    CANVAS:
    Two blocks (BLK1, BLK2) based on ARCHIVE_DATA and THREE_RECS are on the same CANVAS.
    But the first block (BLK1) which is based on the first table:ARCHIVE_DATA is populated with one record and the
    second block (BLK2) is empty.
    So when I click a particular button (ex: prev_recs), the second block(BLK2) should be populated with
    three previous records of the current record( :BLK1.COLL_TIME)
    (off course :BLK2 populates with one record and use arrows or scrollbar to get the other two records)
    This is the code I wrote in the trigger and followed by the error:
    1 BEGIN
    2 DECLARE
    3 cursor c1 IS
    4           SELECT MONITOR_ID,
    5               SAMPLE_ID,
    6               COLL_TIME,
    7               DEW_POINT
    8          FROM ARCHIVE_DATA;
    9 cursor c2(passing_date IN date) IS
    10           SELECT MONITOR_ID,
    11               SAMPLE_ID,
    12               COLL_TIME,
    13               DEW_POINT
    14          FROM (SELECT MONITOR_ID,
    15               SAMPLE_ID,
    16               COLL_TIME,
    17               DEW_POINT
    18          FROM ARCHIVE_DATA
    19          ORDER BY COLL_TIME desc)
    20      WHERE COLL_TIME < passing_date;
    21     BEGIN
    22     FOR cur_rec in c1
    23     LOOP
    24          IF (cur_rec.COLL_TIME = to_date(:BLK.COLL_TIME,'dd-mon-yyyy:HH24:mi:ss')) then
    25     FOR second_cur_rec in c2(second_cur_rec.COLL_TIME)
    26          LOOP
    27      IF c2%rowcount < 4 then
    28               BEGIN
    29               INSERT INTO THREE_RECS
    30                    values(second_cur_rec.MONITOR_ID,
    31                         second_cur_rec.SAMPLE_ID,
    32                         second_cur_rec.COLL_TIME,
    33                         second_cur_rec.DEW_POINT);
    34               COMMIT;
    35               END IF;
    36 END LOOP;
    37 END IF;
    38 END LOOP;
    39 END;
    40 END;
    This is the error I am getting:
    Error 103 at line 14
    Encountered the symbol "(" when expecting one of the following
    a PL/SQL variable or double quoted string
    an expanded name
    an expanded name link
    a table reference __expression
    a key word
    Resuming parse at line 126, column 46
    Thanks in advance

    Change C2 to:
    cursor c2(passing_date IN date) IS
      SELECT MONITOR_ID, SAMPLE_ID,
                   COLL_TIME, DEW_POINT
        FROM ARCHIVE_DATA
        WHERE COLL_TIME < passing_date
        ORDER BY COLL_TIME desc;And rather than populating a table with the three records, you could just select the three records using: where COLL_TIME between Prev3_time and Prev1_time

Maybe you are looking for

  • How do I upload a Pages document (resume) to a website?

    How do I upload a Pages document, my resume, when it only gives the option to choose a file, no copy and paste option? And when I click choose file, pictures are the only thing that come up. Thank you for your help!

  • How Do I Backup Outlook for Mac email messages

    I want to keep important email messages that have crucial information. I thought I backed up my email by exporting to a memory stick. But it has an extension of .olm and I have no idea how I can open then if I ever need to get the information from th

  • How can I get credit for movie that I am unable to watch on AppleTV

    I ordered to rent "The Hobbit" over a week ago to watch on my AppleTV, but every time I tried to start movie, keep getting error message and to try again later. I have tried more than 5 different times since, still unable to watch movie.

  • How do i know if i get a student discount from the online purchase of logic pro

    I want to buy Logic Pro, but I can't find it in any apple store in my town, so I'm gonna buy it online. I live in Prague, I came here as an exchange student, originally I live in Turkey. I want to know how to get a discount from the online purchase,

  • Duplicate Podcasts

    I have multiple podcasts that seem to have become their own animal. For example, I have two podcasts with the name "Focus on the Family". One, correctly updates and has podcasts in it from September 1, 2006. The other, also named "Focus on the Family