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

Function Module for Time

Former Member
0 Likes
1,060

Hi ,

Is there any standard function module that gives me time reduced by 30 minutes?

8 REPLIES 8
Read only

Former Member
0 Likes
939

Hi,

You can use this method cl_abap_tstmp=>subtractsec to subtract the desired minutes. Convert the minutes into seconds and then pass it to the method

CALL METHOD cl_abap_tstmp=>subtractsecs

EXPORTING

tstmp = l_curr_timestamp

secs = l_secs

RECEIVING

r_tstmp =

Regards,

Vinodh.

Read only

Former Member
0 Likes
939

Try using the FM CONVERT_TIME_TERMS. Kindly let me know the result.

Reward if this is the Solution.

Regards,

abhay

Read only

Former Member
0 Likes
939

Try this also:-

'GET_DELTA_TIME_FROM_DT'

And do let me know that is it working or no.

Rewarsd point if helpful...

ABhay.

Read only

Former Member
0 Likes
939
PARAMETERS: p1 TYPE sy-uzeit.
DATA min_45 TYPE i.
min_45 = 45 * 60. " Transform it from minut to second
WRITE: p1.
p1 = p1 - min_45.
WRITE: p1.
Read only

Former Member
0 Likes
939

data: c1 type sy-timlo.

data: c2 type sy-timlo.

c1 = sy-timlo.

c2 = c1 - 1800.

write: c1.

WRITE /.

write: c2.

reward points if helpful

Read only

Former Member
0 Likes
939

Hi,

Try this program

PARAMETERS: p1 TYPE sy-uzeit.

DATA min_45 TYPE i.

min_45 = 45 * 60. " Transform it from minut to second

WRITE: p1.

p1 = p1 - min_45.

WRITE: p1.

Read only

Former Member
0 Likes
939

hi,

1. Difference is always returned in SECONDS.

2. use this code

data : t1 type sy-uzeit.
data : t2 type sy-uzeit.
DATA : DIFF TYPE I.

t1 = '090000'.
t2 = '100000'.


DIFF = T2 - T1.
WRITE :/ DIFF.

u can manipulate the DIFF.

Regards

REshma

Read only

Former Member
0 Likes
939

Hi,

if your problem is solved, please assign points and close the thread.

Regards,

Vinodh.