12-30-2008 10:57 AM
Hi Friends ,
I want to convert the time value from MINUTE to HH : MM : SS
I mean in input i have to pass 200 Minutes and in Output i want to get the no of hr and minutes in the format 03 : 20 ( HH:MM) . I have used the FM "CONVERSION_EXIT_SDURA_OUTPUT" for this .
This works fine for time input values upto 5 digits like ( 20000 minutes) = 333:20 (HH:MM) ,
when the input value is more than 5 digits , ex - 200000 this FM does not work .
Is there any FM where i can get the conversion from MINUTE to HH :MM:SS or from Minutes to DAYS :HPURS:MINUTES .
I have searched SDN , but i dint get the exact FM which i want ,
If any body has any idea on the same please guide me on the same .
Regards
Parbhudutta
12-30-2008 11:16 AM
hi
just try this fm MONI_TIME_CONVERT.
alternately what you can do is that you just convert the seconds to a type p variable and then assign it to a variable like sy-uzeit.
hope it helps
regards
Aakash Banga
12-30-2008 11:03 AM
01-12-2009 7:17 AM
Thanks.
The FM OIJ_LT_CONVERT_TIME really helps to get theseconds in DAYSHOURS .
Regards
Prabhudutta
01-14-2009 6:50 AM
12-30-2008 11:11 AM
12-30-2008 11:16 AM
Hi,
Not sure of the FM. But i think you can use the following logic:
Parameters P_var(10) type c.
data: v_val type string.
data: v_val1 type string.
data: v_val2 type string.
v_val = p_var div 60.
v_val1 = p_var mod 60.
concatenate v_val ':' v_val1 into v_val2.
write:/ v_val2.
hope this is helpful.
Regards,
Kalyan.
12-30-2008 11:16 AM
hi
just try this fm MONI_TIME_CONVERT.
alternately what you can do is that you just convert the seconds to a type p variable and then assign it to a variable like sy-uzeit.
hope it helps
regards
Aakash Banga
12-30-2008 11:26 AM
Thanks all for all of your valuable inputs .
IBy using FM : MONI_TIME_CONVERT , i am able to get HH:MM:SS format data by giving input as seconds .
But the issues i have is , i have data as input in seconds which is noear to a 10 digit number like
200000000 seconds , which does not work for this FM .
I have input data in MINUTES which is near to 10 digit , exmp - 239879798 minutes . So i want to convert this no to ( DAYS : HOURS : MINUTES : SECONDS )
Other FMs that has been given by you guys i have checked but i am not able to get exactly what i want .
Anyway thanks again .
Reagards
Prabhudutta
07-22-2019 2:19 PM
12-30-2008 11:17 AM
hi Parbhudutta
better create Z function module :ZCONVERSION_EXIT_SDURA_OUTPUT
and write condition like this
If hours LT 20000.
write hours to output(3) no-sign.
output+3(1) = ':'.
write minutes_n to output+4(2).
endif .
if hours GT 20000.
write hours to output(4) no-sign.
output+4(1) = ':'.
write minutes_n to output+5(2).
endif .
i hope this will work .
with regards
kota narasimha rao
12-30-2008 11:21 AM
Hi,
Hope below FM helpful to you.
CIF_GEN3_CONVERT_DATETIME
CIF_GEN3_CONVERT_TIMESTAMP
CIF_GEN_CONVERT_DATETIME
CIF_GEN_CONVERT_TIMESTAMP
CONVERT_TIME_TERMS
FCOM_EQM_CONVERT_TIME_FRAME
FRE_CONVERT_DATE_2_TIMESTAMP
FRE_CONVERT_TIMESTAMP_2_DATE
Regards
Durga
12-30-2008 11:39 AM
You can do it in simple way
Hours = Minutes /60
Minute = Minutes mod 60
output is Hours : Munute
Regards
Sasi
12-30-2008 12:37 PM
u can try as below also.
function MinutesToDaysHoursMinutes(AMinutes: Integer): string;
const
HOURSPERDAY = 8; // wieviele Stunden hat der Tag? (Beispiel hier: 1 Arbeitstag)
var
Days: Integer;
Hours: Integer;
Minutes: Integer;
begin
if (AMinutes > 0) then
begin
Hours := AMinutes div 60;
Minutes := AMinutes mod 60;
Days := Hours div HOURSPERDAY;
Hours := Hours mod HOURSPERDAY;
end
else
begin
Hours := 0;
Minutes := 0;
Days := 0;
end;
Result := Format('%.2d:%.2d:%.2d', [Days, Hours, Minutes]);
end;