FM to calculate date month & year six months previous to the current date

Hi All,
Is there any function module or code to calculate date month & year six months previous to the current date.
Thanks in advance.

hi,
try this
  data : date1 like vbak-erdat.
data : q type numc3.
selection-screen : begin of block blk2 with frame title text-001.
parameters : n like q.
selection-screen : end of block blk2.
if n > 0.
CALL FUNCTION 'CCM_GO_BACK_MONTHS'
         EXPORTING
           CURRDATE         = sy-datum
           BACKMONTHS       = n
       IMPORTING
          NEWDATE          = date1
selection-screen: begin of block blk1 with frame title text-001.
select-options :  s_date for vbak-erdat default 'NEWDATE'  to 'sy-datum' no-display.
selection-screen : end of block blk1.
write : date1.
Reward with points if helpful.

Similar Messages

  • Regarding subtraction of 10 days from the current date

    Need to know how I can get 10 days subtracted from the current date before the report is excuted. This needs to appear in the selection screen before the report is excuted.
    The select option contains two fields the first field is the date which is 10 days subtracted from the current date and the next field is the current date.
    Please suggest.
    Thanks.

    Hi Dolly
    I had a same req before check that code:
    AT SELECTION-SCREEN OUTPUT.
    IF pa_older = 'X'.
    CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'
    EXPORTING
    date = pa_end  "<<<<< date or in ur case sy-datum
    days = '10'
    months = '00'
    signum = '-'
    years = '00'
    IMPORTING
    calc_date = pa_end1.  " <<< subtracted date
    ENDIF.

  • I need help highlighting an expiration date on my Numbers '09 spreadsheet. I want the text/fill of a cell to change color when the expiration date of an item is within 180 days of the current date.

    I need help highlighting cells on my Numbers '09 spreadsheet.  I want the cell text/fill to change color when the date is 180 days or less from the current date.  I already have a cell with the current date in it.  I also know how to change the fill/text colors.  All the cells have been formatted to show date only.  I am having trouble with the formula.  I can get to the Conditional Formatting menu and select "With Dates" but after that I am lost.  Can anyone help?
    Thank you for any assistance.
    B

    Set a Conditional Format rule as shown in the illustration below. The rule has been applied to all dates in column B of the table.
    Regards,
    Barry

  • To extend SAP user date and to add months to the current date

    Hi All,
    I need to extent the user date in SAP based on one condition.
    If the condition is true extend the date by 12 monthd if false 6 months from the current date.
    Can i have the FM for user date extentions and FM for getting the date.
    Thanks,
    Chandu.

    Hi ,
    You can use this FM for exteding the date.
    CALL FUNCTION 'BAPI_USER_CHANGE'
        EXPORTING
          username   = us_username
          logondata  = e_bapilogond
          logondatax = e_bapilogondx
        TABLES
          return     = i_return.
    u need to pass date and correspoing flag also.
    For extension of the date by months u can use this FM.
          CALL FUNCTION 'MONTH_PLUS_DETERMINE'
            EXPORTING
              months  = 6 or 12 ( depending up on ur logic)
              olddate = sy-datum
            IMPORTING
              newdate = us_expdate.
    Thanks and regards.
    Sham

  • Adding a year to the current date field

    Hello,
    Can any one please help on how to add a year to the current date field.
    e.g 7/19/2011 plus a year = 7/19/2012
    Thanks,
    Han Dao

    If you had a field DateTimeField1 and wanted to display the following year in DateTimeField2, you could do the following in JavaScript;
    var d1 = util.scand("yyyy-mm-dd", DateTimeField1.rawValue);
    if (d1 !== null)
    d1.setFullYear(d1.getFullYear()+1);
    DateTimeField2.rawValue = util.printd("yyyy-mm-dd", d1);
    Good luck
    Bruce

  • Web-Outlook appointments which are one year before the current date are removed

    Hi,
    my Web-Outlook works fine with my iPHONE4s but the appointments which are one year befoer the current date are removed.
    Is there an option to keep all appointments?
    regards
    Andreas

    For the OST problem, delete the OST file and let Outlook create a new one.  But your problem may be that Outlook connects to Exchange 2013 using Outlook Anywhere only--MAPI RPC is gone--and for that you need a valid certificate.  So the self-signed
    certificate is likely your main problem.
    For a self-signed certificate to work, you must add it to every client as a trusted certificate.  That is hard to do with mobile devices, which is why it's recommended to obtain a certificate from a trusted public certificate authority.  You'd
    probably find Go Daddy to be reasonably priced, and there are others.
    Ed Crowley MVP "There are seldom good technological solutions to behavioral problems."

  • How to get the current date ? in the form of dd/mm/yyyy?

    Hi all,
    As getDate( ), getMonth( ), and getYear( ) is depricated, how to get the current date or System date, month and year ? please help ??
    Regards
    Ashvini

    HI,
    Than u for the reply. But i am getting one error.
    as u said, I tried to do so.........
    but, i am getting one error.
    code
    Calendar cald=(Calendar.getInstance.getTime());
    out.println(cald);
    error message
    validate$jsp.java:86: Attempt to reference method getInstance in class java.util.Calendar as an instance variable.
    Calendar cald=(Calendar.getInstance.getTime());
    ^
    1 error
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:284)
    Pls help
    Regards,
    Ashvini

  • A script for adding the current date to file name?

    I am working in Indesign CS3. I frequently save file as PDFs into a designated folder. I was hoping for help in writing a script that would apply the current date to the end of the file name, when saved into this folder. Some days, I save the same file several times, into this folder. I was also hoping there was a way to add a date and version, for example "filename_2.25.11(1).pdf" Is this possible? Can someone help me?

    ok, I ended up with this test routine:
    on adding folder items to this_folder after receiving added_items
    tell application "Finder"
    repeat with this in added_items
    my checkifopened(this)
    display dialog (name of this) as text
    end repeat
    end tell
    end adding folder items to
    on checkifopened(this)
    set a to POSIX path of (this as alias)
    repeat until 1 = 0
    ## don't like that one because it relies on an error msg ... so
    (** try
    set b to do shell script "lsof | grep " & quoted form of a
    on error
    exit repeat
    end try**)
    ##so I use this one
    set b to do shell script "lsof"
    if b does not contain a then
    exit repeat
    else
    say "still opened"
    end if
    end repeat
    end checkifopened
    this is a folder action that tests if the added file is still opened by an application... there is no delay between each test-loop since lsof takes some time to execute...
    And after adding a timeout (just in case) to this function the final script looks like this:
    on adding folder items to thefolder after receiving added_items
    tell application "Finder"
    set folderkind to kind of thefolder
    set myfiles to every item of thefolder whose name does not contain "#" and kind is not folderkind
    repeat with myfile in myfiles
    set myfile_datestring to my get_datestring(creation date of myfile)
    set myfilename to name of myfile
    if (count of every character of myfilename) > 4 and (character -4 of myfilename) as text is "." then
    set filestatus to my checkifopened(myfile, 60)
    if filestatus = false then
    display dialog "timeout on folder action"
    else
    set tmp to ((characters 1 through -5 of myfilename) & "#" & myfile_datestring & (characters -4 through -1 of myfilename)) as text
    set myfilename to my checknamewith_pdfsuffix(tmp, thefolder, false)
    set name of myfile to myfilename
    end if
    end if
    end repeat
    end tell
    end adding folder items to
    on get_datestring(mydate)
    return year of mydate & "-" & (characters -2 through -1 of (("0" & (month of mydate as integer)) as text)) & "-" & (characters -2 through -1 of (("0" & (day of mydate as integer)) as text)) as text
    end get_datestring
    on checknamewith_pdfsuffix(n, D, looped)
    --check if filename exists in D
    -- so if "A File.pdf" exists it names it "A File 1.pdf","A File 2.pdf",...
    #n = string of the filename
    #D = file reference to the directory to check
    #looped = boolean used for recursive loop...
    tell application "Finder"
    set thefiles to name of every item of (D as alias)
    end tell
    if thefiles contains n then
    if looped = false then
    set n to ((characters 1 through -5 of n) & "(1)" & (characters -4 through -1 of n)) as text
    my checknamewith_pdfsuffix(n, D, true)
    else
    set tmp to (last word of ((characters 1 through -5 of n) as text) as integer)
    set tmpcount to (count of characters of (tmp as text)) + 5
    set tmp to tmp + 1
    set n to ((characters 1 through (-1 * tmpcount) of n) & "(" & tmp & ")" & (characters -4 through -1 of n)) as text
    my checknamewith_pdfsuffix(n, D, true)
    end if
    else
    return n
    end if
    end checknamewith_pdfsuffix
    on checkifopened(this, mytimeout)
    ## this file reference
    ## timeout in seconds
    set a to POSIX path of (this as alias)
    set startdate to current date
    repeat until 1 = 0
    ## don't like that one because it relies on an error msg ... so
    (** try
    set b to do shell script "lsof | grep " & quoted form of a
    on error
    exit repeat
    end try**)
    ##so I use this one
    set b to do shell script "lsof"
    if b does not contain a then
    return true
    else if ((current date) - startdate) > mytimeout then
    return false
    else
    ##say "still opened"
    end if
    end repeat
    end checkifopened
    to use this save this script in /Library/Scripts/Folder Action Scripts
    and add this as a folder action to your folder...
    The script processes all files inside that folder each time a new files is added...

  • FM which gives the date if we add 'x' number of days to the current date.

    Hi all,
    can you plz tell me the FM which will give me the exact date if i add some ' X ' number of days to the present date.
    in detail -->my inputs would be    1)DATE
                                                    2)no of days
    i need--> the exact date which comes after those days get added to the given date.
    PLZ HELP ASAP.
    Rgds,
    REDDY.

    Hi,
    You can use FM RP_CALC_DATE_IN_INTERVAL.
    data: wa_date  like sy-datum.
    *Add 21 days to current date.
    call function 'RP_CALC_DATE_IN_INTERVAL'
             exporting
                  date      = sy-datum
                  days      = 21
                  months    = 0
                  signum    = '+'
                  years     = 0
             importing
                  calc_date = wa_date.
    write: / wa_date.
    Regards,
    Ferry Lianto

  • How to display the current date in Flex app

    I need to display the current date in my Flex application.  Is there a simple way to do this and display it as a label or text field?  Also, can this be formatted to display the date as "Day of Week, Month Day, Year"?
    Thanks!

    You can use this code and this page to tweak the formatString property.
    http://livedocs.adobe.com/flex/3/langref/mx/formatters/DateFormatter.html#formatString
    If this post answers your question or helps, please mark it as such.
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
      creationComplete="init();">
      <mx:Script>
        <![CDATA[
          [Bindable] private var date:String;
          private function init():void{
            date = new Date().toString();
            date = df.format(date);
        ]]>
      </mx:Script>
      <mx:DateFormatter id="df" formatString="EEEE, MMMM D, YYYY"/>
      <mx:Label text="{date}"/>
    </mx:Application>

  • Prob in populating the current date in drop down

    I want to get the current date into a drop down list.
    There are three drop down.
    1.Month 2. Day 3. Year.
    If anytime the page loads there should be current date in the drop down list. and if any one wants to change he can change the date accordingly.
    Can any one help me in sorting out this prob.
    I can think of getting the current date in the drop down by keeping it in the 1st option of the select tag. But when you click on the list the current date is not at proper location compared to other numbers in the list.
    Please reply.
    Message was edited by:
    aniketh_parmar

    function addit(){
    var dd = new Date();
    var yearnow = dd.getFullYear(); //gets 4 digit year
    //use getDate() & getMonth() methods in seperate fns, and populate
    //date and months
    for (var i=yearnow; i <= yearnow + 25 ;++i){
    addOption(document.getElementById("year"), i, i);
    function addOption(selectbox,text,value)
    var optn = document.createElement("OPTION");
    optn.text = text;
    optn.value = value;
    selectbox.options.add(optn);
    }in your jsp:
    <body onload="addit();">
    <form>
    <select name="month">
    </select>
    <select name="day">
    </select>
    <select name="year">
    </select>
    Have a seperate fn, and using the above 3 methods get
    today's (current) month, day & year.
    then something like,
    document.getElementById("year").selectedIndex = currYear;
    document.getElementById("month").selectedIndex = currMonth; //0 is Jan and 11 is Dec
    document.getElementById("day").selectedIndex = currDate;

  • GregorianCalendar - getting the current date

    Hi,
    Have any of the Calendar classes been changed in version 1.5. I'm trying to get the current date and time in an application, to add to filenames when they are backed up. In java 1.4 the following code was sufficient to get the information required:
    GregorianCalendar cal = new GregorianCalendar();
    filename = "C:\\Program Files\\Apache Group\\Apache2\\www\\test\\htdocs\\backups\\";
    filename += theFile;
    filename += "=" + getUser() + "=" + cal.get( Calendar.HOUR_OF_DAY ) + "_" +
         cal.get( Calendar.MINUTE ) + "=" + cal.get( Calendar.DAY_OF_MONTH ) + "_" +
         ( cal.get( Calendar.MONTH ) + 1 ) + "_" + cal.get( Calendar.YEAR );
    I'm writing another app using the same code and SDK 1.5, but it's returning the same values every time.
    Cheers
    Matt

    I wrote a small program to test the Calendar object on my system:
    import java.util.*;
    import java.awt.event.*;
    import java.awt.*;
    public class Tester extends Frame implements ActionListener
         public Tester()
              javax.swing.Timer timer = new javax.swing.Timer( 1000, this );
              timer.start();
              setSize( 400, 400 );
              show();
              addWindowListener(
                   new WindowAdapter()
                        public void windowClosing( WindowEvent e )
                             System.exit( 0 );
         public void actionPerformed( ActionEvent e )
              Calendar cal = new GregorianCalendar();
              System.out.println( "Time: " + cal.HOUR + ":" + cal.MINUTE + ":" + cal.SECOND );
         public static void main( String args[] )
              Tester t = new Tester();
    This repeatedly outputs:
    10:12:13
    I tried this with Calendar and GregorianCalendar. Both of them do not seem to work. I'm not using the same Calendar object, or outputing in the same second....

  • How to get the current Date from the system?

    How do I acquire the current date from the system? Also, if possible, can I assign the day, month and year separately into three variables and how? It would be thankful if some simple Example could be given. Thanx!

    import java.util.*;
    public class count {
    public count() {
    Calendar now = Calendar.getInstance();
    int month = now.get(Calendar.MONTH);
    int day = now.get(Calendar.DAY_OF_MONTH);
    int dayyear = now.get(Calendar.DAY_OF_YEAR);
    int year = now.get(Calendar.YEAR);
    int a = 365;
    int b = a - dayyear;
    System.out.println("The day is the" + " " + day);
    System.out.println("IT is the" + " " + month + " " + "month of the year");
    System.out.println("The year is" + " " + year);
    System.out.println("This many days till next year" + " " + b);
    public static void main(String[] args) {
    count cou = new count();
    }

  • How can I make iCal in Lion open to the current date?

    I just updated from Snow Leopard to Lion and have had all of the frustrations with changes to iCal that are well-documented here and elsewhere.  One issue I haven't seen addressed, however, is a new behavior after quitting and re-starting.
    Previously, no matter what month/day/week I was viewing when I quit iCal, it would open the next time to the current (month/day/week).  Now, it opens to whatever date(s) I was last viewing when I quit.
    This is highly annoying - 99% of the time, if I quit iCal while looking at (some date 6 months into the future), that is NOT the date I'm looking for when I re-launch.  It's much more consistent behavior to always re-open to the current date, in whatever view (month/day/week) I previously used.  So if today I launch iCal and I'm thinking about adding an event a month in the future, I open iCal, change to month view if needed, and go forward one month.  This is the way iCal always worked previously.  Instead, the version in Lion might leave me on any random month, depending on what I was doing when I closed the program the last time, and so I have to figure out "what month/week am I looking at?" before I know how to navigate.  Very irritating.  (As is the move of the forward/back buttons away from the month/day/week buttons, necessitating that I move the cursor to two different areas of the screen in order to navigate.  Whose idea was THAT?)
    I haven't found a preference to resolve this bizarre behavior change.  Can anyone help?

    Hi,
    I don't know of a preference, but have you used ⌘-T in iCal?
    Best wishes
    John M

  • How to get the current date and compare dates

    hi
    does anyone know how you would get the current date?
    furthermore, how to compare the current date with a past date to see how many days or months have past since then?
    thanks

    have a look at the Date class. new Date() creates an object containing the exact date and time at creation time. (Date).getTime() might be useful for comparing two dates. GregorianCalendar might be useful, too.

Maybe you are looking for

  • Any way to apply effects (warp, crystal, wrinkle etc) evenly to symetric geometric shapes?

    Hi all, Just wondering if anyone knows if there is a way to evenly apply a warp, wrinkle, crystal effect/tool to a symetric shape like a circle and other geometric shapes??? Im I could probably cut the shape into parts and flip them over so that they

  • How to tune this SQL (takes long time to come up with results)

    Dear all, I have sum SQL which takes long time ... can any one help me to tune this.... thank You SELECT SUM (n_amount) FROM (SELECT DECODE (v_payment_type, 'D', n_amount, 'C', -n_amount ) n_amount, v_vou_no FROM vouch_det a, temp_global_temp b WHERE

  • Loading DATE datatype into a measure

    Hi Folks, Is there any way to load DATE values into a measure? Is yes, how? I'm using OLAP 10G. Thanks, JSoufer

  • Transferring Contacts from a Curve

    A few months ago I backed up all my contacts from my Curve (forget which model number) onto my computer via a blackberry program. Just a day or two after that the phone was stolen. I now have an iphone and have been unsucessful at moving my contacts

  • Unable to locate custom themes in Keynote '09

    I created some custom themes that I want to delete. I have been unable to locate them on my hard drive. The directions in the Keynote '09 User Guide don't point me to the right place. I found the stock themes in Applications> iWork'09> Keynote.app> C