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,

Similar Messages

  • Function module to find start date and end date of fiscal year for company

    Hi,
    Is there any function module exist which will provide me start date and end date of fiscal year for company code and fiscal year provided?
    Thanks & Regards,
    Parag

    Hi,
    please check this link
    it would be very useful
    http://www.sapdevelopment.co.uk/fmodules/fms_fiscalyr.htm
    Thanks and regards
    durga.K

  • Text Variables to show Start and End Date of Fiscal Year Period

    Hi,
    I am creating a query that has user enter a starting fiscal year period and posts information by Fiscal Year Period going back 14 periods.  I am able to put the fiscal year period in the heading for all periods, but would also like to add the start and end calendar day for each listed period.  Can that be done using a replacement path text variable or is that something more for a customer exit variable?
    Thanks in advance for any thoughts provided.
    Bill

    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,

  • 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

  • Function module to get the dates from the year and the period

    Is there a function Module to get the dates from the year and the period

    Check with :
    To get last day of period use .
    LAST_DAY_IN_PERIOD_GET.
    To get last of month Use :
    RE_LAST_DAY_OF_MONTH
    HRVE_LAST_DAY_OF_MONTH
    LAST_DAY_OF_MONTHS
    ISB_PREVIOUS_PERIOD_DATE_GET
    Thanks
    Seshu

  • Survey questionaire disappearing when updating the start date and end date to previous year

    Hi Experts
    When the start and end dates are updated to the previous year dates the questionaire is disappearing from the assignment block, is this a standard behaviour or this is a bug which needs to be raised to SAP.
    Please advise.
    Appreciate for a quick response as this is quiet urgent.
    Regards
    AM

    Hi AM,
    Check the SAP Note 1629777 - SVY: Survey becomes invalid if the from date < sysdate
    This should resolve the issue.
    Regards,
    Gervase

  • Copying start and end dates from service request contract to tasks

    I am working on a logical apps program that is supposed to go to the service request screens and update the PLANNED_START_DATE and the PLANNED_END_DATE of a task for that service request on file JTF_TASKS_B with the start date and end date of the active contract associated with that service request and task. I think some of the contract information is available in OKS_PM_SCHEDULES_V, CS_SR_INCIDENTS_V, and CS_INCIDENTS. It may also be available in other files. I need to know of a contract file that can be used to link the contract to the corresponding task. I can't seem to find any files with task, contract number and service request all in one file.

    Glenda,
    You are right. All the three object you mentioned ( SR, Tasks and Contracts) are not referenced in a single file( or Table).
    You can use this relationship though to get this information.
    Tasks will be associated to a SR through source_ID and source_type. Source_ID will be the primary key, incident_id in CS_INCIDENTS_ALL_B table. This table incidentally also contains the contract_number and service_contract_id which gives the contract information.
    HTH,
    Gana

  • Need a function Module to retrive the weekly absence data from PNP logical

    hi all,
    i have generated a report for absence data according to my report when u enter the start date and end date and absence type it will give u the list of employees and starting date and end date and absence hours.
    But my client wants the report in following format:
    YEAR    week number      number of absence hourse in that week
    2006  -
        WEEK  -
                  HOURS
    infotype is pa2001.
    thx in advance.
    Sunil

    Hi Sunil,
    I think you have to use zreport.
    Regards,
    kumar

  • How to calculate first date and end date of this year in Query

    Hi Expert
    I want to calculate following dates with inputted date in query.
    I have no knowledge on ABAP and I just can create a query with simple logic.
    Could you teach me how to calculate following date?
    (If inputted date is April 12 2009)
    - First date of this year (Ex January 1 2009)
    - End date  of this year (Ex December 31 2009)
    - First date of last year (Ex January 1 2008)
    - End date of last year  (Ex December 31 2008)
    - First date of this month (Ex April 1 2009)
    Thank you!
    Take

    HR_JP_MONTH_BEGIN_END_DATE   use this FM to get the begin and end date of the Date you are passing. eg when u give input as 04/12/2009, it will return
    04/01/2009 as begin date
    04/30/2009 as end date
    pass the Year in this FM HR_E_GET_FISC_YEAR_DATES, you will get the Fiscal year Begin and End Dates
    Abh

  • Getting Start and End Date of Current Year?

    Hi Folks,
    How do I get the start of the year and end of the year in Java ?
    If I say :
    Calendar cal = Calendar.getInstance();
    int day = cal.get(Calendar.DATE);
    int month = cal.get(Calendar.MONTH);
    int year = cal.get(Calendar.YEAR);
    System.out.println("Day: " + day);
    System.out.println("Month: " + month);
    System.out.println("Year: " + year);
    I get the current day and time.What I need is the start of the current Year (Jan 2010) and the End of the Current Year (Dec 2010).
    How can get the above 2 dates if I the current date is March 24th 2010 ?
    Thanks

    sabre150 wrote:
    What am I missing? The start date of 2010 is 1/1/2010 and the end data is 31/12/2010 . So, as I see it, at any time the only information you need is the current year which you currently get from int year = cal.get(Calendar.YEAR);
    Well, with the GregorianCalendar, anyway. ;-)

  • 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

  • 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.

  • Get the starting date and end date of all weeks of a given month and year

    hey Guys so far I have this.. but I am having difficulty limiting it by month. I am using Oracle 11 release 1
    Select year, week, next_day( to_date( '04-jan-' || year, 'dd-mon-yyyy' ) + (week-2)*7, 'sun' ) as weekStartDate,
    next_day( to_date( '04-jan-' || year, 'dd-mon-yyyy' ) + (week-2)*7, 'sun' ) +6 as weekEndDate
    from (Select '2012' year, rownum week from all_objects where rownum<=5)
    Thanks in advance
    Edited by: Aj05 on Jan 12, 2012 7:42 AM

    First you need to define week starting day. If, for example it is Monday:
    TRUNC(TRUNC(&dt,'YYYY') -1,'IW')is first Monday of the year. Then:
    SELECT TRUNC(TRUNC(&dt,'YYYY') -1,'IW') + (LEVEL - 1) * 7 week_start_date
      FROM  DUAL
      CONNECT BY LEVEL <= 53
    /will give start dates of all weeks within &dt year. And:
    WITH t AS (
               SELECT TRUNC(TRUNC(&dt,'YYYY') -1,'IW') + (LEVEL - 1) * 7 week_start_date
                FROM  DUAL
                CONNECT BY LEVEL <= 53
    SELECT  week_start_date,
            week_start_date + 6 week_end_date
      FROM  t
      WHERE week_start_date > TRUNC(&dt,'MM')
        AND week_start_date < ADD_MONTHS(TRUNC(&dt,'MM'),1)
    /will give you week start/end dates within &dt year and month. For example:
    SQL> DEFINE dt="DATE '2012-03-17'"
    SQL> WITH t AS (
      2             SELECT TRUNC(TRUNC(&dt,'YYYY') -1,'IW') + (LEVEL - 1) * 7 week_start_date
      3              FROM  DUAL
      4              CONNECT BY LEVEL <= 53
      5            )
      6  SELECT  week_start_date,
      7          week_start_date + 6 week_end_date
      8    FROM  t
      9    WHERE week_start_date > TRUNC(&dt,'MM')
    10      AND week_start_date < ADD_MONTHS(TRUNC(&dt,'MM'),1)
    11  /
    old   2:            SELECT TRUNC(TRUNC(&dt,'YYYY') -1,'IW') + (LEVEL - 1) * 7 week_start_date
    new   2:            SELECT TRUNC(TRUNC(DATE '2012-03-17','YYYY') -1,'IW') + (LEVEL - 1) * 7 week_start_date
    old   9:   WHERE week_start_date > TRUNC(&dt,'MM')
    new   9:   WHERE week_start_date > TRUNC(DATE '2012-03-17','MM')
    old  10:     AND week_start_date < ADD_MONTHS(TRUNC(&dt,'MM'),1)
    new  10:     AND week_start_date < ADD_MONTHS(TRUNC(DATE '2012-03-17','MM'),1)
    WEEK_STAR WEEK_END_
    05-MAR-12 11-MAR-12
    12-MAR-12 18-MAR-12
    19-MAR-12 25-MAR-12
    26-MAR-12 01-APR-12
    SQL> SY.

  • Update Contract Start and End dates via BAPI_SALESORDER_CREATEFROMDAT2

    Hi Experts.
    We are successfully using BAPI_SALESORDER_CREATEFROMDAT2 to create sales order.
    Only problem is that the contract start and end date do not get updated.
    We are passing that in ORDER_HEADER_in-CT_VALID_F and ORDER_HEADER_IN-CT_VALID_T.
    After debugging, I found that there is one more table SALES_CONTRACT_IN in SD_SALESDOCUMENT_CREATE. Updating the values in that table works.
    But the problem is this table is not available in BAPI_SALESORDER_CREATEFROMDAT2. How to update Contract start and end dates from this FM ?
    I could not find anything in the search of this forums. So I guess this is not an issue and I am doing something wrong. Can someone suggest to me please?
    Thanks in adv.
    Aishi

    Are you creating a contract or a sales order?

  • Need a FM for gettng starting & ending date based on the settlement period

    Hi,
    I have to filter a database table based on the settlement period( IDENT3 ) and the field available is of date field. Can anyone give me a function module by which can calculate the starting date and ending date by providing the settlement period ( eg. AM- Monthly, AQ- Quarterly, AJ- Annually,  etc ) and date.
    Thanx in advance.
    Regards,
    Sumanth.

    Hi Sumanth,
    Please use the function module 'DATE_CONVERT_TO_FACTORYDATE' to get the start date and end date for the particular factory calender.
    For end date:
    CORRECT_OPTION                  +
    DATE                                       sy-datum
    FACTORY_CALENDAR_ID        Aq(quaterly)
    For start date:
    CORRECT_OPTION                  -
    DATE                                       sy-datum
    FACTORY_CALENDAR_ID        Aq(quaterly)
    According to sy-datum, it will calculate the Extreme  interval .
    Thanx,
    Zenthil.

Maybe you are looking for