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: 

ALV Summarize TIMS field

Former Member
0 Kudos

Hi all

I have an ALV grid that shows time field from the data element TIMS(Char6 datatype).

Now it is not possible to summarize time in ALV with.

My question is, is there a way to summarize data element TIMS, like for example in this scenario, it should show in the first yellow row the time about 00:06:34 and etc.

Thanks for helping

1 ACCEPTED SOLUTION

raymond_giuseppi
Active Contributor
0 Kudos

You cannot sum "time" fields only "duration" fields, so some numerical type.

Hint: You could look for/create some data-element/domain, internally a NUMC type  in  seconds, with a conversion-exit to display/read it in a "time" format. You could look at FM CONVERT_TIME_INPUT to create your own ZDURATION.conversion exit) - You could also add a "days" part in the format to prevent overflows.

Alternative: Or you could play with EVENT after_refresh as in my answer to Total % on Drill down report.

Regards,

Raymond

7 REPLIES 7

Venkat_Sesha
Advisor
Advisor
0 Kudos

Hi Marty,

Yes it is possible if you are using a CL_GUI_ALV_GRID.

You have standard options in the ALV tool bar until and unless you excluded them manually using static Attributes of the class.

0 Kudos

I am using CL_GUI_ALV_GRID and standard options is active.

0 Kudos

Cool then, Select the column and Click the Green color sum Icon and let me know if that is what you are looking for?

0 Kudos

After I pressed the green button I've got the msg

0 Kudos

Hi Marty,

Looks like your Data element is CHAR.

For CHAR types it doesn't work the same way. You need to do it programmatically or use different Data element for the Time. For example NUMC.

Programmatically it is possible with Putting a button on the ALV Tool Bar using HANDLE_USER_COMMAND Event.

raymond_giuseppi
Active Contributor
0 Kudos

You cannot sum "time" fields only "duration" fields, so some numerical type.

Hint: You could look for/create some data-element/domain, internally a NUMC type  in  seconds, with a conversion-exit to display/read it in a "time" format. You could look at FM CONVERT_TIME_INPUT to create your own ZDURATION.conversion exit) - You could also add a "days" part in the format to prevent overflows.

Alternative: Or you could play with EVENT after_refresh as in my answer to Total % on Drill down report.

Regards,

Raymond

0 Kudos

It works. Thanks so much.