Application Development 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: 

Time Substraction

Former Member
0 Kudos

Hi all,

I want to substract user entered( in selection screen) minutes from sy-uzeit, so that i can use the result for further calculations.

Can any body help me which function module i can use?.

Thanks,

Arun

4 REPLIES 4

Former Member
0 Kudos

HI,

First make the user entered time to local formate like sy-uzeit, then directly subtract it from sy-uzeit. For dates also we can follow the same way.

Rgds,

Bujji

Former Member
0 Kudos

Hi

Use RSSM_SUBSTRACT_TIMESTAMPS or RSSM_SUBST_SECS_FROM_TIMESTMP or OII_CALC_DIFF_BT_TIMESTAMPS

former_member181962
Active Contributor
0 Kudos

you can directly subtract two time fields

data: v_seconds type i.

v_seconds = p_time - sy-uzeit.

write:/ v_seconds,

'Seconds'.

Regards,

Ravi

Former Member
0 Kudos

Hi,

You can do the same as follows :

data : v_uzeit like sy-uzeit

v_uzeit1 like sy-uzeit.

this v_uzeit1 is time entered by user. Convert this time into seconds by multiplying the same by 60.

v_uzeit = sy-uzeit.

v_uzeit = v_uzeit - v_uzeit1.

This should give you the required results.

Hope this helps!!!

regards,

Lalit Kabra