Posting Period Date Calculation

Hi,
I need to fetch the start date of a particular period from the start date of the preceding period (fetched from T009B).
Are any function modules available for this? , Any logic avaliable..?
Thnanks in advance,
Jai
Edited by: Jaikaran Korpal on Apr 20, 2009 11:33 AM

hi ,
Please refer to the following code.
Simply add the below FORM into you ABAP code and call it using the usual PERFORM command:      
DATA: ld_date TYPE sy-datum.
          PERFORM calculate_date      using '-4'
                         changing ld_date.
*&      Form  CALCULATE_DATE
      Add/Subtract n number of months from a date
-->  p_months  Number of months to add/subtract
<--  p_date    Start date and result date
FORM calculate_date USING p_months
                    CHANGING p_date.
  DATA: ld_datestor TYPE sy-datum.
  ld_datestor = p_date.
  CALL FUNCTION 'MONTH_PLUS_DETERMINE'
    EXPORTING
      MONTHS        = p_months
      OLDDATE       = p_date
    IMPORTING
      NEWDATE       = p_date.
ENDFORM.                    " CALCULATE_DATE
Hope  this is helpful to u.
Warm  regards,
Srilu.

Similar Messages

  • Can't define previous & current posting period date in Balance sheet PLD.

    Hello Experts,
    I need to print previous financial year's last date & current financial year's last date on the balance sheet in  a new company.
    But i am unable to do so, as i was trying to link it with posting period's date in the PLD. And in the new company currently i am having only one posting period i.e. current financial year. How can i get the date from the previous posting period's date.
    Please suggest me, how can i get the previous financial year's last date & current financial year's last date on the PLD of Balance Sheet.
    Regards.
    ShriX.

    Hi,
    This is one of Hard Coded PLD that no way to link to other tables.  You have to create your own report if you need those dates.
    Thanks,
    Gordon

  • Posting periods issue though I updated in MMPV

    Hi experts,
    I created scheduline agreement and trying to do the PGI , system thrown an error saying 'posting periods possible only 9/2009 and 8/2009'. after this I closed the periods till sep09  in T.code MMPV, still the same error. is there anything else that I have to configure or check to resolve this issue. your help is neede.
    Thanks,
    Kanna.

    Hi,
    This is how you need to do it.
    Go to Tx: OMSY or MMRV & check the current period against your company code.
    Theory behind Posting Periods in SAP
    Posting periods are calculated using a Config: Setting called u201CFiscal Year Variantu201D attached to the Company code. u201CFiscal Year Variantu201D is the deciding factor for the company code, whether to follow the calendar year or any other calculation method.
    Eg: Fiscal year can be start from July & goes to the next year June for some companies.
    Therefore what you see in the OMSY might not be the actual calendar month that SAP is referring.
    (Eg: 01 means Jan, 02 means Feb, 03 means March, etc is not always the case)
    So first you have to check the Fiscal Year attached to your company code.
    Go to below path to check Fiscal Year attached to your company code.
    IMG -> Financial Accounting (New) -> FinanciaI Accounting Basic Settings (New) -> GIobaI Parameters for Company Code -> Enter GIobaI Parameters ->
    Go in to your company & Check the Fiscal Year Variant field. There you can identify whether it equals to the calendar year or not. If its not clear, take that Fiscal year variant 7 go to below IMG path;
    IMG -> Financial Accounting (New) -> FinanciaI Accounting Basic Settings (New) -> Ledgers -> FiscaI Year and Posting Periods -> Maintain FiscaI Year Variant (Maintain Shortened Fisc. Year)
    Go in to the node.
    Select the Fiscal year & double click on Periods node.
    If Fiscal Year is same as calendar year, then you should have that u201CCalendar Yru201D tick box ticked.
    Now check what's the SAP Fiscal month relevant to your calendar month.
    The go to MMPV & open that relevant Fiscal month accordingly.
    Then you should be able to post.
    Hope this helps you !
    Best regards,
    Anupa

  • Posting date and posting periods

    HI Experts,
    I am practicing IDES for SD. While using T VL02N for post good Issue I got this error:
    <b>Posting only possible in periods 2006/12 and 2006/11 in company code 1000
    Message no. M7053
    Diagnosis
    The posting date entered is not within one of the permitted posting periods (current period/previous period).
    This can be due to one of two reasons:
    The correct current period has not been set in the system.
    For the system, the first of the entered periods is the current period. At the beginning of a new period, your systems administrator must change the current period in the material master record, using the function "Shift periods". This has not yet been done.
    You have entered a wrong date in the field "Posting date".
    Procedure
    Check the posting date and correct it if necessary. If your input is correct, inform your systems administrator that the "period shifting" (period-end closing) process has not yet been completed. Copied from M8022</b>
    I don;t think there is problem with my posting date. Can someone guide me on how solving this
    Thanks
    Yael

    Go to OMSY and check the periods are current peiods or not to ur comp code?
    If it is not the current period.
    close the posting period by going to MMPV.
    let us say comp code EG, YEAR-2006  PE-6
    so you have to close the posting periods for all months till this month.
    from comp code-EG
    To comp code- EG
    period-7
    fiscal year-2006
    repeat the same but with period-8(month) 9,10,11,12,
    and do the same for 2007 too till you get the current month in OMSY T-Code.
    you need to do close the period end of every month.
    thank you
    chaitanya

  • How to calculate First Date of Posting Period in BEx Query

    Hi,
             I have  2 reporting requirements as follows:
    1) User will either enter a single posting period in a fiscal year or can enter a range of posting periods.
    Based on user selection I need to display three key figures in a report.
    Key figure 1 and Key Figure2 should be the summarized values for each posting period.
    key Figure 3 should be the value on the first date of that particular posting period (in case user selects multiple posting periods i should derive the value of the first date of each posting period).
    2) Also, in another report I need to display only top 8 values  for one key figure in the report.
    Please let me know the method or code required to get this Functionality.
    Thanks in advance.

    First Report
    1. Create Restricted KeyFigure 1 & 2 for the summarized values.
    2. Create a Customer Exit Variable for getting the first date of the posting period, this should be of type Interval. Write code using FM FIRST_DAY_IN_PERIOD_GET to get. Read the selection variable to see the range of posting period and you have to insert that many first dates into this variable.
    3. Create a new Restricted KeyFigure 3 and use the Customer Exit variable created in Step 2
    Second Report
    Use the Top N functionality of BEx and create a workbook. You can set the option Refresh query when the workbook is open so that the data is current when opened.
    Hope this helps.

  • Error in document date & posting date-- Posting period 001 2008 is not open

    hi guru's
    while doing vendor creation in XK01, i m not getting the data screens like address, ..etc.i m getting error..posting period not open". what does it mean..
    What date i need to give in both fields...?
    can anybody send a set of data for me to create a vendor to test for my bdc/lsmw?
    can any help me step by step vendor creation in xk01,
    I am getting this below....
    Posting period 001 2008 is not open
    Message no. F5201
    Diagnosis
    Period 001 of fiscal year 2008 is not open for posting for the variant of posting period 1000.
    System Response
    Processing cannot be continued.
    Procedure
    The error can have several causes. In order to eliminate the error, proceed as follows:
    1. Check whether the posting date was entered correctly. The system determines the posting period by means of the date.
    2. Check whether the required posting period is open for posting for the variant of posting period 1000 and account type +. Make sure that the period is open for posting.
    To do this, specify a period interval in which the required period for the variant of posting period 1000 and account type + is contained.
    Proceed
    thanks

    Hi
    Kris is right, that message means you can't post a FI document in the period 1 (probably Gennuary) of the 2008, but this can't mean you can't create a new vendor.
    So are you sure on trx?
    If the trx is right perhaps somebody has inserted a control in a user-exit.
    Max

  • Not possible to determine posting period for date

    Hi SAP Guru
    While Creating the Shipment cost document in [VI01] transaction I am getting the error
    Not possible to determine posting period for date with error Message no. SE105. There is no long text available
    Please provide the solution for the same
    Regards
    Rahul

    Hi Friend,
    Check the posting periods for the company code in OB62 and OMSY.
    Check whether they are in currenct date or not.
    if not maintain them in MMPV for  Company code.and OB62 for the fiscal year variant.
    regards,
    santosh

  • Due Date in new posting period

    Hi All,
    Posting date range in new financial period (new posting period) is one in which my JEs should posted and they will be having impact in financial system. Which is logical.
    What is the need of Due Date? Is it useful in any practical situation?
    B Ravi Shankar

    Ravi,
    You do not have to specifically define a range? When you create a posting period SAP automatically create the range from first day of Fiscal year to last day of Fiscal year.
    Let me explain with an example. 
    Let us consider  01/01/2007  to  31/12/2007 as the fiscal year
    For some of the document that you create during the last few months, you may require to enter a Due date later than the Fiscal year (going into next fiscal year)
    example: Invoice created on 15/12/2007 with Net 30 terms will need a Due date of 14/01/2008 but since you Due date range ends on 12/31/2007 you will not be able to Add this document.
    To overcome this you will have to click on the yellow arrow next to the Period and change the <b>Due Date to</b> to accomodate the 14/01/2008 due date.
    Hope it helped
    Suda

  • Function module to get the posting period based on date

    Hi to all,
    Is there any function module to get the posting period based on date?
    Regards,
    Nagesh

    hi,
    CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
          EXPORTING
            I_GJAHR        = GV_GJHAR
            I_PERIV        = GC_24
            I_POPER        = GV_POPER
          IMPORTING
            E_DATE         = S_FKDAT-LOW
          EXCEPTIONS
            INPUT_FALSE    = 1
            T009_NOTFOUND  = 2
            T009B_NOTFOUND = 3
            OTHERS         = 4.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CALL FUNCTION 'LAST_DAY_IN_PERIOD_GET'
          EXPORTING
            I_GJAHR        = GV_GJHAR
            I_PERIV        = GC_24
            I_POPER        = GV_POPER
          IMPORTING
            E_DATE         = S_FKDAT-HIGH
          EXCEPTIONS
            INPUT_FALSE    = 1
            T009_NOTFOUND  = 2
            T009B_NOTFOUND = 3
            OTHERS         = 4.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
    ags.

  • Function module to get posting date from posting year and posting period

    Hi all,
    I need a function module which will return posting date when posting period and fiscal year is passed to it..
    Thanks and regards,
    Puja.

    Hi puja
    try this FM
    this will solve ur problem
    G_POSTING_DATE_OF_PERIOD_GET
    G_POSTING_DATE_OF_YEAR_GET
    FCJ_CHECK_POSTING_DATE
    Cheers
    Snehi Chouhan

  • PRRW: Incorrect posting period (fixed posting date)

    Hi,
    ¿Can anyone help me? I have problems when using transaction PRRW in order to transfer travel expenses to accounting. The issue is that for one company code the posting date is not of the same posting period as the travel. If I try to transfer all the travel expenses created in september, PRRW tries to use july posting period. Does anybody know how can I customize this? I don't know why it is always trying to post in july.
    Thanks and Regards,
    Ariana

    In t.code PRFI under general trip data you define the posting date.
    Hope this helps
    Pls assign points as way to say thanks

  • Data column (for posting period) converted to COMPARISON COLUMN

    Hi all,
    I use 'posting period'(derived from fiscal period/year) in the data column and assigned CHAR-posting period to a variable (the value is 1.2.3....12) in the planning level.
    When I execute my layout, I got an error message: Data column 2 will be converted into a comparison column.
    Diagnosis:
    You have entered variable ZFIU004 in data column 2 and provided it with an offset. This results in values arising for variable ZFIU004, which are no longer within the selection, which was defined for the variable.
    Can someone please advise me?

    Hi,
    What is the selection maintained for posting period on the level.
    thanks

  • Posting period in back date (MMPV)

    Hello All,
    Can i open the posting period in back date.
    like my current opening period is 11 (01.02.2009) and perious posting period is 10 (01.01.2009).
    can i open the 09 posting period, if yes then how, please tell.
    i am using MMPV and MMRV.
    Thanks
    Pankaj Garg

    REOPEN THE PERIODS:
    It is possible to re-open a previously closed period. However, it is NOT advisable to do so because the valuation data of the previous period could be affected.
    In general, it is only safe to reopen a previously closed period when no material postings have been done after the period shifting to the new period.
    If there has already been postings after the period shifting to the new period, reverting the period back will cause database inconsistencies in the history tables.
    If you decide to proceed with this process, you can use the program RMMMINIT, but, please review the documentation of this program first!! and the check the SAP notes 487381 (for the error message that you are receiving) and the 369637 (for an explanation about the inconsistencies that will be generated.
    Steps are as below;
    Go to Transaction Code SE38
    Enter program name RMMMINIT
    Execute or press F8 function button
    Enter your company code (From and To)
    Enter relevant date: Say 01/03/2008 for Mar. 2008 month to be opened as of now
    That means, user can post for the month of Feb 2008 as well as Mar. 2008
    Refer SAP Note No. 487381 for more details.
    As per SAP Notes 487381 ( If the periods are opened in advance in mmpv to again change it to current period the following process should be follow ), Go to Tcode MMPI, then go to menu bar and select system -> user profile->owndata.In that screen , under the parameters tab enter MMPI_READ_NOTE in Parameter ID field and enter, then under short description you will get Initialise period. Next Save.
    Again go to MMPI enter company code, period and year and execute.
    Other way of doing it is follow these steps( But try this method in Sand box Only):
    1. Go to OX18, and delete the plants assigned to your CO.Cd and save.
    2. Go to OMSY and change the posting period to the one u want and save.
    3.Go to OX18 and assign the plants you have deleted in step 1.and save.

  • Get start and end date for posting period (YYYYMMM format)

    In revenue recognition I'd like to have the start date and the end date of the posting period, which is in format YYYYMMM. It's field VBREVR-BDJPOPER.
    Any idea?
    I had no luck so far to find a relevant FM.
    Thanks in advance,
    Peter

    Hi,
    Use this FM To convert the date into DD.MMM.YYYY format
    <b>CONVERSION_EXIT_SDATE_OUTPUT</b>.
    Use the followiong FM To convert the date into <b>user specified</b> format
    <b>SLS_MISC_CONVERT_TO_DATE</b>     
    Rewaed if helpful.
    Regards,
    Sandhya

  • Posting period is showing in future date

    Hi,
    This is issue am facing in my IDES system.
    The error it is showing is as below:
    Posting only possible in periods 2015/03 and 2015/02 in company code z001  and message number M7053
    other inputs: MMRV :  Current peiod   : 03 2015
                                           Previous period: 03 2015
                                       Last period in previous .year 12 2014
    And one more input about this is, in my system  the system timing was showing 2011, this i did not recogbise, and when i tried to do the post goods issue(PGI) system shown some Posting error then i cloed the periods through MMPV t code, and closed upto 02 2015, then i reliazed why still system is allowoing to close the periods. then i checked the sytem timing and corrected it to current date.(13 th July 2014).
    In OB29 my Fiscal year variant is K4 (number of posting periods 12 and no of Special periods 4) is assigned to my company code z001 in t code ob37
    In OMSY "also showing the 2015 3
    Now even after changing the sytem date to correct date still system is showing the periods problem, when i tried to initialize the periods in t code MMPI sytem is showing the below message "Follow the instruction note 487381 before initialiazation"
    I found many treads similar to this issue, but all of them faced past date, needs to be closed the periods until current date, where as in my case the periods alredy open in future date.
    am not much familiar with this periods problem as am SD consultant.
    Please help to resolve this issue.
    thanks,

    Nobody needs help of an ABAPer to close or open periods, this is just normal customizing.
    Goto service.sap.com/notes and read the content of the OSS note mentioned in your message and just follow it, as it is the only way to run period initialization. It does not matter it you rolled it to far into the future or if you still have stone old periods like in the hundreds of other discussions on the same issue.
    And since this is that often discussed I am locking this thread.

Maybe you are looking for