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 to CPUTM field

karthik_rajaspic
Participant
0 Likes
1,013

Hi,

In my smartform, I am using a field MKPF-CPUTM. This field is to display the time.

I need to add 6 hours to this value.

Eg :- If MKPF-CPUTM = 09:00:00 hrs. Then I need to display it as 15:00:00 hrs.

Please help me in this regard. Thanks!.

1 ACCEPTED SOLUTION
Read only

former_member188829
Active Contributor
0 Likes
878

Hi,

DATA:time LIKE mkpf-cputm VALUE '090000'.

DATA:ADD LIKE mkpf-cputm.

add = '060000'.

time = time + add.

WRITE:/ time.

5 REPLIES 5
Read only

Former Member
0 Likes
878

Try FM SD_DEL_WAVE_SUBTRACT_TIME

Hope this helps!

Regards,

Prashant

Read only

Former Member
0 Likes
878

Hi!

DATA: lv_mytime LIKE MKPF-CPUTM VALUE '060000'.

ADD lv_mytime TO mkpf-cputm.

Regards

Tamá

Read only

former_member188829
Active Contributor
0 Likes
879

Hi,

DATA:time LIKE mkpf-cputm VALUE '090000'.

DATA:ADD LIKE mkpf-cputm.

add = '060000'.

time = time + add.

WRITE:/ time.

Read only

vinod_vemuru2
Active Contributor
0 Likes
878

Hi U can directly add the hours by multiplying the hours with 3600.

eg

PARAMETERS: hr(2) TYPE c.

DATA: tim TYPE mkpf-cputm VALUE '090000'.

tim = tim + ( hr * 3600 ).

WRITE tim.

But make sure to take care of date as well when u add the time.

U can try the FM SD_DEL_WAVE_ADD_TIME as well.

Thanks,

Vinod.

Edited by: Vinod Reddy Vemuru on Aug 18, 2008 2:40 PM

Read only

0 Likes
878

Hi All,

Thanks a lot for the replies. The issue is solved. The answer from Vishnu, helped me to solve the problem in a easy way.

I thank everyone once again.