FM to get previous fiscal month/year and calendar month/year for a date.

Hi All,
I am having a requirement to extract some data based on either the previous fiscal month/year or the previous calendar month/year. There is no company code input to find the fiscal/calendar month/year.
At selection screen, user can select either fiscal or calendar selection.
Based on the selection, the data will be extracted.
For the system date, we need to calculate previous fiscal month/year or previous calendar month/year and populate the calculated data back to the selection-screen.
Can you one of you please suggest an FM to find previous fiscal month/year and previous calendar month/year.
Thanks in Advance,
Regards
Gowthami

Hi Gowthami,
You can use following function module to calculate previous / next day or month or year.
   call function '/SAPHT/DRM_CALC_DATE'
      exporting
        date      = sy-datum
        days      =
        months    =
        sign      = '-'
        years     =
      importing
        calc_date = .
Here, you can give '-' to sign, if you want previous day / month / year.
Here, you can give '+' to sign, if you want next day / month / year.
And depending upon your requirement, you can pass suitable value to days / month / year.
e.g. To calcualte last month,
   call function '/SAPHT/DRM_CALC_DATE'
      exporting
        date      = sy-datum
        days      =
        months    = 1
        sign      = '-'
        years     =
      importing
        calc_date = wv_prev_month.
so it will give '23-01-2008' . Then convert it in the required format as per your requirement using string function concatenate.
Hope this help you.
Regards,
Anil

