Decimal format time value to convert into time (hr:min:sec)value in a graph
I need to develop a graph in WAD, in BW7. In the graph the value must be showed as HR:MIN:SEC, which I cannot get it right.
The keyfigure value carries the duration(hr:min:sec) in decimal format. In the query, I use this keyfigure for calculation. To get the time broadcasted for a week range. I get the total duration (say 507835.000). Now I need to convert this value back to hr:min:sec. I use the below formulas to get the hr, min, sec.
D = 507835
Val1 = D/3600
Val2 = Frac(val1)
Val3 = Val2 * 60
Val4 = frac(Val3) * 60
Hr = Val1 Val2
Min = Val3 frac(Val3)
Sec = Val4
In another formula in the query I add Hr + Min/100 + Sec/10000 to get hr.minsec format.
When I do an average on count of weeks, this doesnt round off correctly.
I tried to also use the Data function TIME() which when the time is > 24 hrs changes the value.
Lets say if it is 39:00:00, it shows value as 15:00:00 instead of keeping the value 39:00:00.
When I used this value in the graph it did not show the HR:MIN:SEC values in the value axis instead it showed 0.0, 0.1,
.1.0. Bcoz of this the graph is blank.
Can anybody help me to resolve this problem.
Thanks alot
Anima
I checked SU01 and didn't see anything there to customize...
In my workstation, control panel / regional and languages settings / tab regional Options / customize; my time format is HH:mm:ss; the HH has to be in capital letter to display the time in 24 hour...
but this is strange anyway... are you reporting with web frontend or excel?
Similar Messages
-
Format Sound.position and .duration into time
Hi,
How would i go about formatting Sound.position from
milliseconds into proper time like 1:30 for 90 seconds?i have figured it out if anyone else wants to know...
where timeString is the Sound.position in
milliseconds! -
Decimal value automatically converting into int
Hi,
I have a SQL column which is a string and its value is casted to have decimal value. For example 92.57
In C#, below is the code I have written to retreive the value.
command.Parameters.Add("@ProcessCompliance", SqlDbType.Decimal).Direction = ParameterDirection.Output;
ProcessComplaincecount = command.Parameters["@ProcessCompliance"].Value.ToString());
But value is getting converted as 93 as a int. I want it as 92.57
Regards, Shreyas R SFor best results, you should post this question in the SQL development or C# forums. (This is a SharePoint forum.)
Mike Smith TechTrainingNotes.blogspot.com
Books:
SharePoint 2007 2010 Customization for the Site Owner,
SharePoint 2010 Security for the Site Owner -
To convert value in seconds or decimal value to hr:min:sec
Hi There,
I got 2 keyfigures which have the same data in decimal and seconds format like 1492.000 or 1492. In the <b>query</b> I want to convert this to HR:MIN:SEC format.
Can anybody help me to convert to hr:min:sec format. what is the formula that can convert this?
Thanks alot
AnimaI checked SU01 and didn't see anything there to customize...
In my workstation, control panel / regional and languages settings / tab regional Options / customize; my time format is HH:mm:ss; the HH has to be in capital letter to display the time in 24 hour...
but this is strange anyway... are you reporting with web frontend or excel? -
Output of RFC needs to be converted into PDF format
Hi Experts,
In the ESS screen, we have to provide one link for every employee. When the user will click on the link, one letter in PDF format should be displayed to the user. This PDF will act as a "Address Certificate". The address certificate will contain information related with name, address, passport details etc. How we can achieve this?
In my view, we will have to create one Z-RFC. The ABAPer will create the Z-RFC. Now the input for the Z RFC will be employee no. The output will be Name, Address and Passport details.
The information provided in table format needs to be converted into PDF form. How we can do so? What all services needs to be activated for this?
Regards,
GaryHi Gary,
When you say the ESS screen, what do you mean by this is it ECC side or in Portal Side.
It its in Portal side then, I think you need to create a WebDynpro application which display output through ADOBE forms. For that you need to have basic WebDynpro knowledge.
Apart from that ADS needs to be configured. There are sevrel tutorial available in SDN. For creating a WebDynpro Application with Adobe Interactive forms.
Do let me know if you require more information.
Regards, -
Change decimal format to time format ie 1.5 to 1:30
Hi I need to create a field such that when you enter a value in decimal format it gets converted to time format.
Eg change 1.5 to 1.3 ..... Can any one help cheers.... any light on how to do this would be much appreciated.create table num_to_time (seq number, val number, dtvl date);
insert into num_to_time
select 1 seq, 1.5 val, null dtvl from dual
union all
select 2, 2.25, null from dual;
commit;
create or replace procedure p_numtotime is
v_seq num_to_time.seq%type;
v_val num_to_time.val%type;
v_date num_to_time.dtvl%type;
cursor c1 is select * from num_to_time;
begin
open c1;
loop
fetch c1 into v_seq,v_val,v_date;
exit when c1%notfound;
update num_to_time set
dtvl = to_date(to_char(trunc(sysdate)) ||
' 0'||trunc(v_val)||':'||to_char(mod(v_val,trunc(v_val))*60)||':00',
'dd/mm/yyyy hh24:mi:ss')
where seq = v_seq;
end loop;
commit;
close c1;
end;
exec p_numtotime;
drop table num_to_time;
drop procedure p_numtotime; -
I am having a hard time finding a function that will help me convert an 8 bit serial data string I have received (say 01110101) into decimal format.
When you have your front panel displayed, you should a whole palette of controls that you can place on the front panel. If the palette is not displayed, thne just right click on your mouse and it should appear. The upper left most set of controls on the palette is Numeric. Go there and select Numeric Indicator to display a numeric output. On the diagram, you can also right click the output 1 and select Create>Indicator. The format string is %b (as in boy) for a binary string. As I said, this should be the value for the format string input. You can right click on the Scan From String and select Edit Scan String. This will bring up a dialog box in which you pick what you want to do (Scan Number) and how you want to do it (Scan Binary Integer
It sounds like you really need to take a course in LabVIEW programming. There are are links here to NI classes and some on-line tutorials. -
Display value in hh:mm time format in SSRS Report
Hi Everybody,
I have an SSRS report where one of the column is sum of time values. When I do the summation, the values are coming in this format. In the last column the minute value is getting displayed more than 60. How can I format it to proper time format as hh:mm
so that it displays as "08:15" . The expression which I am using is " Sum(CDec(FormatNumber(Fields!Overtime_Hours.Value,2)),"Month"). Your help would be highly appreciated.
January
31/1/2014
21/04/2014
00:00
07:75
00:00
07:75
Thanks & Regards,
RPC
Regards RCPHi RPC24,
According to your description, you can calculate the correct value of time summation. Now you want to make the result into proper time format (hh:mm). Right?
In this scenario, we can convert the time into string type, split the string based on delimiter ":" and convert each part into integer. Then do the calculation for each part and set the hour increase 1 every 60 minutes (we can adjust in expression).
We have tested this case in our local environment. Here are screenshots for you reference:
1. The report design looks like below:
A: =Format(TimeValue(Fields!StartTime.Value.ToString),"hh:mm")
B:=CStr(SUM(CInt(split(CStr(Format(TimeValue(Fields!StartTime.Value.ToString),"hh:mm")),":")(0)))+SUM(CInt(split(CStr(Format(TimeValue(Fields!StartTime.Value.ToString),"hh:mm")),":")(1)))\60)+":"+CStr(SUM(CInt(split(CStr(Format(TimeValue(Fields!StartTime.Value.ToString),"hh:mm")),":")(1)))
Mod 60)
Ps: In this sample, we used Time data type. You may need to do some modification in your expression based on the data type of the time data field.
2. The result looks like below:
Reference:
Summing the Value of HH: MM: SS In SSRS
If you have any question, please feel free to ask.
Best Regards,
Simon Hou -
Date time stamp to be converted into only date
Hi Experts,
when i am using substirng functoin for converting datetimestamp to date it is giving the following error
i am using RNIF pip to be converted into IDOC ORDERS 05
the time stamp value from pip should modified in that so that i can get only the date
by elemiting the time asscioated with it so i used substring functoin it is giving following error
/ORDERS05/IDOC/E1EDK02/DATUM. The message is: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 8] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@107c499] com.sap.aii.mappingtool.tf3.MessageMappingException: Runtime exception during processing target field mapping /ORDERS05/IDOC/E1EDK02/DATUM. The message is: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 8] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@107c499] at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:347) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Root Cause: com.sap.aii.utilxi.misc.api.BaseRuntimeException: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 8] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@107c499] at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:56) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:291) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Root Cause: java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at com.sap.aii.mappingtool.tf3.rt.FunctionWrapper.getValue(FunctionWrapper.java:47) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:291) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.processNode(AMappingProgram.java:309) at com.sap.aii.mappingtool.tf3.AMappingProgram.start(AMappingProgram.java:398) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java:141) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java:102) at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInternal(ServerMapService.java:431) at com.sap.aii.ibrep.server.mapping.ServerMapService.execute(ServerMapService.java:169) at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.execute(MapServiceBean.java:52) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.execute(MapServiceRemoteObjectImpl0.java:301) at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:146) at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320) at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198) at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129) at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33) at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41) at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37) at java.security.AccessController.doPrivileged(Native Method) at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100) at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170) Caused by: java.lang.StringIndexOutOfBoundsException: String index out of range: 8 at java.lang.String.substring(String.java:1441) at com.sap.aii.mappingtool.flib3.TextFunctions.substring(TextFunctions.java:33) ... 26 more RuntimeException in Message-Mapping transformation: Runtime exception during processing target field mapping /ORDERS05/IDOC/E1EDK02/DATUM. The message is: Exception:[java.lang.StringIndexOutOfBoundsException: String index out of range: 8] in class com.sap.aii.mappingtool.flib3.TextFunctions method substring[, com.sap.aii.mappingtool.tf3.rt.Context@107c499]
thanks
sunilHi,
Do as follows.
Use standard date transformation function.In that format of source date give as hh:mm:ss ddMMyyyy and format of targeet date as you wish..It wil solve.
Please award marks if found useful.
Thanks
Hamja -
Function module to convert to time stamp format
Hi friends,
can you tell me any function module to convert date and time to time stamp format?
kind regards.Just use
CONVERT DATE d
TIME t [DAYLIGHT SAVING TIME dst]
INTO TIME STAMP tst
TIME ZONE tz.
look at this example
DATA:
tstamp type timestamp,
d TYPE D VALUE '19971224',
t TYPE T VALUE '235500'.
SET COUNTRY 'US'.
CONVERT DATE d TIME t INTO
TIME STAMP tstamp TIME ZONE 'UTC+12'.
" tstamp : 19971224115500
" (12/24/1997 11:55:00)
CONVERT TIME STAMP tstamp TIME ZONE 'UTC+12' INTO
DATE d TIME t.
Also look at the blog..
/people/himanshu.gupta/blog/2006/11/14/abap4-date-time-and-timestamps
Raja T
Message was edited by:
Raja Thangamani -
Hi all
Does anyone know how to format time format to decimal number?
Eg: '10:21' in HH24:MI to 10.21
'21:09' to 21.09
Thanks in Advance
PrashSince you just want to replace the colon with a period in a string, just use the string replace function:
select replace('10:21',':','.') from dual;However if you convert this to a number, then as Boneist said it's not really comparable to the time portion of a date as 21 minutes is not 21/100 of an hour but is rather .35 hours (21/60). You won't be able to use this decimalized format as a meaningful number, nor will you be able to do any sort of date based arithmatic on it.
You may be better off converting your string to date, then into a number via some date math:
with sample_data as (select to_date('11:21','HH24:MI') dt from dual)
select dt, (dt - trunc(dt))*24 from sample_data;Edited by: Sentinel on Nov 10, 2008 9:40 AM -
Insert a value of type Date/Time into a database
I am trying to insert a value of type date time into an access database. What is the format needed to insert the date/time.
Thanks,
-AmosI had all kinds of problems getting a datetime inserted into a SQl Server DB. Probably similar so this is what I do:
String date = new String("01/01/97 12:00:00");
stmt.setObject(1, date);
I tried using TimeStamp's but found I got an occasional Fractional Truncation exception back from the driver. Never had a problem inserting a String using the setObject() method though.
Hope this helps -
Can I convert Facebook time Text to Project Siena's Date value ?
Can I convert Facebook time Text to Project Siena's Date value ?
I want to show create_time on screen by my Localtime formatted text.
Facebook time Text = 2014-07-14T11:22+0000
I want to show = 2014/07/14 18:22
My Time Zone is +09:00, Osaka/Japan.
Currently I try it by Text/Replace/Replace/Replace/Left/DateValue/+ , etc.
And I ask more simple way.
Regards,
Yoshihiro KawabataThank you Andy , and Robin, I can.
Text(TimeValue(Substitute(ThisItem!created_time,"+0000",".000Z")),"yyyy/mm/dd hh:mm")
At Facebook Albums's Gallary, I can convert from Facebook created_time to Localtime Text DateTime.
and I hope more easy way like Excel Power Query's one.
Regards,
Yoshihiro Kawabata -
Can I convert Twitter time Text to Project Siena's Date Value ?
Can I convert Twitter time Text to Project Siena's Date Value ?
I want to show localtime of Twitter created_at.
Twitter time text = ThisItem!created_at , ex: Tue Jul 15 17:19:00 +0000 2014
I want to show 2014/07/16 02:19 by Japan localtime.
Regards,
Yoshihiro KawabataSiena uses JavaScript to parse date/times, via the TimeValue function. A good specification regarding what is acceptable can be found here:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse
The example above is truly bizarre: I thought I had seen it all. You will need to turn that form into one of those listed on the above site, using string functions to chop it up and reassemble it into a saner form. -
Convert system time into User local time.
Hi,
How to convert System time into User Local time.
Are there any FMs available.
Regards,
Kiranhi,
There is just one simple funda behind the Date and time logic in SAP.
-> It is absolutely useless to store Date and time directly in DB. Why ?
Because 00:00 a.m in London could mean 05:30 in India !! So If I (in India) store a Date 1st Feb 2008 , 10:00 a.m .. This time for a person in London could be invalid.. because he is behind your time zone..
So the solution is to store the date/times in Timestamps format. Taking the above example.. 1st Feb 2008, 10:00 a.m (in India) will be stored as 20080201043000.
This time if seen in German Time zone will look as : 1st Feb 2008, 05:30 a.m.
Simple right
-> In India we store date as DD.MM.YYYY while in other countries they store it as MM.DD.YYYY.
The separator could be . or - or / .
The date format is user dependent. I might prefer to store it as DD.MM.YYYY and you might want to store it as MM-DD-YYYY.
System does not bother what your format is. It always stores in YYYYMMDD (8 Char)
On screens if you want to display Date then it must always be shown in that users format who is seeing it. How to get this done ?
DATA : lv_date(10) type c.
write sy-datum into lv_date.
So in LV_DATE variable the date will be stores in the users format.
Simple right
There are function modules that do the same. But normally we should avoid use of FM to make code simpler, short and easy... no complications at all ..
You can use system variables sy-datlo (Local Date for Current User) and sy-timlo ( Local Time of Current User ).
You can also use GET TIME statement.
reward if useful,
preet
Maybe you are looking for
-
FCP Projects Converted To .m2v In Compressor Are Not Accepted ?
Normally I export my FCP projects as QuickTime Movies and drop them into iDVD 08. I have just exported to Compressor and ended up with a .m2v and a .ac3 file which work in Toast and DVD Studio Pro but cannot be dropped into the iDVD window. They jump
-
How to choose between XSLT & JAVA Mapping.
-
I changed my apple ID & now the iMessage is not working neither with the old nor the new ID
I changed my apple ID & now the iMessage is not working neither with the old nor the new ID
-
Splitting string values in query
all, i cant remember this but my problem is like i have a collection of string values passed to my query like "X234234:X23466:X03287:X457675" , so my query should be able to split each data value and use in the filter as below, select * from emp wher
-
I just upgraded my ipad to 6.0. I can no longer expand my audio files so that I can move forwards and backwards. I used to get a diagonal arrow to enlarge the screen and then have a bar that I can move to navigate. Can you help?