cancel
Showing results for 
Search instead for 
Did you mean: 

Proxy data type XSDDATETIME_Z from XSD datetime

Former Member
0 Kudos

Hello all, I do not know about ABAP so I am coming here for some insight.

I have created a Proxy using a WSDL for the end point. The WSDL uses a datetime datatype.

This datatype is converted to a XSDDATETIME_Z in the proxy which is a DEC 15 type.

My ABAP resource says that is not a valid format for him to use for a date time. He wants me to make a custom copy of the WSDL and change to a STRING then use a mapping to get the Proxy data into the inbound message format.

I am not in agreement as I believe the format would not exist in ABAP if it wasn't useful. He says there is no conversion routine for this data type.

Can you help me educate him on how to populate this field with ABAP code? Or is he correct that I should setup a different format for the proxy?

Thank you kindly,

Tadd Bryan

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

XSDDATETIME_Z is a valid data dictionary item in the format XSD Date/Time (UTC): yyyy-mm-ddThh:mm:ssZ [ext.] in the later SAP versions. If you are using an old 4.6c version or something then the data type does not exist.

Your abapper could also create a custom version of the data type in any system then use this in his code.

Former Member
0 Kudos

We are using ECC 6.0. I am not sure I understand... are you saying there is no technical limitation to populating a XSDDATETIME_Z field type? He says he doesn't know how to get the date and time information into the DEC 15 format. Can you provide an example ABAP line of code that sets a XSDDATETIME_Z variable to a value? Thank you so much!

Former Member
0 Kudos

data : a(30) type c,

     b(30) type c.

a = '2010-07-16T07:30:00+03:00'

concatenate a0(4) a5(2) a8(2) a11(2) a14(2) a17(2) into b.

Target value will be in variable b.

Former Member
0 Kudos

Thanks all for the response... this thread saved me at the right time.

SAP Variable should be assigned the value like this for the above mentioned timestamp...

20100716043000 If SAP had to respond back with a value in the corresponding field.

Just FYI...

Clemenss
Active Contributor

Note that timestamps are defined as UTC. We use a method to convert (local) date and time to a timestamp put into XSDDATETIME_Z (DEC15, like timestamp) field:

My class:

{code}

class ZCL_BC_TOOLS definition
   public
   create public .

*"* public components of class ZCL_BC_TOOLS
*"* do not include other source files here!!!
public section.

   class-methods CLASS_CONSTRUCTOR .
   class-methods GET_LOCAL_TIMESTAMP
     importing
       !IV_DATE type SY-DATUM
       !IV_TIME type SY-UZEIT optional
     preferred parameter IV_DATE
     returning
       value(RV_TIMESTAMP) type XSDDATETIME_Z .
   class-methods GET_LOCAL_TIMESTAMP_EOD
     importing
       !IV_DATE type SY-DATUM
     preferred parameter IV_DATE
     returning
       value(RV_TIMESTAMP) type XSDDATETIME_Z .


*"* private components of class ZCL_BC_TOOLS
*"* do not include other source files here!!!
private section.

   class-data MV_TIME_END_OF_DAY type SY-UZEIT .
   class-data MV_TIME_ZONE_LOCAL type SY-ZONLO .
   class-data MC_TIME_INITIAL type SY-UZEIT value 0. "#EC NOTEXT .


METHOD class_constructor.
   mv_time_zone_local = sy-zonlo.
   SUBTRACT 1 FROM mv_time_end_of_day." '000000' -> '235959'
ENDMETHOD.


METHOD get_local_timestamp.
   CONVERT:
     DATE iv_date
     TIME iv_time
     INTO TIME STAMP rv_timestamp
     TIME ZONE mv_time_zone_local.
ENDMETHOD.


METHOD get_local_timestamp_eod.
   rv_timestamp =
     zcl_bc_tools=>get_local_timestamp(
       iv_date      = iv_date
       iv_time      = mv_time_end_of_day ).
ENDMETHOD.

{code}

Regards

Clemens

Answers (3)

Answers (3)

dellagustin
Advisor
Advisor

Hello,

I know this is answered already, but an alternative (if you want to reuse) is a simple transformation (look help for CALL TRANSFORMATION') using one of the domains fore dateTime mentioned here: ABAP Keyword Documentation

javier_alonso
Participant
0 Kudos

I always have this documentation cheatsheet saved in my OneNote. I haven't found a website source, so I've attached the images of the ABAP Help documentation when using the SPROXY.

LeonvNiekerk
Explorer
0 Kudos

Try class CL_GDT_CONVERSION