How to add years to date-field ?

hi,
i have a field z_date type d.
now i have to add 25 years to it, and 35 years, and so on.........
how to handle this ?
reg, Martin

Hi,
Above posts would not check for leap year dates... so while calculating it might give wrong dates...
use the FM given below to calculate date with year's...
data w_date type sy-datum.
w_date = sy-datum.
CALL FUNCTION 'J_1H_CAL_DATE_IN_INTERVAL'
  EXPORTING
    date            = w_date
    days            = 0
    months          = 0
   SIGNUM          = '+'
    years           = 30
IMPORTING
   CALC_DATE       = w_date.
Regards,
Siddarth

Similar Messages

  • How to add a new data element for existing table filed(Primary key field)

    Hi Experts,
    How to add a new data element for existing table field(Primary key field)
    For this filed ther is no foreign key relation ships and even check table.
    while activating table it is giving message like below.
    can you help any one to solve this and wil steps to add new dataelement for existing primary key filed of a table.
    Check table (NAMING SPACE/TABLE NAME(EX:/TC/VENDOR)) (username/19.02.10/03:29)           
    Primary key change not permitted for value table /TC/VENDOR
    Check on table  /TC/VENDOR resulted in errors              
    Thanks
    Ravi

    Hi,
    Easiest way is to download the table eg into an Excel table (if possible) or text table. Drop the table from the database. Build your table with the new key field. Build the database table again and fill it.
    You can do it also over the database into a new table. Drop the old one. Build the enhanced one and fill it. Afterwards drop your (temporary) table.
    Maybe there are other ways, but this works.
    Success,
    Rob

  • How to fetch year till date value for earning for current ,last and year

    hi,
    how to fetch year till date value for earning for current ,last and year before that from payroll result
    plz reply soon,
    pratyush

    Dear Pratyush,
    Pick this from CRT.
    Use LDB PNPCE & Fire event GET PAYROLL &
    then you can pick from CRT.
    Hope this helps.
    Kindly reward in case useful.
    Regards & Thanks,
    Darshan Mulmule

  • How to add a User Defined Field in OUBI

    Dear Experts
    I would like to find out how to add a user defined field into OUBI from a Customer Care & Billing source system. If anyone could list the steps involved or point me toward a source of documentation that sets out the steps involved it would be much appreciated.
    Cheers
    Tim

    Is there anyone out there who has had experience using OUBI with CC&B?

  • How to Add a user defined field in transaction-PKMC?

    Could anyone tell me the step by step process of how to add a user defined field in transaction-PKMC?
    Moderator message: please do some research before posting.
    Edited by: Thomas Zloch on Jan 16, 2012

    Is there anyone out there who has had experience using OUBI with CC&B?

  • I want to add image in column is it possible then how to add image in data base what data type we need to do

    I want to add image in column is it possible then how to add image in data base  what data type we need to give we required any casting  please show me one example
    jitendra

    Hi again,
    Several points that can help more:
    1. If you are working with Dot.Net, then I highly recommend read the first link that you got! This is nice and simple coding. Another option is this link which is even better in my opinion:
    http://www.dotnetgallery.com/kb/resource21-How-to-store-and-retrieve-images-from-SQL-server-database-using-aspnet.aspx
    2. As i mention above both link use the column's type image. There are several other option of working with Files. In most of my applications architecture I find that it is better to use a column which let us use any type of file and not an image column.
    In choosing the right column's type for your needs basically your fist question should be if if you want to store your data inside relational database environment or outside relational environment. It is a good idea to look for blogs on this issue. Next
    if you chose to store your data inside then you need to chose the right column type according to your server version. I highly recommend to look for blogs on the differences between those column's types: IMAGE, 
    Check those links:
    To BLOB or Not To BLOB: Large Object Storage in a Database or a Filesystem
    http://research.microsoft.com/apps/pubs/default.aspx?id=64525
    FILESTREAM feature of SQL Server 2008
    http://msdn.microsoft.com/library/hh461480
    FileTables feature of SQL Server 2012
    http://technet.microsoft.com/en-us/library/ff929144.aspx
    Compare Options for Storing Blobs (SQL Server)
    http://technet.microsoft.com/en-us/library/hh403405.aspx
    Binary Large Object (Blob) Data (SQL Server)
    http://technet.microsoft.com/en-us/library/bb895234.aspx
    Managing BLOBs using SQL Server FileStream via EF and WCF streaming
    * Very nice tutorial!
    http://petermeinl.wordpress.com/2012/02/20/managing-blobs-using-sql-server-filestream-via-ef-and-wcf-streaming/
    [Personal Site] [Blog] [Facebook]

  • Rip of year from date field

    I have a question. I want to rip of the year from date field. For e.g if date is 01/02/2006 I want just the 01/02 which month and date. I tried to use substr function but it;s giving weird result. I used substr(date, 0,5) but not working. Please suggest.

    If it is a DATE column/variable it is conventional to use TO_CHAR with an appropriate date format, in your case TO_CHAR (date_column, 'MM/YY').

  • How to add a new metadata field to iPhoto where new field is calculated as age in years and month based on a specific date and the date photo was taken ? I want to calculate and display the age of my two kids on every photo.

    Hi
    How can I add 2 new metadata-fields to every photo in iPhoto ?
    The new fields should state the age of my kids in years and months based on the date that they were born and the date that photo is taken.
    Exampel:
    My son is born 01.01.2010
    My daughter is born 01.01.2012
    Photo taken by data
    Aage of son
    Aage of daughter
    01.07.2011
    1 year 6 month
    not born yet
    01.01.2014
    4 year 0 month
    2 year 0 month
    I would like to be able to search by kids age and get the info displayed when doing slideshows.
    How to do this in iPhoto ?
    Any alternatives to accomplish the same ?
    Kind regards

    It can't be done with iPhoto.  There are some DAM (digital asset management) applications that can write to other IPTC fields that iPhoto can't read. One such app is Media Pro 1.
    However you would have to calculate the age for each date and add it to one of the fields. There are online age calculators that can do that for you: Age Calculators
    If you go thru that much trouble then use iPhoto, make the calculations and add the age to the Description field.  Then you can use Smart Albums to search for 1year 6 month text.
    OT

  • How to add a custom Project field in the "OData Projects Data.odc" connection file? Project server 2013

    Hi,
    I created a project Enterprise field named "Countries and Cities" which contains a lookup table with information such as "USA.Seattle". How can I add this field in the oData connection file?
    Thanks 

    Paul,
    How do you write the custom field name
    "Countries and Cities" which contains 2 spaces?
    I always get the error:
    "We couldn't get data from the Data Model, Here'is the error message we got:
    The content of the data feed is not valid for an Atom feed."
    Thanks

  • How to compare table's date field with dropdown year field

    Hi All,
    I have one requirement to display the selected rows from a database table based on the selection of drop down.
    Here, I have one dropdown of year(like 2009,2010,....) and I have one database table which contains one field with "DATE".
    Now, I want to compare table's DATE field with my dropdown field.
    Problem is that table's DATE field is of type "DATS" and dropdown is of type INTEGER(or) STRING ...
    How to compare this fields?
    Can any one please give me solution for this...!
    Thanks in Advance!

    Hi  sreelakshmi.B,
    try the following:
    DATA lt_dats        TYPE TABLE OF dats.
    DATA l_dat_i        TYPE          i.
    DATA l_dat_c_4(4)   TYPE          c.
    DATA l_dat_c_12(12) TYPE          c.
    DATA l_dats_from    TYPE          dats.
    DATA l_dats_to      TYPE          dats.
    *Move Date from Integer to Char
    l_dat_c_4 = l_dat_i = 2005.
    *Create Date From use in WHERE-Clause
    CONCATENATE '01.01.' l_dat_c_4 INTO l_dat_c_12.
    CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
         EXPORTING
              date_external            = l_dat_c_12
         IMPORTING
              date_internal            = l_dats_from
         EXCEPTIONS
              date_external_is_invalid = 1
              OTHERS                   = 2.
    IF sy-subrc <> 0.
    ENDIF.
    *Create Date To use in WHERE-Clause
    CONCATENATE '31.12.' l_dat_c_4 INTO l_dat_c_12.
    CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
         EXPORTING
              date_external            = l_dat_c_12
         IMPORTING
              date_internal            = l_dats_to
         EXCEPTIONS
              date_external_is_invalid = 1
              OTHERS                   = 2.
    IF sy-subrc <> 0.
    ENDIF.
    * Select records in range
    SELECT *
           FROM [DBTAB]
           INTO TABLE [ITAB]
           WHERE [DATE] BETWEEN l_dats_from
                        AND     l_dats_to.
    Regards
    REA

  • How can I validate a date field in Portal Forms

    I have a date field in portal forms that I want to perform validation on to make sure it's in the proper format before being accepted (mm/dd/yyyy). How can I validate against that field?

    Hi Ben,
    I took the time to test and revise. This is code that will validate a date entry (format MM/DD/YYYY). Just paste this in the "Before the start of the form..." window of the Additional PL/SQL code section of the form. Then add validateDate(); into the onBlur event window of the field in question. Replace the CYCLE_END_DATE with the field name in question.
    HTP.P('
    <SCRIPT LANGUAGE=javascript>
    function validateDate() {
    var ddObj;
    var mmObj;
    var yyObj;
    var day;
    var mon;
    var year;
    var field_val;
    var field_name;
    for (var j=0; j < document.forms[0].elements.length; j++) {
    field_name = document.forms[0].elements[j].name;
    field_val = document.forms[0].elements[j].value;
    if (field_name.substring(field_name.indexOf(''DEFAULT.'') + 8, field_name.lastIndexOf(''.01'')) == ''CYCLE_END_DATE'') {
    var delimPos = field_val.search(/\//i);
    if (delimPos < 0)
    alert(''Invalid date entry! Please enter in MM/DD/YYYY format. '' +
    ''e.g, Dec 21, 2003 would be entered as 12/21/2003'');
    else
    if (field_val.length != 10)
    alert(''Invalid date entry! Please Please enter in MM/DD/YYYY format. '' +
    ''e.g, Jan 1, 2003 would be entered as 01/01/2003'');
    else {
    month = field_val.substring(0, field_val.indexOf(''/''));
    day = field_val.substring(field_val.indexOf(''/'') + 1, field_val.lastIndexOf(''/''));
    year = field_val.substring(field_val.lastIndexOf(''/'') + 1, 10);
    /* Need to subtract 1 from value because in Javascript, January begins with 0
    and ends with 11 for December */
    month = month - 1;
    ddObj = new Date(year, month, day);
    mmObj = new Date(year, month, day);
    yyObj = new Date(year, month, day);
    if (ddObj.getDate(ddObj.setDate(day)) != day)
    alert(''Invalid day!'');
    if (mmObj.getMonth(mmObj.setMonth(month)) != month)
    alert(''Invalid month!'');
    if (mmObj.getYear(mmObj.setYear(year)) != year)
    alert(''Invalid year!'');
    </SCRIPT>
    ');

  • How to Add a Filter By field to a Report

    Hello, I am running Apex 3.x and I currently have in production, a standard report page with the following columns:
    Grant#, Grant Name, Project #, Project Name, Project Fiscal Year, Task #, Task Name
    A grant can have many projects, and a project can have many tasks.
    I have been asked to add a "Filter By:" field acting as a select List , with just these values: Show All, Show Projects and Tasks, Show Projects
    If "Show All" is selected, the report remains the same and displays all the column headings and data for all the fields above.
    If "Show Projects and Tasks" is selected, I am to refresh the page, and only show data (and column headings) for Project #, Project Name, Project Fiscal Year, Task #, Task Name.
    If "Show Projects" is selected, I am to refresh the page, and only show data (and column headings) for Project #, Project Name, Project Fiscal Year
    Could you please assist in directing me on how I can go about hiding these other columns and data if "Show All" is not selected.
    Many thanks,
    Laura

    Create a select list with those 3 values ( and make it a select with submit ), then in your report attributes, go to the conditional columns you have and set the condition accordingly, ex: for example:
    column Task # >> edit >> condition >> PLSQL expression
    :PX_FILTER != 'Show Projects'
    Where PX_FILTER is the new select list that you will create....
    Hope this helps,
    Sam

  • Bento - Add a Related Data Field

    I know Bento is discontinued by File Maker and that it's not an Apple product, BUT, this forum usually seems to have the answer so I am asking!  I use Bento for one project annually.  I figured out how to replicate my libraries from a previous year.  There are two libraries - 1) Customer  2) Products.  My Customer form contains a "spreadsheet" at the top of related data from the product file which creates a receipt I can email each customer for the products they ordered.  My problem is that there is a new field in the Product library this year that I need to add to the related data "spreadsheet".  I cannot figure out how to add it!  I want to maintain all the current fields that come over and add this one new one.  Does anyone out there know how to do that?  Thanks in advance for your help!

    I know Bento is discontinued by File Maker and that it's not an Apple product, BUT, this forum usually seems to have the answer so I am asking!  I use Bento for one project annually.  I figured out how to replicate my libraries from a previous year.  There are two libraries - 1) Customer  2) Products.  My Customer form contains a "spreadsheet" at the top of related data from the product file which creates a receipt I can email each customer for the products they ordered.  My problem is that there is a new field in the Product library this year that I need to add to the related data "spreadsheet".  I cannot figure out how to add it!  I want to maintain all the current fields that come over and add this one new one.  Does anyone out there know how to do that?  Thanks in advance for your help!

  • How to add search help for field in ALV object

    Hello,
    In a program, we use ALV object ( container) to create a liste like : field1, field2 .. but when display we do not have search help for this . Could you please help me how to add match code in this case for field 1 and field2, We use set_table_for_first_display
    Thanks,

    Hi,
    when you define your field catalogue you can create data elements with search help in se11 and use them for field 1 and field 2.
    But maybe it is enough to use data elements belonging to a domain with a value help and to set field F$AVAILABL in the field catalogue or to fill the name of the field CHECKTABLE.
    Regards,
    Klaus

  • How to add a new data type of oracle to SIM(7.0)

    Hi........
    I need to add a new data type(CLOB) to SIM of oracle .can anyone tell me how to modify or add this new data type.
    Any pointers to this will be highly appriciated.......
    thax in advance...

    Hi,
    Easiest way is to download the table eg into an Excel table (if possible) or text table. Drop the table from the database. Build your table with the new key field. Build the database table again and fill it.
    You can do it also over the database into a new table. Drop the old one. Build the enhanced one and fill it. Afterwards drop your (temporary) table.
    Maybe there are other ways, but this works.
    Success,
    Rob

Maybe you are looking for

  • LSMW  CODING

    Hi all, i need to upload data for mm01 transaction using lsmw recording method, in that my material group is 003 in text file, and after uploading i had to replace 003 by c003, for this i had to write logic for this in lsmw (concatenation) where i ne

  • Gummibootx64.efi won't boot

    I've been using gummiboot successfully on a number of systems (e.g. as in this example), but recently ran into a problem on a supermicro server with an SSD boot drive.  The installation goes smoothly, and the boot entry shows up in the system's firmw

  • IPad won't generate link from URL

    Hi,   I have the iPad 3 and I am trying to leave an URL for a link in a discussion thread for another site. For instance, I'll type my URL here.... Http://fineartamerica.com/featured/coffee-still-life-frank-bright.html And I am even using the space b

  • Portal Runtime error - throws exception

    Hi I'm having difficulty getting our MDM repository (Employee). I keep getting a portal exception when trying to view the repository using iView. I am able to connect to MDM Customers. I call Result Set of customers using an iView. I tried doing same

  • Iphoto loads when i connect my camera, then sits there looking at me :)

    Hi everyone - I have a Fuji finepix S5500 and on my old Ibook or mac mini (iphoto5) when i connected the camera iphoto loaded and prompted me to import.. now with this new mac and Iphoto6 wehn i connect the camera it loads Iphoto, shows a new drive o