‎2011 Nov 24 5:28 AM
Dear Experts,
I am working on duration field (difference between two time fields). I could get the values in a field successfully as HH.MM.
(Field Type used is DEC 10.2)
Now I need the total of this column not as decimal system, but as time system.
How can I ahieve this?
I have been working and searching for solution since quite sum time.
Can some one help.
Regards
Jogeswara Rao
‎2011 Nov 24 5:50 AM
Considering
I have been working and searching for solution since quite sum time.
I would like to help you
Declaring the type as tims (timestamp) will solve it as in function C14B_ADD_TIME.
Kesav
‎2011 Nov 24 6:02 AM
Thank you Keshav for the valuable clue.
I'll work on it.
kind regards
Jogeswara Rao
‎2011 Nov 24 6:15 AM
Hi Jogeswara Rao,
Please check the below code, it may work...
DATA:
lv_time TYPE dec10_2 VALUE '23.23',
lv_time_c TYPE char9,
gv_time TYPE tims.
lv_time_c = lv_time.
SHIFT lv_time_c LEFT DELETING LEADING space.
CONCATENATE lv_time_c '.00' INTO lv_time_c.
REPLACE ALL OCCURRENCES OF '.' IN lv_time_c WITH ''.
gv_time = lv_time_c.
WRITE:
gv_time.Regards,
Surya
‎2011 Nov 24 6:39 AM
Hi Rao,
please use data type as tims. it will solve your problem.
Thanks
‎2011 Nov 24 7:21 AM
Thanks everyone.
But type TIMS can not be added. Sum is disabled for this column.
This is my requirement. i.e. To have total of this column in Hr and Min not as decimals
Regards
Jogeswara Rao
‎2011 Nov 24 7:56 AM
Hi,
Now i understood your question. Here is your solution by creating a custom conversion exit.
[Sum of times (HHMMSS) in ALV Grid !!!|http://sap.ittoolbox.com/groups/technical-functional/sap-abap/help-sum-of-times-hhmmss-in-alv-grid-3347395]
‎2011 Nov 24 8:34 AM
Thanks Keshav,
That is the only resource available in the net on this topic. I'd spent enough time on that by creating identical Function, only to find the sum is not in Hr.Mt. It is calculating Decimal wise only (Because the type is DEC 10_2). I doubt, the author did not confirm this before posting that thread in ITTOOLBOX.
Regards
Jogeswara Rao