This website is not affiliated with, sponsored by, or approved by SAP AG.

I NEED A FUNCTION TO CALCULATE ELAPSED HOURS

Development (ABAP Development WorkBench, ABAP/4 programming)

Moderators: Snowy, thx4allthefish, YuriT, Gothmog

I NEED A FUNCTION TO CALCULATE ELAPSED HOURS

Postby aascan » Tue Oct 22, 2002 3:20 pm

Hi friends! :!:

I need a function that helps me to calculate how many hours has been elapsed between two hours fields. Since my english is no good, i'll try to explain me better:

I have a hour "A" (10:30 am) and hour "B" (12:00 m) i need a function to include on my program that calculates the number of hours elapsed between the hour "B" and hour "A". In this example the function must return 1:30 hours elapsed

If somebody coulds help me, i'll be very gratefull.

Thanks
Aascan
aascan
 

Postby harrym » Tue Oct 22, 2002 3:37 pm

I don't think you need a function module. You can do calculations on those fields and get the result as you desired. Make sure the calculated field is of type t. Write using edit mask '__:__'. Hope this helps
harrym
 
Posts: 1
Joined: Tue Oct 22, 2002 1:40 pm

CALL FUNCTION 'SWI_DURATION_DETERMINE'

Postby ysaita1 » Tue Oct 22, 2002 6:52 pm

use
CALL FUNCTION 'SWI_DURATION_DETERMINE'
EXPORTING
START_DATE = W_STR_DATE
END_DATE = W_END_DATE
START_TIME = W_STR_TIME
END_TIME = W_END_TIME
IMPORTING
DURATION = W_DURATION.
*
good luck!
ysaita1
 

Postby Guest » Wed Oct 23, 2002 4:08 am

There is also fm 'COPF_DETERMINE_DURATION'.
It calculates the interval according to a specific calendar id.

Ciao, Giulio
Guest
 


Return to ABAP

Who is online

Users browsing this forum: Majestic-12 [Bot] and 9 guests





This website is not affiliated with, sponsored by, or approved by SAP AG.