Similar Messages

  • My iPhone 4 getting off automatically while battery 60% or more and turn on when i plug in please advice it is battery problem or hardware i use this mobile for 2 years and 3 month.

    My iPhone 4 getting off automatically while battery 60% or more and turn on when i plug in please advice it is battery problem or hardware i use this mobile for 2 years and 3 month.
    Thanking you.

    1.  you may have to take it in to Apple and get an out of warranty iphone for $199.
    2.  you can get your information from a backup of your phone.  you do have a backup of your phone right either in iTunes or icloud.  If you don't then your answer will be no.

  • Report that shows Asset number with acquisition year and acquisition month

    Hi Gurus,
    Is there any standrd FA report that shows assts with acquisition year and equisition month/period.
    thnx

    This reprot gives you the calender year dates but we are actually for for fiscal year date and period.
    Example
    asset acquired on 05/01/2009 calender year
    our fiscal year will be 02/01/2010. ( April to March).
    we need to generate reports that shows second dates ( fiscal year  02/01/2010)  and your mentioned report shows only caldender year( 05/01/09). advice if know any report
    thnx

  • My iPhone 4S which is 1 year and 10 months old has now developed yellow spot on left side of screen. What should I do as my iPhone is out of warranty now???

    My iPhone 4S which is 1 year and 10 months old has developed yellow spot on left side of screen. Otherwise iPhone works perfectly but that yellow spot continuously annoys me. What should I do as my iPhone is out of warranty now??? The yellow spot becomes prominent on playing games... Will it spread further and get even worse or it is harmless??? Can apple india help me to figure out the issue?? Help!!

    You can live with it.
    Buy another iphone.
    Buy a different phone.
    Do without a phone.
    Try to find a 3rd party repair center at your risk

  • HP Slatebook x2; Tablet wil not charge, 5sec a battery is shown. After 1 year and 1 month.

    Hi,
    I have the HP slatebook x2 10-h0000ed, just 1 year and 1 month.  (bought and used in the Netherlands) 
    So 1y1m means, no official warrenty anymore, but a warrenty should not be the life expectancy...
    My problem, actually none, until this morning, the X2 was totally switched off and could not startup.  
    After poweron it was just was showing a battery at 10%, the shutted down?
    It seem to me that it has drained itself from almost all power (99%?), and then self shutted down. 
    Small history of the event;
    Yesterday evening I left it at 2x 100% (base+tablet), and disconnected the charger.
    The charger led was white (full&ready). So this time I did not leave the charger in the unit, to safe some energy...
    While at 2x 100% charged, I powered the unit completely down. Afterwhich I closed the the tablet+base.
    Now, this morning the unit did not wake. Normally press the powerbutton for 3-5 seconds or so.
    The only thing I saw was a white battery with 10% red level on the black background.
    Then after 5 second or so it switched back off by itself.
    No fix until so far.
    This I tried;
     - Disconnected the tablet, and charged only the base. After 1-2 hours? the orange charger led went white. (full)
     - Placed the tablet back onto the base, power on. no succes, same battery screen, and back auto off in 5 seconds.
     - Disconnected the tablet, and tried to charge only the tablet. After 1-2 hour no succes.
       The whole time the charger led was off. Not orange. Not white. Only off. And not charged anyting.
     - While disconnected to the base but connected to the charger, I pressed the power. 
       The same thing happened, but with a twist..
       Same battery screen, and back auto off in 5 seconds. 
       But when the screen + battery image was on, the charger was orange also. But only for thet 5 seconds moment.
       This is a mini charging moment ??? And gave me the following idea...
     - So I pressed and pressed and pressed the power button for atleast 1 hour uninterrupted, with many pop-ups of 
       the battery screen. And many temporarily orange charger leds.
       With my hope that many times a little charge would revive the poor I-dont-wanne-charge condition. 
       But no ,also no success.
       Power on is still the same battery screen, and back auto off in 5 seconds. 
    - Placed the none-charged tablet back onto the base.
       Power on is still the same battery screen, and back auto off in 5 seconds. 
    So I read and browsed;
     - Many complaints about HP and the battery of this kind of tablet. 
        The charging sequence problem are in short; Dead on arrival, but most of the time after 
        changing the tablet at the store it was ok.
        So some leaving the factory unchargeable.
     - But mine tablet was now 1y1m still up and running ok !
        Until the voltage dropped below voltage-X.
     - And lower then voltage-X means, by product-hardware, of by prodict-software, (I think)
       that the charging-process is blocked and/or shutdown because the voltage is too low.
     - In my opinion, when the voltage is too low, it should charge the battery, and not stop and exit and shutdown.
    Future actions;
     - Now it is saterday, so I have to wait until monday, until I can contact HP (at the Netherlands).
     - I will discribe this problem and how this happens.
     - I hope that HP is accommodatin and compliant to me with this problem.
     - As I say in the beginning, a warranty should not be life expectancy of a product.
     - The tablet nor adapter or wires and connectors were mistreated, dropped, bend, scratched, etc. Just normal everyday use.    :-)
     - I hope HP will give more warrenty then the 1year !
    Do you have any ideas ?
    I sort of out now.....
    regards,
    Manuel.

    Status update;     good..  &  and bad..
    the good..
    The tablet (tablet+keyboard, not adapter) was transported to the HP-centre, for repairs.
    From the Netherland to Poland, after a about 1 week it was returned.
    The transport service arranged by Hp and Ups, was without any problem.
    As requested to not-factory-default or erase otherwise, it was returned OK. All accounts where still fully present.
    Repaired; As stated on the repair form in Dutch 'voeding bord vervangen'. Meaning 'power bord replaced'.
    So I think something like the charge-pcb (inside the tablet?) was replaced.
    Tested;   Individual and all joined (tabl+keyb) charging.
    While monitoring the power usage with a battery-monitoring-app.
      (the 'battery monitor widget', and the system-default widget.  always the same results. !!)
    Results;
     - The normal usage is OK.
     - But charging has some issues, see the bad, below.
    Also, the 'UpdateEC' popup re-appeared after the repairs. 
    The message;
      UpdateEC
      New EC Firmware found!!
      Would you lik to update EC firmware?
      (I do not know anymore the the version values from and to..)
    the bad..
    Maybe a new problem, starting from day 1 (after receiving it back).
    This is still some preliminairy info, because I am still monitoring this.
    The possible new problem;   Charging the keyboard-battery !
    A strange 'thing' seems to be going on with the keyboard battery.
     - When drained to 1%, it charges in 20 minutes to 100% ??  While the table battery charges in 2 hours (120 mins).
     - When fully at 100%, is drains much faster then the tablet battery.
     - When at 50-90%, or somewhere in the middle, it 'jumps' to 1% ??
    I have screenshots of this odd charge/discharge effect.
      (screenshots of the 'battery monitor widget'. not the system-default widget, but always  same results.)
    I will keep monitoring this, and when the problem is a bit more clear, I will probably make a new support-request.
    Keep you posted!
    regards,
    Manuel.

  • I have an iphone4 and that I have had for four years and they are saying that I am not eligible for an upgrade until the end of July 2015. That is four years and 3 months after I purchased this phone. "Customer service" said I had an upgrade at the end of

    I have an iphone4 and that I have had for four years and they are saying that I am not eligible for an upgrade until the end of July 2015. That is four years and 3 months after I purchased this phone. "Customer service" said I had an upgrade at the end of July 2013, which I did not. She said that in the system my husband took an upgrade July 29th 2013. He didn't even have a Verizon phone, he had a work phone with T-mobile. I have asked what device he supposedly upgraded to since no phones have been activated and we all still have our same phones and numbers. Remember at the time, said husband had a work phone with T-mobile. I still have the very same phone as do all of the rest of my family members. No one has upgraded. I spoke with "customer service" for more than a half an hour today, Char promised me that her supervisor (Emily) would call me back by 7:30 tonight to clear up this problem. Well guess what? No call back so where should I go from here? Any advice or help would be greatly appreciated. Thank you for your help.

    someone swapped upgrades.  Phone could have been sold For quick cash. 

  • How to calculate the number of days until your next birthday. Only using current month, day and birth month and day.

    I'm trying to calculate the number of days until your next birthday. Only using current month, day and birth month and day. I can get close but i'm way off. When i enter in the next day, the amount of days is supposed to be 364. This is where I am having problems. I know my code is way off. I just need some guidance please!
    Attachments:
    D5.7_1.vi ‏8 KB

    I just had a little fun with the Time Record...
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines
    Attachments:
    D5.7_1_BD.png ‏19 KB

  • Difference between this month amount and last month amount.

    Hi experts,
    in report i am showing amount in one coloumn for one year and month wise. in another coloumn i need to show the difference between present month amount and last month.amount for the total months..how to done this..
    regards...roi

    Hi,
    You may do this using cell definition.
    If number of months and format is finite then you may do this creating seperate RKF/Selction for each month and then use the same in required CKF/Formulas for deducting. You may display the CKF/Formulas in report for your requirement and hide the rest.
    I hope it will help.
    Thanks,
    S

  • When synchronizing my iPhone 4G with Outlook 2007 in my Windows 7 PC I get duplicated folders of Contacts and Calendars in both. How can I solve it?

    When synchronizing my iPhone 4G with Outlook 2007 in my Windows 7 PC I get duplicated folders of Contacts and Calendars in both. How can I solve it?

    Well, you can go into setting>mail, contacts, calendars>add new account or through iTunes you can plug your phone into your computer, open iTunes, select your device, then select info. I hope this helps. Au revoir!

  • How to get the page layouts programmatically and create a page for that pagelayout

    how get the page layouts programmatically and create a page for that pagelayout and add webpart
    please help me with da code.Thanks
    adityadugyala

    Hi if your page layouts alreday created then create new page programaticaaly  and apply your page ayouts to that page by coding you can do something like following
    PublishingWeb publishingWeb =
    PublishingWeb.GetPublishingWeb(web);
    PageLayout[] layouts = publishingWeb.GetAvailablePageLayouts();
    PageLayout layout = layouts[0];
    string pageName =
    "MyPublishingPage5.aspx";
    PublishingPage newPage = publishingWeb.GetPublishingPages().Add(newFolder.Folder.ServerRelativeUrl +
    "/"+ pageName, layout); 
    newPageUrl = web.Url +"/" + newPage.Url;
    newPage.Description = "This my sample publishing page";
    newPage.Title = "My Publishing Page";
    newPage.Update();
    Please follow link
    http://blogs.msdn.com/b/sowmyancs/archive/2008/03/15/create-publishing-pages-in-portal-sites-programmatically.aspx
    Please mark answer , if you think answer is helpful or correct.

  • How can i get difference in base plan and actual/current plan for a project

    Hi PS Experts,
    How can i get difference in base plan and actual plan .
    For example-
    Project1 is created for 10 days (start and end date difference).
    Now in between -project is extended/changed for 12 days .
    What is the way to get 2 days as a difference in base plan and current plan.
    Thanks
    Suraj prakash

    Hi Suraj,
    You can follow a convention that -
    (1) Forecast Start/Finish dates: Used only for Primary planning, once initial planning is done you should not change these dates.
    Now, you will copy the same dates in Basic Start/Finish dates also.
    (2) Basic Start/Finish dates: Whatever changes are done after the initial planning, you will make the changes only in Basic Start/Finish dates.
    So, in Project Planning board, if you enable Forecast and Basic dates with different color coding, you can clearly see the variation in the Project schedule.
    Hope this helps.

  • I have a iPod classic 2gb. I haven't used in years and I charged it for 3 hours and it won't turn on and I tried resetting and nothing. I plugged it into iTunes and iTunes doesn't even recognize it. I just have a black screen. PLEASE HELP!!!

    I have a iPod classic 2gb. I haven't used in years and I charged it for 3 hours and it won't turn on and I tried resetting and nothing. I plugged it into iTunes and iTunes doesn't even recognize it. I just have a black screen. PLEASE HELP!!!

    I'm sorry it's a nano 2gb silver

  • I was trying to get my personal computer contacts and calendar in outlook on my iphone and ipad.  I was told to use icloud.  I went to control panel and then icloud and selected my contacts and calendar.  Now ALL MY DATA IS DELETED FROM OUTLOOK.  Help!!

    I was trying to get my personal computer contacts and calendar in outlook on my iphone and ipad.  I was told to use icloud.  I went to control panel and then icloud and selected my contacts and calendar.  Now ALL MY DATA IS DELETED FROM OUTLOOK.  Help!!

    I was just on the line with Apple Tech support.  First of all, I learned that when you link contacts to iCloud, it moves all your contacts to another/new address book...look for aother address books and you will see it.  But I found the new address book dies weird things and changes the "Display Names" format.  Evidently (per Apple support tech) there is no way to avoid this problem...so I just delinked the iCloud from my contacts.  The contacts stayed in the iCloud address book...so I exported them to a CSV (comma separated value) file and saved it on my desktop and then imported that list into my original contacts folder.  Now everything is back the way it was...being able to use my contact address book the way I did before.  I was surprised that they never considered or realized this problem...but then the tech guy admitted that they really don't have A LOT of experience using Windows PC's.

  • I bought a new iMac today. I'm using migration assistant to move all my software, but the time just keeps getting longer. It says connect an Ethernet cable for faster data transfer. I did, but that doesn't seem to help. Any ideas?

    I bought a new iMac today. I'm using migration assistant to move all my software, but the time just keeps getting longer. It says connect an Ethernet cable for faster data transfer. I did, but that doesn't seem to help. Any ideas?

    m1doc,
    Are you migrating from a Mac or a MS Window machine? Either way you probably should be in touch with AppleCare, you have 90 days of free AppleCare telephone support. They can usually help on issues like this. If you don't know the phone number please use http://support.apple.com/kb/HE57 to help find the number in your country.

  • Creating a fiscal date table that includes Day of Year and Week of Year column

    Hi,
    Our fiscal year runs between 1st October through to 30th September and I'm trying to create a date table that I can use to represent this in Powerpivot (I'm using Excel 2013). I had no probably creating columns for Fiscal month or fiscal year, however I am
    having issue breaking it down more than that, specifically I cannot work out how to calculate:
    - day of the year
    - week of the year (with week one starting on the first day of the year rather than the first Monday)
    I worked out how to do the day of the year until I had to try and account for leap years which broke the formula I had! Can anyone please recommend solutions, I cannot see anything online about this. Obviously I know that it is simple to do this for a normal
    calendar year but this approach doesn't work with a custom fiscal year.
    Whilst it is useful for several reasons, my main reason for wanting week is so that I can plot my Pivotcharts more smoothly (although I may have missed an easier way to do that).
    Thanks,
    James

    For my example I started with 1 column in Power Pivot called [Date]
    I created the following Columns
    [DayofMonth] =Day([Date])
    [MonthNumber] =Month([Date])
    [Fiscal Year] =IF([MonthNumber]< 10, Year([Date]), (Year([Date])+1))
    [Fiscal Day] =[Date] - DATE(([Fiscal Year] -1), 10,1) +1
    [Fiscal Week] =RoundUp([Fiscal Day] / 7, 0)
    Change [Date] to whatever your date column is and those DAX formulas will get you what you need

Maybe you are looking for

  • Material document ,quantity and stock location for a given material

    hello all, i have a requirement like this. in the selection screen i have, material..... plant.... posting document date..... i need to get material document number,quantity,units and stock location for the above mentioned selection criteria... what

  • Photoshop CS5 is crashing still

    I'm using OS X 10.6.8 and I have done the following per google search to rememdy the problem: 1. Update to latest version of Photoshop 2. Verify that all fonts are OK 3. Tweak perferences how much RAM used etc and it is still crashing usually upon tr

  • Moving mailboxes in 2013 - failing

    Hello, I am in ECP on 2013.  I'm moving from 2007 to 2013 and the first mailbox is nearly empty so it should move in seconds - it is only for testing. I've gone to recipients selected a mailbox Move mailbox to another database I create a batch file t

  • So if I buy the IPhone 4s unlocked, can I use a prepaid plan for At

    I would like to buy the IPhone 4s but I dont want to pay alot of money.

  • Calling webdynpro application in standard POWL

    Hi Experts, I have a requirement  I need to call a webdynpro application from the POWL ALV list when I click on the one of the cell whihc contains the link, it triggers the Feeder_class->handle_action method, Here I am creating the URL , COuld you pl