How to determine current period start and end dates

Hi All,
If given previous period start date and end date, how to determine current period start date and end date?
Suppose if given previous period start and end dates are 12/28/08 - 01/30/09, then current period start date and end date will be 01/30/09 - 02/27/09. (where 12 is the previous period, 28 is the day, 08 is the year......)
Can you please suggest an FM to determine the current period dates?
Thanks & Regards
Gowthami

>
gowthami karunya wrote:
> If given previous period start date and end date, how to determine current period start date and end date?
> Suppose if given previous period start and end dates are 12/28/08 - 01/30/09, then current period start date and end date will be 01/30/09 - 02/27/09. (where 12 is the previous period, 28 is the day, 08 is the year......)
Hello,
I am assuming you have the Company Code with you & proposing this solution.
TABLES: bkpf.
PARAMETERS:
p_bukrs TYPE bukrs.
SELECT-OPTIONS:
s_date FOR bkpf-budat.
DATA :
l_perio LIKE bkpf-monat,
l_poper TYPE poper,
l_year  LIKE bkpf-gjahr,
l_spmon TYPE spmon,
l_periv TYPE periv,
l_date1 TYPE datum,
l_date2 TYPE datum.
CALL FUNCTION 'BAPI_COMPANYCODE_GET_PERIOD'
  EXPORTING
    companycodeid = p_bukrs
    posting_date  = s_date-high
  IMPORTING
    fiscal_year   = l_year
    fiscal_period = l_perio.
CONCATENATE l_year l_perio INTO l_spmon.
* Get the next period
IF l_perio < 12.
  l_perio = l_perio + 1.
ELSE.
  l_perio = '01'.
  l_year = l_year + 1.
ENDIF.
MOVE l_perio TO l_poper.
SELECT SINGLE periv INTO l_periv
FROM t001
WHERE bukrs = p_bukrs.
IF sy-subrc = 0.
  CALL FUNCTION 'FIRST_DAY_IN_PERIOD_GET'
    EXPORTING
      i_gjahr        = l_year
      i_periv        = l_periv
      i_poper        = l_poper
    IMPORTING
      e_date         = l_date1
    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        = l_year
      i_periv        = l_periv
      i_poper        = l_poper
    IMPORTING
      e_date         = l_date2
    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.
  WRITE: / l_date1, l_date2.
ENDIF.

