Please search in SDN before posting.
Hi,
Why don;t u use TIME stamp Function modules
ALL FUNCTION 'RKE_TIMESTAMP_CONVERT_INPUT' EXPORTING i_date = v_datum i_dayst = sy-dayst i_time = v_uzeit i_tzone = sy-tzone IMPORTING e_timestmp = ch_timestmp EXCEPTIONS date_invalid = 1 OTHERS = 2
Regards,
Pravin
Hi,
This can be dealt purely logical.
You have a date and time and you add another time to it while doing that,
check if by adding the 2 times you get a value more than 24 if yes increment the date by 1 day.
and (added time - 24) wil give the remaining time to be displayed with the new date
Eg: 15.04.2010 06:00:00 + 22:00:00 =
when You add 22 and 6 its 28. so its greater than 24 so merely change thwe date to the next one and make the tiem = 28 - 24 = 4
so You would have 16.04.2010 04:00:00 as the answer.
Hope this helps.
Hi,
If you add any number to the date field say
data w_date type sy-datum.
w_date = sy-datum.
w_date = w_date + 5.
then 5 days will be added to the present date.
data w_time type sy-timlo.
w_time = sy-timlo.
w_time = w_time + 5.
then five seconds will add to the present time.
Regards and Best wishes.
Am giving an example as to how the FM is to be used...
Hope this helps you...
data : xtra type T.
data : r_date type D.
data : s_date type D.
data : r_time type T.
data : s_time type T.
data : r_date1(10) type c.
s_date = '20100415'.
s_time = '060000'.
xtra = '220000'.
CALL FUNCTION 'C14B_ADD_TIME'
EXPORTING
i_starttime = s_time
i_startdate = s_date
i_addtime = xtra
IMPORTING
E_ENDTIME = r_time
E_ENDDATE = r_date
.
write : r_date dd/mm/yyyy to r_date1.
write : r_date1 .
write : r_time .
Please revert back in cse of any issues...
Basic date/time questions = FAQ = not allowed.
Please search before posting and don't reply to such questions!
Thread locked
Thomas
Add comment