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

calculate duration

Former Member
0 Likes
1,290

how many function modules are there to calculate duration between two days or

is there any simple logic to calculate between two days

how many function modules are there to calculate duration between two days or

is there any simple logic to calculate between two days

5 REPLIES 5
Read only

Former Member
0 Likes
853

use the FM <b>TSTR_CALC_DURATION</b> to calculate the duration between two dates or else use FM <b>DURATION_DETERMINE</b>

Read only

Former Member
0 Likes
853

Hi,

FIMA_DAYS_AND_MONTHS_AND_YEARS

FI_PSO_DAYS_MONTHS_YEARS_GET

RSSM_CONVERT_DAYSEC2TIMESTAMP

RSSM_CONVERT_TIMESTAMP2DAYSEC

Function Modules related to Date and Time Calculations

DATE_COMPUTE_DAY : Returns weekday for a date

DATE_GET_WEEK : Returns week for a date

DAY_ATTRIBUTES_GET : Returns attributes for a range of dates specified

MONTHS_BETWEEN_TWO_DATES : To get the number of months between the two dates.

END_OF_MONTH_DETERMINE_2 : Determines the End of a Month.

HR_HK_DIFF_BT_2_DATES : Find the difference between two dates in years, months and days.

FIMA_DAYS_AND_MONTHS_AND_YEARS : Find the difference between two dates in years, months and days.

MONTH_NAMES_GET : Get the names of the month

WEEK_GET_FIRST_DAY : Get the first day of the week

HRGPBS_HESA_DATE_FORMAT : Format the date in dd/mm/yyyy format

SD_CALC_DURATION_FROM_DATETIME : Find the difference between two date/time and report the difference in hours

L_MC_TIME_DIFFERENCE : Find the time difference between two date/time

HR_99S_INTERVAL_BETWEEN_DATES : Difference between two dates in days, weeks, months

LAST_DAY_OF_MONTHS : Returns the last day of the month

<b>Reward points</b>

Regards

Read only

0 Likes
853

hi professional, i used a simple logic to calculate diff b/n two dates its not working guide where i did mistake.

data: st-date type syucomm,

endate type sy-ucomm,

duration type i.

duration = endate - st-date .its not working even then i replaced duration to sy-ucomm run time exception date conversion error & one more thing is i must not use any fm for this so guide me with suitable codde friend anu

Read only

0 Likes
853

Hi Anu,

Use the following and try.

parameters: w_day1 like sy-datum,

w_day2 like sy-datum.

data: w_diff_days type i.

w_diff_days = w_day1 - w_day2.

write w_diff_days.

Hope this is helpful.

Please reward if useful.

Thanks,

Srinivasa

Read only

Former Member
0 Likes
853

Hi Anu,

Guess this FM will resolve your issue..

DAYS_BETWEEN_TWO_DATES

Regards,

Sandeep