Similar Messages

  • Period start and end dates

    Hello Experts,
    Can some tell me where we enter the start and end dates of a posting period in a fiscal year which is a year dependent and a non-calendar year?
    For ex: Jan 2008, I have to mention the start and end dates of the fiscal period January, because ours is not a calendar year and so the jan 1st and Jan 31st do not correspond with the January's posting period dates.
    Regards,
    Sriram

    Hi Sriram,
    As Vj suggested, go to transaction OB29.  Then select the fiscal year variant and upon selection the variant, click on "Period".  This will open up dialog box asking for the fiscal year for which you want to configure.  Enter the fiscal year and hit enter.  This will open up the calendar table to enter the period entry which has 4 columns: Month, Day, Period and Year Shift.
    Make sure you are entering the correct Year Shift.  Logic for the Year Shift is as follows.
    +1 if the fiscal year is later than the calendar year
    -1 if the fiscal year is before the calendar year.
    0 if the fiscal year is same as the calendar year.
    One example of year shift:
    Say, if you are configuring the fiscal year 2007 (April 2007 to March 2008), then January 2008 is your 10th period.  Here you hare to enter -1 in Year Shift Column only for January to March (10-12 period) as your fiscal year 2007 is less than the calendar year 2008.
    Hope this helps.
    Pls. award points if this is useful.
    With Regards,
    Chirag

  • Report execution start and end date/time

    Hi All,
    How can one find execution start and end date/times for all reports? Basically I am looking to see what reports were run on a day, when and how long it took for each to complete.
    Thank you.
    Denis

    Hi,
    The "eul5_batch_reports" holds the data about the scheduled report and if you don't have any so you will not have any data.
    Take a look at "EUL5_QPP_STATS"
    for example:
    select
    qpp.qs_doc_name,
    qpp.qs_doc_details,
    fu.user_name Ran_by,
    qpp.qs_created_date Start_run,
    qpp.qs_doc_owner Doc_owner,
    qpp.qs_num_rows rows_fetch,
    qpp.qs_est_elap_time estimated_time,
    qpp.qs_act_elap_time Run_time,
    qpp.qs_act_cpu_time Cpu_time
    from eul_us.EUL5_QPP_STATS qpp,
    fnd_user fu
    where substr(qpp.qs_created_by,2,10)=fu.user_id
    order by qs_created_date

  • Getting the start  and end dates of the week

    Hi,
    I was stuck with a problem in getting the start date and end date of the week,i know the month ,week and year also,with these three values how can i get the start and end dates of a week.please help me
    Thanks

    There is no simple way. It has to be a math calculation.
    There are several ways you can get the dates. First you have to know what day is January 1st and what day is december 31st for a particular year. Second you have to check whether the given year is a leap year or not. Based on the abvove information you should be able to find out what day is a particular date.
    Hope this helps to get you started.
    - Venkat Dhurjati.

  • Contract start and end date in BAPI_CONTRACT_CREATEFROMDATA

    HI,
    I am using BAPI_CONTRACT_CREATEFROMDATA to create a contract from within a custom ABAP program. However I cannot figure out how to get the contract start and end dates into the contract header. I know that you can enter them into the ONTRACT_DATA_IN table parameter but these dates only appear on the line items and not the header.
    Does anyone know which parameters on the function map to the contract header start and end dates.
    Thanks.

    Hi,
    there are also fields QT_VALID_F and QT_VALID_T for quotation or inquiry. So it looks like for different contract types you need to use different fields. This BAPI calls FM SD_SALESDOCUMENT_CREATE which has subroutine ms_move_header_in which maps from BAPI fields to internal fields. Here is a small part of this routine.
      MOVE order_header_in-qt_valid_f       TO e_vbakkom-angdt.
      MOVE order_header_in-qt_valid_t       TO e_vbakkom-bnddt.
      MOVE order_header_in-ct_valid_f       TO e_vbakkom-guebg.
      MOVE order_header_in-ct_valid_t       TO e_vbakkom-gueen.
    When I check technical fields for the screen  fields "Valid from" and "Valid to" in VA43 I get names GUEBG and GUEEN. So it still looks like you should use CT_VALID_F and CT_VALID_T.
    I forgot to mention you can still debug BAPI to figure out where the problem is.
    Good luck
    Edited by: Martin Voros on Sep 11, 2009 9:57 AM

  • How to input my own Validity Start and End Dates in ME21N

    Hi All,
    I have to change the Validity Start and Validity End date in Addiitional Data Tab of ME21 transaction( PO Create ) using default Customer Values.How Can i accomplish it?
    I have used the BAdI ME_PROCESS_PO_CUST and implemented it, I have coded in the method PROCESS_HEADER.First I retrieved the data using get_data( ) method, changed the values with Customer Values and called the method set_data( ).
    However my validity start and End Dates and not changing.
    Even in ME21N if I create the PO with my own Validity Start and End dates, and go to ME23N to display the created PO, still in the additional data tab, the start and End dates are current date and Next date respectively.why its happening?
    Thanks in advance

    Hi,
    Can you please let us know in which business scenario this is required.
    SAP has provided separate functionality of Outline Agreement for considering validity period.
    If you let us know the business scenarion some solution/workaround can be suggested.
    Regards

  • How to change Validity Start and end dates on a lane ?

    Hi,
    I am trying to change Validity start and end dates on a lane for a product specific assignment.
    What I see is as follows
    1) Lane created by system /others I can delete and give the required start /end date ?
    I want to know if I can change the end date without deleting the lane as its tough to delete a lane in production.
    Thanks
    -Venky.

    Hi,
    we can change the start period and end period in the Transportation lane using the table /SAPAPO/TRPROD.
    And then using the update command you can change the start time and end time of the product.
    Regards,
    Hyma.

  • Define the start and end dates of an assigned academic period in fee calc.

    Define the start and end dates of an assigned academic period
    Message no. HRPIQ00ACCOUNTING132
    Diagnosis
    The academic calendar assigned to the top organizational unit does not contain a start or end date for the academic period (academic year and session) assigned to fee calculation period Z000.
    System Response
    The system will skip fee calculation period Z000 and continue processing with the next fee calculation period.
    Procedure
    1. Check which academic calendar is assigned to the top organizational unit.
    2. Check which academic period is assigned to fee calculation period Z000. You check this setting in Customizing for Campus Management in the IMG activity Assign Academic Years and Sessions to Fee Calculation Periods.
    3. In this academic calendar, create the start and end dates of the relevant academic period using standard time limit 0100 (standard duration of academic period) or a corresponding user-defined time limit.
    For more information, see
    Define Top Organizational Unit
    Define Mandatory Time Limits for Academic Calendar
    please give me the needful information to solve this problem.
    Regards
    Arun Rai

    Arun,
    Have you looked in the Student Accounting Cookbook  
    http://www.sdn.sap.com/irj/scn/advancedsearch?query=studentaccountingcookbook   on page 13? 
    Page 1-18 will help you setup the Oranizational unit, the academic calendar and the modules.
    Bev beck

  • What parameters determine Planned order production start and end dates?

    Greetings
    We are using the graphical planning table @ MF50 to firm Planned Orders (Basically checking off "Firm Order" field within the Planned Order). We are on ECC 6.0
    Whenever I backflush, the production start and end dates get overwritten (The Basic dates do not change).
    I would like to prevent this. Can someone advise me on what parameter controls how the production start and end dates getting changed?
    Thank you
    Hanarin

    Hi,
    Calculating production dates ( Lead time scheduling) are explained in detail in the SAP help URL as below:
    If "Automatci Scheduling indicator" is set in the customizing for scheduling parameters then after every change relevant to scheduling, the production order is also automatically rescheduled before saving.
    You need to check these settings.
    regards
    Datta

  • 0Person to 0employee loading, how to handle start and end date

    Hi
    I need help on some basic understanding of time dependent master data object.
    In my scenario i am loading 0employee and 0Person from R/3. I need to update 0employee from 0person.
    0employee
    BEGDA            ENDDA             PERNR        Position....................So many fields
    10.10.2001     10.10.2004        8000123    Associate
    11.10.2004     10.10.2008        8000123    Consultant
    11.10.2008     31.12.9999        8000123    Senior Consultant
    0Person
    BEGDA            ENDDA             PERNR         City....................So many fields
    10.10.2001     10.10.2003        8000123      Singapore
    11.10.2003     10.10.2007        8000123      Tokyo
    11.10.2007     31.12.9999        8000123      Newyork
    As the begining and end date are different i can't simply read City from 0person into 0employee. If i go for checking the city for the start and end date in 0employee, i will get multiple records ( If try to get city for 0employee's first record, i will get 2 city Singapore and Tokyo).
    Please help me out how to handle this ...... i think i am missing somelink somewhere
    Thanks
    Tripple k

    Hi Srini
    Yes i need to have parallel flow for both and in the cube where my reporting will be on monthly basis i need to read these 2 master data and get the required attributes ( considering last/first day of that month as per the requirement).......but i am just wondering this is common scenario....while there are so many threads written for populating 0employee from 0person......don't they have such requirement.....
    Thanks
    Tripple k

  • How to retrieve start and end date values from sharepoint 2013

    Hi,
    How to retrieve start and end date values from new event form of calendar in SharePoint foundation2013
    Thanks
    Gowri Balaguru

    Hi Srini
    Yes i need to have parallel flow for both and in the cube where my reporting will be on monthly basis i need to read these 2 master data and get the required attributes ( considering last/first day of that month as per the requirement).......but i am just wondering this is common scenario....while there are so many threads written for populating 0employee from 0person......don't they have such requirement.....
    Thanks
    Tripple k

  • Function module to derive start and end dates from fiscal year and period.

    Hi,
    I want to know a function module to derive start and end dates from fiscal year and period.
    ie: If I have say fiscal year '2010' and period '07', then the start date of this period would be '01.10.2010'.
    Thanks.
    Moderator Messge: Basic Date questions are not allowed.
    Edited by: kishan P on Oct 18, 2010 4:45 PM

    Hi,
    This is one of my exit that display the calmonth (offset -12). Usefull when I have to retrieve in a KF a complete rolling year depending one calmonth.
    S_VMUCMN is my selection variable
    S_TXTCMN_M12 is my text variable calmonth-12
    S_TXTCMN_M0 is my text variable for selected calmonth.
    WHEN 'S_TXTCMN_M12'.
        IF i_step = '2'.
          LOOP AT i_t_var_range INTO loc_var_range WHERE vnam = 'S_VMUCMN'.
            CLEAR l_s_range.
            " First day of the selected month
            CONCATENATE loc_var_range-low '01' INTO l_calday.
            CALL FUNCTION 'YFRBW_FUM_CAL_DATE_IN_INTERVAL'
              EXPORTING
                date      = l_calday
                months    = 12
                signum    = '-'
              IMPORTING
                calc_date = l_calday.
            l_s_range-low = l_calday+0(6).
            l_s_range-sign = 'I'.
            l_s_range-opt = 'EQ'.
            APPEND l_s_range TO e_t_range.
            EXIT.
          ENDLOOP.
        ENDIF.
    Thus, in KF header you have to put the two text variable to display the complete period.
    Hope it helps,

  • How to change both start and end dates for an business event (or any object

    Hi all.
    We are in the case to change the validity dates for several business events in training management.
    The special point is that both, start and end date, have to be changed.
    In example, business event 00000001 is valid from 2010.01.01 to 2010.01.31 and shoud be "moved" from 2010.05.01 to 2010.05.31.
    So if i run RHBEGDA0 report to change start date first, it doesn't work propperly because new start date is bigger than old enddate.
    Next thing we thought is to change end date first, using RHGRENZ1, and then change the start date, with the report RHBEGDA0. Problem with this solution is that a business event duration shoud be calculated taking care of free days (weekends and day ofs).
    Is there any better solution for this?
    Thanks in advance for your help.
    Best regards.

    Hi,
    I gueass the best solution is to use PV1A t-code.
    You can write an LSMW for this t-code if the number of business events to be maintained is huge.
    Regards,
    Dilek

  • How to find the start and ending dates of a quarter of a particular fiscal

    Hi Experts,
    I need a function mudule which returns starting and ending date s of a particular quarter of a particular fiscal year .
    For Example: if pass 1 quarter and 2002 or 2 quarter 2002 it has to give me the star and end dates of that particular quarter na d fiscal year.
    Please help me which is urgent for me.

    Hi Kishan thanks for reply.
    But given function module the 2nd one is full but it is giving me the calender year dates but i need fiscal yea dates.
    fro example: if i pass 1 st quarte and 2006 it is to give me the 1st-april to 30-jun2006.
    And need this quater starting date and ending date for as per USA fiscal year calender.
    If u get any idea plz let me know.
    thanks.
    Dashmantha.

  • Hyperion Planning dynamic forms based on start and end date across years

    Hi All,
    I have a requirement where i need to be able to view a form showing periods across years that are dynamically built depending on the start and end dates. If i have a start date of 01/11/2009 and an end date of 31/7/2013 i want to be able to view a form that shows all of the periods (Jan,Feb etc) in a form that is driven by these dates, in addition it will need to show the actual scenario up to the current month and the forecast from the current month to the end date. So basically if a user inputs the start and end dates the form will display the relevant periods driven by these dates.
    Any tips very much appreciated!

    Hello,
    This is difficult to realize, but you can get quite far with a workaround. The first question is, where do you want to input your selection of time periods? Assuming you have a webform with the complete timeline in months and years and you type in the start period and end period.
    Webforms have the option to suppress rows and columns.
    This can be extended with option of empty cells or not empty cells.
    You will need to apply your creativity on this.
    Put every month-year combination in a column and add the suppression.
    Calculate the timeline between start period and end period with a dummy member, so data exists for these and columns will show.
    Maybe you will need to copy the required timeline into a separate version for this, to avoid having periods which were outside the selection and still have data.
    I hope these hints help a bit in this challenge.
    Regards,
    Philip Hulsebosch
    www.trexco.nl

Maybe you are looking for

  • N97 Fluctation in free memory on C

    Hi,  I've noticed that free memory in C:\ fluctuate for no apparent reason. Generally my C:\ is hanging around 42.2 mb of free memory but I've noticed a quite  a number of times it is fluctuating around 42.1, 42.0mb and even at times 41.9 mb.  Note:

  • Where are my games?

    I bought and downloaded two games and played them, lots of fun, no problem. Today I read that there was a newer firmware version and upgrading was recommended. So I upgraded to the latest firmware. iTunes made a backup right before the reset. After i

  • Auto-Lock and Passcode Lock

    So even though I'm not the dumbest rock in the box, I cannot for the life of me understand the difference between auto-lock and passcode lock. When I go into settings and then into general, I have set my phone to auto-lock at 5 minutes. I also have s

  • Batch creation during process order

    Dear all,            Can any body tell me for some materials Automatic batch is not creating after releasing the process order. Regards Ravi

  • Making pdfs from tiffs, that are real long...

    Can adobe professional X make pdfs from BIG oilfield well log tiffs.  It works well with small size tiffs, but have hit a brick wall with this size of a TIFF 8.4 inches wide by 449.5 inches long... Any ideas if adobe can do this ... ??