Application Development and Automation 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: 
Read only

Adding hours/day to a date

Former Member
0 Likes
799

Hello,

I have field of length 20 which contains date in the format “mm/dd/yyyy hh:mm:ss”.

I want to add 5 hrs, 8 hrs, 2 days to this date value depending upon some condition.

Can anyone please suggest how to do this or any FM which does this.

Thanks in advance

Hello,

I have field of length 20 which contains date in the format “mm/dd/yyyy hh:mm:ss”.

I want to add 5 hrs, 8 hrs, 2 days to this date value depending upon some condition.

Can anyone please suggest how to do this or any FM which does this.

Thanks in advance

4 REPLIES 4
Read only

Former Member
0 Likes
763

splite into two logic.

hour.

calcu the hour.

24 = 1day.

day.

add that day with result.

Read only

Former Member
0 Likes
763

Hi..

DATA : FA(20) TYPE c,

FB(10) TYPE c,

FC TYPE d,

FD(8) TYPE c,

FE TYPE t.

data : f_m(10) type c,

f_d(10) type c,

f_y(10) type c,

f_h(10) type c,

f_mi(10) type c,

f_s(10) type c,

f_aa(10) type c,

f_bb(10) type c.

FA = '07/01/2007 08:09:10'.

SPLIT fa AT space INTO f_aa f_bb.

SPLIT f_aa AT '/' INTO f_m f_d f_y.

SPLIT f_bb AT ':' INTO f_h f_mi f_s.

      • add your logic...

i want to help you.

regards..

Read only

Former Member
0 Likes
763

Hi,

If you want to use FM, then try FM RP_CALC_DATE_IN_INTERVAL.

data: wa_date like sy-datum.

call function 'RP_CALC_DATE_IN_INTERVAL'

exporting

date = sy-datum

days = 13

months = 0

signum = '+'

years = 0

importing

calc_date = wa_date.

write: / wa_date.

<b>Reward points if this helps,</b>

Kiran

Read only

Former Member
0 Likes
763

hi jeet,

try using end_time_determine