on 04-27-2007 8:10 AM
If I am calling a web service that returns a Java style date as a numeric value, such as 1177651563767 (milliseconds since 1 Jan 1970), how can I display this as a human readable date (hh:mm:ss dd-mm-yyyy? I have looked at the <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/40/a228173435437394f54c56de571ca4/frameset.htm">SAP help pages on date functions</a> and the
<a href="https://wiki.sdn.sap.com/wiki/display/VC/DateandTime+Formats">wiki page on date and time formats</a>, but neither seems to help.
My Java date is a numeric.
Thanks
Hi Michael,
I think a simple solution is not available and all the functions about time, date or other country specific units make problems.
I think you can try to use a complex VC formula which compute years, days, hours, minutes, seconds and so on then compute your date.
Another option I see is that you can write an ABAP RFC for converting the date.
Another question back to you, isn't it possible that your webserivce returns you a date readable for humans?
Best Regards,
Marcel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Michael,
you can call the webservice with another webservice or an RFC and then use Java or ABAP to convert the value into the right format. My opinion is as you mentioned that there is no way with VC. Maybe you can use a time function (DADD as it is described <a href="http://help.sap.com/saphelp_nw04s/helpdata/en/40/a228173435437394f54c56de571ca4/frameset.htm">here</a> and sum up to 01/01/1970 your [value in seconds]/60 this should work, but I never tested it.
Maybe this works, but this isn't a good solution anyway.
Best Regards,
Marcel
Thanks Marcel. I thought I would start trying to calculate some dates, but when I make a virtual field in my output table with type numeric and a default value of @TimeStamp / (3600 * 24 * 10000), I get a blank result. In fact, I get a blank result for any virtual fields! Even a simple string with a default value of "ABC" displays as spaces.
Any ideas?
Hi Marcel
I've described the model <a href="https://wiki.sdn.sap.com/wiki/display/VC/AportalactivityreportusingVisualComposer">here</a>, but basically I took the long date, worked out the number of days by dividing by 24 3600 1000 and added that to 01-01-1970 with DADD.
The hours are the remainder after taking away the days * 2436001000 and then divided by 3600*1000.
My wiki page is a bit more complicated as I wanted to allow for a timzone offset. I couldn't get this from the user info, but I do display the user's timezone name as a hint.
Cheers
Thanks! I have a little problem - I can't get a default value appearing in my input fields in the seelction screen. I set a default value, but it appears blank. The same with my radio button group - I want to set a default, such as "Day", but it doesn't appear. When I generate Webdynpro it seems to work, but not Flash.
Any ideas?
Cheers
I'll have to look at that. I have one form that is my starting form that then sends its data to another form. It is this second form that is missing the default values. My main form is only there so I can call my first web service. Is there someway to get this executed without the need for a Submit button?
Cheers
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.