cancel
Showing results for 
Search instead for 
Did you mean: 

Date and time parameter in web service.

LeonardoAraujo
Active Contributor
0 Kudos

Guys, I have a proxy class to consume a webservice written in .net.

This webservice has a method GET_DATE and it returns me a parameter GET_DATE_RESULT that is a string. The result is "2007-12-06T09:47:46.8942117-04:00"

He says he is passing the .net format as below:

"What you are receiving is the string equivalent to the universal time format (UTC) (ISO 8601 I believe).

You get the full server time plus it’s time zone offset."

That is very good that I receive date, time and timezone, but in SAP I need this information either in separate fields or in a timestamp.

What is the best practice on defining this interface? Which format should we use?

Is there a FM that I can call in SAP to convert it? I really don't want to parse it...

Thanks

Leonardo De Araujo

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Are you using SAP Java stack as a web service consumer? If YES Java do have standard API to deal with differrent Date format, please use it

If your web service is consumption is going through an EAI ESB frame work such as XI or PI use the transformation/ transaltion features to covert the data between service consumer and provider.

If you are using just ABAP use it's own DATE API ( I am not sure what it is,)

Thanks

Former Member
0 Kudos

on newer systems it is the language construct <b>CONVERT TIME STAMP</b>, on older systems it's the utilities of function group <b>TZN0</b>, especially function module <b>TZ_GLOBAL_TO_LOCAL</b>.

regards, anton

BTW: the search string in SDN search was 'convert ABAP UTC' and a little F1 in a SAP system revealed all secrets.

null

LeonardoAraujo
Active Contributor
0 Kudos

I am consuming in ABAP a webservice from a .Net application. The result is '2007-12-06T09:47:46.8942117-04:00'

So it is not a timestamp. It is more like a concatenation of date, time and timestamp.

What I need is a way to convert it to either date/time or timestamp.

The abap statement or function modules deal with timestamps and that is not what I have.

Please advise.

Thanks for far.

Leonardo De Araujo

Message was edited by:

Leonardo De Araujo

LeonardoAraujo
Active Contributor
0 Kudos

.

Message was edited by:

Leonardo De Araujo

Former Member
0 Kudos

That is a string representation of a date created based on a free-defined date format. They choose to use String as type to carry this data cuz string can carry anything which can be streamed across the wire.

Since you obeyed the service contract where mentioned date is represented with a string of size X, as a consumer you should able to interpret the date in string format and convert into any other format suitable for your application.

I don't think anything wrong with this date, you should have some code inside your program to consume the string and return it to a suitable format suitable for ur DATE function.

Web service is not a solution for a localized problem, it is a solution to access a remote service based on a pre-defined contract. Since you agreed with the contract by using the WSDL, you have to find the solution for the localized problem with the string representation of the date format.

As a service provider they have defined the date with such a format to satisfy every consumers from different region of the world. For example US and Europe has different date format, Some companies enforce detailed date format etc.

Thanks

LeonardoAraujo
Active Contributor
0 Kudos

Let me clarify something: We are building a webservice to be consumed by an interface system. Only these 2 systems will use it and since we are in design phase, we can either change the SAP or the .NET side. Now, the question is: what is the recommended way to send a timestamp like that? Is there an internationally recongnized way to send and receive data and time?

Thanks so far.

Leonardo

Answers (0)