‎2022 Jun 01 5:26 PM
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 YYYYMMDD(original) MM.DD.YYYY(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.
i already check this link.
https://answers.sap.com/questions/10374686/rules-for-odata-datetime-properties.html
any solution for this or other links ?


‎2022 Jun 01 6:01 PM
As you looked at the other question, you know that we will ask you if you use V2 or V4?
‎2022 Jun 01 6:47 PM
Hi,
use DateTimeOffset at oData side and TIMESTAMP at ABAP side. At UI you can control the visualization of the DateTime field.
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!
‎2022 Jun 02 7:10 AM
Hi Aron,
I have set the Date Format as annotation in the MPC_EXT class.
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=>ty_e_med_entity_name
WITH DEFAULT KEY.
lo_entity_type = model->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->get_property( iv_property_name = l_datum ). "Property to be annotated
lo_oanno = lo_property->/iwbep/if_mgw_odata_annotatabl~create_annotation( /iwbep/if_mgw_med_odata_types=>gc_sap_namespace ).
lo_oanno->add( iv_key = 'display-format' iv_value = 'Date' ).
ENDLOOP.