on 06-21-2012 11:28 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try class CL_GDT_CONVERSION
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.