2006 Apr 19 10:22 AM
Dear all.
I need a function that receives a Date / Time and another Date and calculates the the sum of those values.
Best Regards,
Thanks In advanced.
PMR
2006 Apr 19 11:01 AM
Hai Rodrigues,
The program which i gave you works out for you,i suppose.
Just check out the earlier replies..
Regards,
Srikanth.
Hai Rodrigues,
The program which i gave you works out for you,i suppose.
Just check out the earlier replies..
Regards,
Srikanth.
2006 Apr 19 10:25 AM
Sum of two dates makes no sense.
Is it a sum of a date and number of days?
Then do like this.
v_new_date = v_date + no_of_days.
If you still want the sum of two dates,
just add them up and see what happens.
v_new_date = v_date1 + v_date2.
Regards,
Ravi
2006 Apr 19 10:27 AM
Hi Pedro,
PLease try out this function module...
RE_ADD_MONTH_TO_DATE
Please reward points if the answer was useful.
Regards,
Kunal
2006 Apr 19 10:32 AM
Hai Rodrigues,
The function module CALCULATE_DATE also adds/subtracts days and months to/from a date. The following website also demonstrates a number of ways to add days/months taking into account working and non working days if that is any use. http://www.sapdevelopment.co.uk/tips/date/datehome.htm
CALL FUNCTION 'CALCULATE_DATE'
EXPORTING
DAYS = '0'
months = '01'
start_date = p_date
IMPORTING
result_date = p_date.
You can even check this function modules, it works fine.
Function Module Name:: ADD_TIME_TO_DATE
Short Description :: Adds months/days/years to date.
Entering a negative value will subtract from the date.
Parameters ::
Exporting:
I_IDATE : Initial date
I_TIME : Quantity to add
I_IPRKZ : Unit of time(D:day, M:month, W:week, Y:year)
Importing:
O_IDATE : OUTPUT DATE
Regards,
Srikanth.
2006 Apr 19 10:34 AM
Dear All.
Update my Inquiry.
I need a function that receives a Date / Time and another time and calculates the the sum of those values.
Best Regards.
Thanks in Advanced
PMR
2006 Apr 19 10:38 AM
2006 Apr 19 10:54 AM
Dear all.
New update, Thanks for all helpfull replay's.
I need to pass the following Informations:
Import:
Date_1 (MM.DD.AAAA)
TIME_1 (HH:MM:SS)
Durations (HH:MM:SS)
Export:
Date_Result (MM.DD.AAAA)
Time_Result (HH:MM:SS)
The result off this funtions (If exist in the Standard) should be exemple:
Date_1 18.04.2006
Time_1 23:45:56
Durations 02:00:00
The result of the function must be
Date_Result 19.04.2006
Time_result 01:45:56.
2006 Apr 19 11:01 AM
Hai Rodrigues,
The program which i gave you works out for you,i suppose.
Just check out the earlier replies..
Regards,
Srikanth.
2006 Apr 19 11:16 AM
Hi Rodrigues,
Here is the Function Module that satisfies your requirement completely.
It is C14B_ADD_TIME.
Just check this code and try to give your own values.
data: a type sy-uzeit,
b type sy-datum,
c type sy-uzeit,
endtime type sy-uzeit,
enddate type sy-datum.
a = sy-uzeit.
b = sy-datum.
c = sy-uzeit.
CALL FUNCTION 'C14B_ADD_TIME'
EXPORTING
i_starttime = a
i_startdate = b
i_addtime = c
IMPORTING
E_ENDTIME = endtime
E_ENDDATE = enddate
.
write : endtime, enddate, a , c.
This will work.
Regards,
SP.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |