How to find last  date of the current year

Hi
Please tell me is there any function module to find out the last date of the current year.

Hi,
You can do that very simply like so.
code
report zrich_0001.
data: first type sy-datum.
data: last type sy-datum.
first = sy-datum.
first+4(4) = '0101'.
last = sy-datum.
last+4(4) = '1231'.
write:/ first, last.
[/code]
OR use function modules
1.use this function module HR_GB_TAX_YEAR_DATES
Pass these values
P08_TXYEAR = Year
P08_PAYROLL_AREA = '01'
2.use FM......... FIRST_AND_LAST_DAY_IN_YEAR_GET
DATA: first LIKE sy-datum,
last LIKE sy-datum.
CALL FUNCTION 'FIRST_AND_LAST_DAY_IN_YEAR_GET'
EXPORTING
i_gjahr = '2007'
i_periv = '24'
IMPORTING
e_first_day = first
e_last_day = last.
WRITE: / 'First Date', first, ' Last Date', last.
Regards,
Raj.

Similar Messages

  • How to get last date of the week

    hi,
    how to get last date of the week like FM WEEK_GET_FIRST_DAY gives the date of the first day of the week i need the date of the last day of the week..
    thnx

    data : p_week type KWEEK,
    p_Date type SYDATUM.
    p_week = <incoming value in week of year>
    CALL FUNCTION 'WEEK_GET_FIRST_DAY'
    EXPORTING
    week = p_week
    IMPORTING
    DATE = p_date
    EXCEPTIONS
    WEEK_INVALID = 1
    OTHERS = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    To get the last day of the week.
    p_date = p_date + 6.
    You can find the available fm in the system from se37 transaction code.

  • How to find last date of month

    Dear  All,
    Can anybody tell me how to find last date of month I need it to check some validations
    helpful answer will definatly rewarded
    Regards
    Shashikant

    Hi,
    RP_LAST_DAY_OF_MONTHS Determine last day of month
    HR-D: Payroll Germany code
    RP_LAST_DAY_OF_MONTHS
    HR-D: Determine last day of month
    DATE_CONVERT_TO_FACTORYDATE
    Returns factory calendar date for a date Calculates and returns factory calendar date for a date (if CorrectOption = '+');
    Checks if the date is work day (if CorrectOption = '-').
    HOLIDAY_CHECK_AND_GET_INFO Useful for determining whether or not a date is a holiday. Give the function a date, and a holiday calendar, and you can determine if the date is a holiday by checking the parameter HOLIDAY_FOUND.

  • How to get  --Last date of the Last value .

    Dear All,
    I have a report like
    Material – Country – Current Price
    1112-----  Singapore  -
      100
    1112-----  Japan  -
      120
    1112-----  Malesia   -
      99
    Here current price is Last Value of the particular Material on particular Date.
    This I can get based on Key figure Aggregation ( Last Value and reference Character 0CALDAY ), It is giving the last Value of the Particular Material.
    Now my user wants to see Last date of the value ( Date of the Value )
    Example :-
    Material – Country –  Date --Current Price
    1112-----  Singapore  -
    01/04/2008 -- 100
    1112-----  Japan  -
    04/05/2008 -- 120
    1112-----  Malesia   -
    05/05/2008 -- 99
    If  I drill down the date in my  report  it is showing all dates , my user wants to see only last date .
    Hope some one has solved this issue , please help me to solve this issue.
    Regards,
    SHAIK.

    I have created a keyfigure with date as a data type.
    In aggregation tab, I selected  aggregation Maximum.
    Upto DSO, data is Loaded perfect. Ok.
    I added the same key figure in cube , When I am trying to Activate the Transformation,
    It is giving Error message.
    Rule 17 is invalid and is being deleted. The reason for this is that a field or InfoObject that is used in rule 17 has been deleted in the source or target of the transformation ODSO ZPL_DSO1 -> CUBE ZPLATT_C (0GH6MHANQ2J79LXZBLGIJ9ZK9LWHK6RS)
    Plz Advice.
    Regards,
    SHAIK
    Edited by: shaik on May 7, 2008 5:46 PM

  • How to find compensation data for the year

    Dear All,
    Scenario:
    A company wants to know the comepnsation data for financial year 2009-2010.
    Problem: I couldnot find a single report which can provide the compensation of an employee for the year.
    We are trying to build a report however needs input if anyone has done that:
    Table which stores this data is PS_COMPENSATION.
    Problem is : it stores data in effective date.
    How to then convert it into a year -April 2010 to March 2011
    For example: cases
    a. existing employee: whose effective comp data will be less than April 2010
    - Plus, there are pay rate changes between April 2010 to march 2011. (Pay rate change can happen on any date of the month)
    - How can I add them to find the Compensation as per comp page from 1st April to 31st march 2011

    I'm afraid what you're looking for is not likely to be a trivial task. If you have all of the modules required for the "Report Total Compensation" product, then you should take a look at the associated PeopleBook. I think you will have to be on HRMS 9.0 at a minimum, and using Payroll for North America and Benefits Administration.
    To create a custom solution, you may have to consider a variety of other factors such job status--leave, terminated, terminated with pay, etc.--hourly vs. salaried, part time vs. full time, multi-job, variable compensation. It will depend entirely on the specific features that are being used at your site.
    If you provide a very detailed example of the output you are looking for with sample data, someone might be willing to offer a solution.
    Regards,
    Bob

  • Get last date of the current month

    Hi all,
       Is there any FM used to get the last date of
    sy-datum.
    Regards,
    bala

    check..
    RE_LAST_DAY_OF_MONTH
    SG_PS_GET_LAST_DAY_OF_MONTH
    parameters: p_fdate like sy-datum.
    DATA: M_DATE LIKE SY-DATUM,
    CALL FUNCTION 'LAST_DAY_OF_MONTHS' "#EC EXISTS
    EXPORTING
    DAY_IN = P_FDATE
    IMPORTING
    LAST_DAY_OF_MONTH = M_DATE.
    case mdate+3(2).
    when 30.
    write: '30 days'.
    when 28.
    write: '28 days'.
    when 29.
    write: '29 days'.
    when 31.
    write: '31 days'.
    endcase.

  • Formula for finding specific date in a Current Year

    Hello ,
    Can get  a formula which i can use in variable to find date having first  Thursday in a current Year.
    So in case of Current Year i.e 2014 , Formula should return date as "01/02/2014"(mm/dd/yyyy)
    Thanks & Regards
    Gourav Joshi

    Hi Gourav Joshi,
    Create a variable as per below. it will give you "First Thursday" of the year.
    First_Thursday=
    If(DayNumberOfWeek(RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())-1)))=1) Then RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())-4)) Else
    If (DayNumberOfWeek(RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())-1)))=2) Then RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())-3)) Else
    If (DayNumberOfWeek(RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())-1)))=3) Then RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())-2)) Else
    If (DayNumberOfWeek(RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())-1)))=5) Then RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())+6)) Else
    If (DayNumberOfWeek(RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())-1)))=6) Then RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())+5)) Else
    If (DayNumberOfWeek(RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())-1)))=7) Then RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())+4)) Else
    RelativeDate(CurrentDate();-(DayNumberOfYear(CurrentDate())-1))
    It will help you.
    Regards,
    Anish

  • How to find System date in the query

    Hi,
    I have requirement where in the query I need to select the Document delivery date = today's date or system date.
    Can any once please let me know how to write the query?
    Murali

    Select * from ORDR where docduedate=convert(char(8), getdate(), 112)

  • How to find a data with the minimum value I get without using sub query

    Currently, I manage to get a record by using subquery to find the minimum number, eg:
    SELECT TAccTrn.ASysCde
    FROM TAccTrn
    WHERE TAccTrn.AAccTrnNum=(SELECT Min(TAccTrn.AAccTrnNum)
    FROM TAccTrn, TDbtSchCltDtl
    WHERE TDbtSchCltDtl.ASrcRefId=TAccTrn.ASrcRefId
    AND TDbtSchCltDtl.ASrcRefSubId=TAccTrn.ASrcRefSubId
    AND TDbtSchCltDtl.ASrcRefSeq=TAccTrn.ASrcRefSeq)
    Is there any more idea without using the subquery?

    Hi ,
    What about using an in-line view and the row_number () analytic function...????
    Here is an example....
    SQL> select * from emp;
    EMPNO ENAME      JOB         MGR HIREDATE          SAL      COMM DEPTNO
    7369 SMITH      CLERK      7902 18/12/1980     800,00               20
    7499 ALLEN      SALESMAN   7698 20/02/1981    1600,00    300,00     30
    7521 WARD       SALESMAN   7698 22/02/1981    1250,00    500,00     30
    7566 JONES      MANAGER    7839 02/04/1981    2975,00               20
    7654 MARTIN     SALESMAN   7698 28/09/1981    1250,00   1400,00     30
    7698 BLAKE      MANAGER    7839 01/05/1981    2850,00               30
    7782 CLARK      MANAGER    7839 09/06/1981    2450,00               10
    7788 SCOTT      ANALYST    7566 18/04/1987    3000,00               20
    7839 KING       PRESIDENT       17/11/1981    5000,00               10
    7844 TURNER     SALESMAN   7698 08/09/1981    1500,00      0,00     30
    7876 ADAMS      CLERK      7788 21/05/1987    1100,00               20
    7900 JAMES      CLERK      7698 03/12/1981     950,00               30
    7902 FORD       ANALYST    7566 03/12/1981    3000,00               20
    7934 MILLER     CLERK      7782 23/01/1982    1300,00               10
    14 rows selectedUsing a solution like the one you don't want ...(a subquery) i would write....
    SQL> select ename from emp
      2    where hiredate=(select min(hiredate) from emp)
      3  /
    ENAME
    SMITHWhereas , using an in-line view....
    SQL> select ename from
      2   (
      3    select ename,row_number() over(order by hiredate asc) row_num from emp
      4    )
      5  where row_num=1
      6  /
    ENAME
    SMITHIs it acceptable...????
    Regards,
    Simon

  • Find out date of the current week

    i want to find dates within this week (start from monday end to sunday always)
    suppose today is monday it retrun only todays date.
    if today is wedness day it return moday and tues day and todays date

    with t
    as
    select sysdate sdt,
           decode(to_char(sysdate,'fmday'),
                                  'monday',1,
                                  'tuesday',2,
                                  'wednesday',3,
                                  'thursday',4,
                                  'friday',5,
                                  'saturday',6,
                                  'sunday',7) cnt
      from dual
    select sdt - (level-1) dt
      from t
    connect by level <= cnt
    order by 1

  • How to find FIRST and the LAST date of the month.

    Hello,
    I want to find the first and the last date of the current month through query. How is it possible please help.
    For example if the current month is july. The first date should be 01-JUL-2006 and the last date would be 31-JUL-2006.
    Please help me.
    Regards,
    Imran Baig

    Like this?
    SQL> select trunc(sysdate,'MM') "First_Day",
      2        last_day(sysdate) "Last_Day" from dual;
    First_Day Last_Day
    01-JUL-06 31-JUL-06
    SQL> select trunc(to_date('10-FEB-04'),'MM' ) "First_Day",
      2       last_day(to_date('10-FEB-04')) "Last_Day" from dual;
    First_Day Last_Day
    01-FEB-04 29-FEB-04

  • How to get the last day of the current open fiscal period?

    hi folks,
         I  have to display the last date of the current open fiscal period in the selection screen. Its just a display only.
          if there is any function module vailable for getting that period, kindly suggest me?
    thanks in advance,
    cheers,
    Adi.

    hi,
    CALL FUNCTION '/BEV3/CHPERIOD_DETERMINE'
    EXPORTING
    date = sy-datum
    version = c_version
    IMPORTING
    period = l_period
    year = l_fiscal_year
    EXCEPTIONS
    period_in_not_valid = 1
    period_not_assigned = 2
    version_undefined = 3
    OTHERS = 4.
    If not use GM_GET_FISCAL_YEAR
    CALL FUNCTION 'GET_CURRENT_YEAR'
    EXPORTING
    BUKRS = '1000' " Company Code
    DATE = SY-DATUM " Date to find fiscal year for
    IMPORTING
    CURRM = w_currm " Current Fiscal Month
    CURRY = w_curry " Current Fiscal Year
    PREVM = w_prevm " Previous Fiscal Month
    PREVY = w_prevy. " Previous Fiscal Year
    Rgds
    Anver

  • No budget in the current year but the system is letting receipts go against

    We have a re-accuring issue where there is no budget in the current year but the system is letting receipts go against the budget. We need to know how this happens and a resolution as to how we can get it to stop.  We can't have purchases against projects that do not have a current year budget.
    PO created and delivery date has been in the month of Dec’07 and goods received / Invoicing in Feb’08 we don’t have budget for 2008 but when we check in 2007 we have current budget.
    How can I stop Posting in the current year even if PO has been created in Previous year?

    Hai,
    I also opinion same as Ashish.
    Budget availability will come alive when you create a PO. If Budget is available in year 2007, it will allow you to raise a PO. When you do GR, No cost postings happen. If you use Valuated Project stock, Qnty and value will sit in Project stock. To my knowledge, Budget availability will not check , cost in stock.
    Try and do the GI to project. See if it is throwing an error. Becoz when you do GI, actual costs gets posted. ( if you r using valuated project stock).
    Please let us know your findings.
    Thanks
    Saikishore Ganga.

  • How do I create a new calendar for the current year, using last years calendar's birthday's/photos and comments from the lower pages?

    Each year for the past 5 years I make a family calendar and send copies to all he family members around the globe.  I hate that I have to recreate all the birthdays and special occasions from scratch, and re-drag all the photos onto these dates, in the lower half of the page of each month on the new calendar.  How can I create a new calendar for the current year and port all of these photos/comments into the new calendar from last years calendar, to save having to redo all this work!!  I am not talking about the upper half page of the photos only...I am referring to the calendar page of each month.
    Thanks in advance. 
    Colin

    Welcome to the Apple Discussions. Open iWeb so you see your original site in the left hand pane. Use the File->New Site menu option to create a new site. Give it the name you want.
    Now select a page in your original site and type Command+D. That will duplicate the page. Drag the duplicate page down to the new site and rename it as needed. Do that for the other pages you need in the original site.
    OT

  • How to Add 15 Days to the current Date in eCATT

    Hello eCATT Guru's,
    How to add 15 days to the current date in eCATT.
    I have changed the Date format to mm/dd/yyyy.
    now i want to add 15 days to the sy-datum.
    How to do that.do any one know?
    Thanks in Advance,
    Raj

    Check out this link -
    http://help.sap.com/saphelp_46c/helpdata/en/d7/e21a50408e11d1896b0000e8322d00/frameset.htm
    It gives details about DATE variables in CATT. Hope this will help you out.
    ashish
    Reward points if you find this helpful.
    Message was edited by: Ashish Gundawar

Maybe you are looking for