<?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: oData DateTime Error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/odata-datetime-error/m-p/12604486#M2011264</link>
    <description>&lt;P&gt;Hi Aron,&lt;/P&gt;&lt;P&gt;I have set the Date Format as annotation in the MPC_EXT class.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; DATA: lo_entity_type TYPE REF TO /iwbep/if_mgw_odata_entity_typ,
       lo_property    TYPE REF TO /iwbep/if_mgw_odata_property,
       lo_oanno TYPE REF TO /iwbep/if_mgw_odata_annotation.

 TYPES: proptab_type TYPE STANDARD TABLE OF /iwbep/if_mgw_med_odata_types=&amp;gt;ty_e_med_entity_name &lt;BR /&gt;                          WITH DEFAULT KEY.

    lo_entity_type = model-&amp;gt;get_entity_type( iv_entity_name = gc_xxxx ). 
    DATA(lt_datum) = VALUE proptab_type( ( 'Bdatum' )
                                         ( 'Changedate' ) ).
    LOOP AT lt_datum INTO DATA(l_datum).
      lo_property = lo_entity_type-&amp;gt;get_property( iv_property_name = l_datum ). "Property to be annotated
      lo_oanno = lo_property-&amp;gt;/iwbep/if_mgw_odata_annotatabl~create_annotation( /iwbep/if_mgw_med_odata_types=&amp;gt;gc_sap_namespace ).
      lo_oanno-&amp;gt;add(  iv_key = 'display-format'  iv_value    = 'Date' ).
    ENDLOOP.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 02 Jun 2022 06:10:27 GMT</pubDate>
    <dc:creator>ThorstenHoefer</dc:creator>
    <dc:date>2022-06-02T06:10:27Z</dc:date>
    <item>
      <title>oData DateTime Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/odata-datetime-error/m-p/12604483#M2011261</link>
      <description>&lt;P&gt;Who has already encountered this error. the Data Elements of ANGDT Field and other fields in DDIC are DATS while the EDM Core Type of oData entity set is EDM.DateTime. The Format of DATS is &lt;STRONG&gt;YYYYMMDD&lt;/STRONG&gt;(original) &lt;STRONG&gt;MM.DD.YYYY&lt;/STRONG&gt;(if view in DDIC ) and its not same in DateTime because it has time format but the available DataTypes is this(see image below) . i tried to change it to string also but i got another error.&lt;/P&gt;
  &lt;P&gt;i already check this link.&lt;BR /&gt;&lt;A href="https://answers.sap.com/questions/10374686/rules-for-odata-datetime-properties.html" target="test_blank"&gt;https://answers.sap.com/questions/10374686/rules-for-odata-datetime-properties.html&lt;/A&gt;&lt;/P&gt;
  &lt;P&gt;any solution for this or other links ?&lt;/P&gt;
  &lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2052959-image.png" /&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2052955-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 16:26:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/odata-datetime-error/m-p/12604483#M2011261</guid>
      <dc:creator>AJeB</dc:creator>
      <dc:date>2022-06-01T16:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: oData DateTime Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/odata-datetime-error/m-p/12604484#M2011262</link>
      <description>&lt;P&gt;As you looked at the other question, you know that we will ask you if you use V2 or V4?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 17:01:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/odata-datetime-error/m-p/12604484#M2011262</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2022-06-01T17:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: oData DateTime Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/odata-datetime-error/m-p/12604485#M2011263</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;use DateTimeOffset at oData side and TIMESTAMP at ABAP side. At UI you can control the visualization of the DateTime field.&lt;/P&gt;&lt;P&gt;Be aware that the timezone of the user's browser can be diferent than the system timezone, so it can happen that the date will be differs at UI from DB!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 17:47:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/odata-datetime-error/m-p/12604485#M2011263</guid>
      <dc:creator>rpalotai</dc:creator>
      <dc:date>2022-06-01T17:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: oData DateTime Error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/odata-datetime-error/m-p/12604486#M2011264</link>
      <description>&lt;P&gt;Hi Aron,&lt;/P&gt;&lt;P&gt;I have set the Date Format as annotation in the MPC_EXT class.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; DATA: lo_entity_type TYPE REF TO /iwbep/if_mgw_odata_entity_typ,
       lo_property    TYPE REF TO /iwbep/if_mgw_odata_property,
       lo_oanno TYPE REF TO /iwbep/if_mgw_odata_annotation.

 TYPES: proptab_type TYPE STANDARD TABLE OF /iwbep/if_mgw_med_odata_types=&amp;gt;ty_e_med_entity_name &lt;BR /&gt;                          WITH DEFAULT KEY.

    lo_entity_type = model-&amp;gt;get_entity_type( iv_entity_name = gc_xxxx ). 
    DATA(lt_datum) = VALUE proptab_type( ( 'Bdatum' )
                                         ( 'Changedate' ) ).
    LOOP AT lt_datum INTO DATA(l_datum).
      lo_property = lo_entity_type-&amp;gt;get_property( iv_property_name = l_datum ). "Property to be annotated
      lo_oanno = lo_property-&amp;gt;/iwbep/if_mgw_odata_annotatabl~create_annotation( /iwbep/if_mgw_med_odata_types=&amp;gt;gc_sap_namespace ).
      lo_oanno-&amp;gt;add(  iv_key = 'display-format'  iv_value    = 'Date' ).
    ENDLOOP.&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 02 Jun 2022 06:10:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/odata-datetime-error/m-p/12604486#M2011264</guid>
      <dc:creator>ThorstenHoefer</dc:creator>
      <dc:date>2022-06-02T06:10:27Z</dc:date>
    </item>
  </channel>
</rss>

