Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Emd.DateTime used as key in URI problem

Hello Experts,

we have a problem while using a Edm.DateTime as key in URI while sending GetEntity request to the GW Server.

We've defined a Edm.DateTime field in the Service builder as a key for an entity. While calling GetEntitySet operation, we can get the data correctly. The GW server generates also URI for it.

- <entry>



<title type="text">RealEstateContractConditionSet(CONDITION_TYPE='0010',VALID_FROM=datetime'2012-01-01T00%3A00%3A00',IDENT_KEY='1000%2F1000000',OBJECT_TYPE='IS')</title>


<category term="IMMOBILIENVERTRAG_SRV.RealEstateContractCondition" scheme="" />

<link href="RealEstateContractConditionSet(CONDITION_TYPE='0010',VALID_FROM=datetime'2012-01-01T00%3A00%3A00',IDENT_KEY='1000%2F1000000',OBJECT_TYPE='IS')" rel="self" title="RealEstateContractCondition" />

- <content type="application/xml">

- <m:properties xmlns:m="" xmlns:d="">








<d:Status />



<d:XMCALCRULE>Object Measurement</d:XMCALCRULE>





- <entry>

The problem is, when we use this URL  http://myserver:8000/sap/opu/odata/CONET/IMMOBILIENVERTRAG_SRV/RealEstateContractConditionSet(CONDITION_TYPE='0010',VALID_FROM=datetime'2012-01-01T00%3A00%3A00',IDENT_KEY='1000%2F1000000',OBJECT_TYPE='IS')

in the GW client, we got always a error:

Invalid format (return structure): Property Name 'VALID_FROM',  Property Value '00000000'.

Meanwhile, in another project, we use an Edm.DateTime field as a filter parameter to select a range of values. It works very well.Here is the URL:

/sap/opu/odata/CONET/IMMOBILIENGEBUILDING_SRV/RealEstateBuildingSet?$filter=Responsible eq 'Kugelberg' and Stichtag eq datetime'2013-01-01T00:00:00'

We are really confused with the behavior of the GW runtime.

BTW: in the error log, we found out that the error occurs in the /IWCOR/CL_DS_EP_WRITER_XML Class, method: WRITE_ENTITY_PROPERTIES, row: 55.

Appreciate a lot for any tips in advance.

best regards


gw_error.png (97265 B)
Former Member
Former Member replied

Hi Sathish,

As mentioned in my reply, this is not an option as key properties cannot be null. However I agree that this sounds more like a feed issue than a predicate parsing issue on the request.

Xiang, does the request actually reach the GET method for this entity? If it does, it's not the request handling, it's the response writer.

Is the GET logic identical to the logic you use to fill the collection members?  Since the collection part works, it doesn't make a lot of sense for the single entity to fail unless there is an error in how the response is built.

Obviously not having full access to the problem  I can only guess based on experience, but that's what I'd be checking first.



0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question