06-24-2015 7:59 AM
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
06-24-2015 8:43 AM
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
06-24-2015 8:11 AM
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.
06-24-2015 8:15 AM
06-24-2015 8:21 AM
Cool then, Select the column and Click the Green color sum Icon and let me know if that is what you are looking for?
06-24-2015 8:25 AM
06-24-2015 8:41 AM
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.
06-24-2015 8:43 AM
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
06-26-2015 8:32 AM