Current Position:Home > FM to get the number of days in Year,month and days by giving number of day

FM to get the number of days in Year,month and days by giving number of day

Update:10-11Source: network consolidation
Advertisement
Hi ALL,
This is quit differnt.
I need to give input the 'start date' and the 'number of days' and get the total days from the start date in year,month and day format.
for example.
start date :01.01.2009
number of days as 32
then i should get
years:0
months :1
days :1
Pleas help me out.

The Best Answer

Advertisement
hi Anusha,
first u pass the date and the days to the following fm you will get the result date....
data:date type sy-datum,
      r_date(10) type c.
date = sy-datum.
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
   DAYS              = '32'
   MONTHS            = '0'
   START_DATE        = date
IMPORTING
   RESULT_DATE       = r_date
write:/ r_date.
then you need to pass the result date and the date to the following fm to get the required output...
CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
    EXPORTING
      date1                   = r_date
      date2                   = date
    IMPORTING
      years                   = v_years
     months                 = v_months
    days                     = v_days
    EXCEPTIONS
      invalid_dates_specified = 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.
here u will get the difference in days,  months and year...
i hope u wil get help from this...
regards
Ashu  Singh
  • FM to get the number of days in Year,month and days by giving number of day Update:10-11

    Hi ALL, This is quit differnt. I need to give input the 'start date' and the 'number of days' and get the total days from the start date in year,month and day format. for example. start date :01.01.2009 number of days as 32 then i should get years:0

  • Re: Verizon takes money out of my bank account without my authorization Update:10-11

    I have been with Verizon for 12+ yrs. It is a never ending battle with overages and bank screw ups! The financial service people are the most belligerent, rude pretty much >Profanity removed< department EVER. They get more irate than the customer. A

  • Power down issue on a K9N SLI-2F (601-7250-090) Update:10-11

    I have a K9N-2F with the serial number 601-7250-090 Kxxxxblablabala According to the sticky on the powerdown issue it should not be affected. But since about a month it will power down when I download large files. It always powers down the first 5-6

  • Switch from trial to paid account Update:11-30

    Dear all, I run an IT company in Italy and need to edit images with Adobe Illustrator for a client of mine. So I asked a collaborator of mine to activate a trial account for Illustrator CC 17 and he started the work. At the end of the 30 days, we dec

  • Excise condition error in tax classification table Update:11-30

    Dear Gurus, While executing vat report in F.12, the system is throwing error" In table A003, the entry JMOP M2 IN is missing". After this it is showing a FI material doc no. which is affected. Actually this is dealer purchase scenario. I have ch

  • Complimentary Tablet? I think NOT! Update:11-30

    When I upgraded my FiOs to Quantum I received a voucher that says "Claim Your Complimentary Tablet Today!" I am instructed to bring the voucher in to a Verizon Wireless corporate store and pick one of two 8-inch tablets. I selected the LG G Pad

  • KO8G issue Update:11-30

    Hi Gurus, We have one issue in AUC settlement with investment profile by KO8G.then we are getting one error.i.e,the particular asset number "161567"-0 is not in the company code "5230".So when you settling from internal order to AUC,th

  • Excite sent out for repair 07-24-12 the day after purchase Update:11-30

    I bought a excite 10 32g and it loaded up to a test tool screen right out of the box so I called Toshiba for help ,After 3 phone calls Toshiba told me to return the tablet to where it was  purchased or send it to them for repair with a 7 day turn aro

  • How to find licence number to activate software ? Update:10-11

    I have just bought the Adobe creative Cloud for enterprise. I had download the creative cloud and now each software is asking for a licence number but I can't find it. And I have no acces to Adobe Licensing website to get one. Can you help me? Thanks

  • How do I use cell number associated with iPad 2 3G Update:10-11

    How do I use cell number associated with iPad 2 3GFor Messages you can can use your email address, the iPad doesn't have a phone number that you can use.Read other 2 answers