on 10-26-2015 6:05 AM
Hello experts,
i am trying to create a entityset in OData which contains some date fields, but getting conversion errors, because edm.datetime is having length 7.
request your help.
thanks.
Hi,
We were facing similar issue.What we did was changed code in DEFINE method of model provider ext class like below.
lo_property = lo_entity_type->create_property( iv_property_name = 'DATEFIELDNAME' iv_abap_fieldname = 'DATEFIELDNAME' ). "#EC NOTEXT
*lo_property->set_label_from_text_element( iv_text_element_symbol = '100' iv_text_element_container = gc_incl_name ). "#EC NOTEXT
lo_property->SET_TYPE_EDM_DATETIME( ).
lo_property->set_maxlength( iv_max_length = 8 ).
lo_property->set_creatable( abap_false ).
lo_property->set_updatable( abap_false ).
lo_property->set_internal_type( 'P' ).
lo_property->set_internal_length( 8 ).
lo_property->set_sortable( abap_false ).
lo_property->set_nullable( abap_false ).
lo_property->set_filterable( abap_false ).
Hope this helps
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
try with this code
jQuery.sap.require("sap.ui.model.odata.ODataUtils");
var sPath = "/MyEntitiySet(Id='0815', ChDateTime=" + ODataUtils.formatValue(1436109229000, "Edm.DateTime") + ")";
- jQuery.sap.require("sap.ui.model.odata.ODataUtils");
- var sPath = "/MyEntitiySet(Id='0815', ChDateTime=" + encodeURIComponent(sap.ui.model.odata.ODataUtils.formatValue(1436109229000, "Edm.DateTime")) + ")";
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perhaps use TIMESTAMPL as data element and do Date formatting at SAPUI5 App.
TIMESTAMPL is actually UTC Time Stamp in Long Form (YYYYMMDDhhmmssmmmuuun).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
25 | |
12 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.