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

Average time in ALV

Former Member
0 Likes
857

Hi All,

I am coding my report in the ALV Grid display using the Reuse_alv_grid_display.

The some columns of the report are supposed to be

DATE1 TIME1 DATE2 TIME2 TIME DIFF

time diff is calucated as

TIME DIFF = DATE2 - DATE1 (IN HRS) + TIME2 - TIME1 ( IN HRS)

and Average time = time diff / no.of rows displayed.= _____ days _______hrs

now my questions are

1. Is there a func module that can do the time diff and get me in hrs mins ans sec

2. In ALV how to get the average time ( in field catalog which option to be used)

3. The func module to convert the Time into days and hrs.

If anyone ever encountered such problems and have solution pl do reply.

helpful answers will be rewarded.

Remember these are not quantity fields ...........

Thanx & Regards,

Mahadev.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
689

Hi

These are the list of FM which is related to Date & Time Calculation

Hope this solve ur future problems also.

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

Mark if helpful

Regards

Tushar Mundlik

3 REPLIES 3
Read only

Former Member
0 Likes
690

Hi

These are the list of FM which is related to Date & Time Calculation

Hope this solve ur future problems also.

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

Mark if helpful

Regards

Tushar Mundlik

Read only

ferry_lianto
Active Contributor
0 Likes
689

Hi,

Please try this FM SD_DATETIME_DIFFERENCE.

Regards,

Ferry Lianto

Read only

0 Likes
689

HI Lianto,

The func module did solve part of the query, with little customization

still ALV part is mystery.

Thanx for the func module

Mahadev