Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Number to the date format

Former Member
0 Kudos

Hi All,

I have requirement where in the user enters the a number 14400 which is in minutes.

I am looking at function module which can convert the Number 14400 into date format.

I tried the following

   M =  I_MIN.            =  14400  Mins

   S =  I_MIN * 60.      =   86400 Sec

   H =  M DIV 60.        =  240      Hrs

   D = H DIV 24.          = 10        Days 

but could not convert the Days into date format.  Any idea how to proceed.

with rgds

Ranjith Singh.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Ranjith,

Calculate the no of days using the same logic. Use the following FM to add days to your start date.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

   EXPORTING

     date            = '20131224'

     days            = 10

     months          = 0

*   SIGNUM          = '+'

     years           = 0

  IMPORTING

    CALC_DATE       = lv_date2

           .


Hope this will help you.


Regards,

Anoop

4 REPLIES 4

sivaganesh_krishnan
Contributor
0 Kudos

hi,

you must have a start date right?? it is from start of the month or the start date is a fixed date ??

You can use FM HR_99S_DATE_PLUS_TIME_UNIT , it FM Add months(M)/days(D)/years(Y) to given date to get the future date.

refer the link which contains all the FM name about date process : Function Module related on Date calculations - ABAP Development - SCN Wiki

Former Member
0 Kudos

Hi Ranjith,

Calculate the no of days using the same logic. Use the following FM to add days to your start date.

CALL FUNCTION 'RP_CALC_DATE_IN_INTERVAL'

   EXPORTING

     date            = '20131224'

     days            = 10

     months          = 0

*   SIGNUM          = '+'

     years           = 0

  IMPORTING

    CALC_DATE       = lv_date2

           .


Hope this will help you.


Regards,

Anoop

nabheetscn
Active Contributor
0 Kudos

Hi Ranjith

First of out of the minutes you can derive days but what is beginning  date wrt to which you want to calculate date?

Nabheet

Former Member
0 Kudos

whats the format u r looking for..give an example