<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Error on XML Deserialization with DATS Datatype in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-on-xml-deserialization-with-dats-datatype/m-p/312769#M4402</link>
    <description>&lt;P&gt;That does the trick. Thank you very much. That bothered me a lot longer than it should have.&lt;/P&gt;</description>
    <pubDate>Mon, 07 Nov 2016 13:22:03 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2016-11-07T13:22:03Z</dc:date>
    <item>
      <title>Error on XML Deserialization with DATS Datatype</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-on-xml-deserialization-with-dats-datatype/m-p/312765#M4398</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I'm using an XSLT Program to deserialize a XML-File. Inside the XSL I'm assigning the needed values to the fields of my structure. I have one field with the datatype DATS (length 8). Inside the XML File there is a tag which contains a date in the according format &lt;/P&gt;&lt;P&gt;YYYMMDD ( e.g. &amp;lt;DATE&amp;gt;20160522&amp;lt;/DATE&amp;gt;).&lt;/P&gt;&lt;P&gt;Whenever I try to assign the value of Date to the structure field with the DATS type I am getting the CX_XSLT_DESERIALIZATION_ERROR.&lt;/P&gt;&lt;P&gt;For troubleshooting I changed the type of the field to a char32 which is working just fine.&lt;/P&gt;&lt;P&gt;How can I cast the value correctly to the dats field?&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 14:58:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-on-xml-deserialization-with-dats-datatype/m-p/312765#M4398</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-02T14:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Error on XML Deserialization with DATS Datatype</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-on-xml-deserialization-with-dats-datatype/m-p/312766#M4399</link>
      <description>&lt;P&gt;Here are the accepted formats for "asXML" : &lt;A href="http://help.sap.com/abapdocu_702/en/?url=abenabap_xslt_asxml_schema.htm"&gt;http://help.sap.com/abapdocu_702/en/?url=abenabap_xslt_asxml_schema.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Excerpt:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XML Scheme Type  &lt;/STRONG&gt;&lt;STRONG&gt;XML Representation  &lt;/STRONG&gt;&lt;STRONG&gt;Domain  &lt;/STRONG&gt;&lt;STRONG&gt;ABAP Representation&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;xsd:date  2007-10-01  XSDDATE_D  "20071001"&lt;/P&gt;</description>
      <pubDate>Wed, 02 Nov 2016 16:20:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-on-xml-deserialization-with-dats-datatype/m-p/312766#M4399</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-11-02T16:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: Error on XML Deserialization with DATS Datatype</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-on-xml-deserialization-with-dats-datatype/m-p/312767#M4400</link>
      <description>&lt;P&gt;Thank you for your quick answer. I already saw the page for asXML types but that doesn't seem to help me much. Here is an example of how my code looks:&lt;/P&gt;&lt;P&gt;Input XML:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&amp;lt;INVOIC02&amp;gt;&lt;BR /&gt;&amp;lt;IDOC BEGIN="1"&amp;gt;&lt;BR /&gt;  ...&lt;BR /&gt;&amp;lt;E1EDK03 SEGMENT="1"&amp;gt;&lt;BR /&gt;  &amp;lt;IDDAT&amp;gt;012&amp;lt;/IDDAT&amp;gt;&lt;BR /&gt;  &amp;lt;DATUM&amp;gt;20160510&amp;lt;/DATUM&amp;gt;&lt;BR /&gt;&amp;lt;/E1EDK03&amp;gt;&lt;BR /&gt;...&lt;BR /&gt;&amp;lt;/IDOC&amp;gt;&lt;BR /&gt;&amp;lt;/INVOIC02&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;So besides other values, I need to get the value of the &amp;lt;DATUM&amp;gt; tag into a variable of the ABAP type DATS. Here's my XSL-Transformation for that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0"&amp;gt;&lt;BR /&gt;&amp;lt;xsl:strip-space elements="*"/&amp;gt;&lt;BR /&gt;
 &amp;lt;xsl:template match="/"&amp;gt;
   &amp;lt;asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0"&amp;gt;
     &amp;lt;asx:values&amp;gt;
       &amp;lt;IDOC_GET&amp;gt;
         &amp;lt;xsl:apply-templates select="//IDOC"/&amp;gt;
       &amp;lt;/IDOC_GET&amp;gt;
     &amp;lt;/asx:values&amp;gt;
   &amp;lt;/asx:abap&amp;gt;
 &amp;lt;/xsl:template&amp;gt;

 &amp;lt;xsl:template match="IDOC"&amp;gt;
   &amp;lt;xsl:for-each select="E1EDK03"&amp;gt;
     &amp;lt;xsl:if test="IDDAT = 012"&amp;gt;
       &amp;lt;xsd:element name="DATUM" type="xsd:date"&amp;gt;
         &amp;lt;DOCDT&amp;gt;
           &amp;lt;xsl:value-of select="DATUM"/&amp;gt;
         &amp;lt;/DOCDT&amp;gt;
       &amp;lt;/xsd:element&amp;gt;
     &amp;lt;/xsl:if&amp;gt;
   &amp;lt;/xsl:for-each&amp;gt;&lt;BR /&gt;     ...
 &amp;lt;/xsl:template&amp;gt;
 &amp;lt;/xsl:transform&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As already mentioned, I am able to retrieve the date, when the corresponding ABAP-datatype for DOCDT is a character of according lenght. But since the type I need in this case is DATS the selection throws the error.&lt;/P&gt;</description>
      <pubDate>Thu, 03 Nov 2016 09:00:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-on-xml-deserialization-with-dats-datatype/m-p/312767#M4400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-03T09:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error on XML Deserialization with DATS Datatype</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-on-xml-deserialization-with-dats-datatype/m-p/312768#M4401</link>
      <description>&lt;P&gt;asxml requires format YYYY-MM-DD.&lt;/P&gt;&lt;P&gt;So, you must use something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&amp;lt;xsl:template match="IDOC"&amp;gt;&lt;BR /&gt;    &amp;lt;xsl:for-each select="E1EDK03"&amp;gt;&lt;BR /&gt;      &amp;lt;xsl:if test="string(IDDAT) = '012'"&amp;gt;&lt;BR /&gt;        &amp;lt;DOCDT&amp;gt;&amp;lt;xsl:value-of select="concat(substring(DATUM,1,4), '-', substring(DATUM,5,2), '-', substring(DATUM,7,2))"/&amp;gt;&amp;lt;/DOCDT&amp;gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 03 Nov 2016 17:17:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-on-xml-deserialization-with-dats-datatype/m-p/312768#M4401</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2016-11-03T17:17:40Z</dc:date>
    </item>
    <item>
      <title>Re: Error on XML Deserialization with DATS Datatype</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/error-on-xml-deserialization-with-dats-datatype/m-p/312769#M4402</link>
      <description>&lt;P&gt;That does the trick. Thank you very much. That bothered me a lot longer than it should have.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2016 13:22:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/error-on-xml-deserialization-with-dats-datatype/m-p/312769#M4402</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2016-11-07T13:22:03Z</dc:date>
    </item>
  </channel>
</rss>

