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>

d

<id>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')</id>

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

<updated>2014-09-12T11:21:43Z</updated>

<category term="IMMOBILIENVERTRAG_SRV.RealEstateContractCondition" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/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="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices">

<d:CONDITION_TYPE>0010</d:CONDITION_TYPE>

<d:EXTERNAL_PURPOSE>A</d:EXTERNAL_PURPOSE>

<d:CALC_RULE>D</d:CALC_RULE>

<d:UNIT_PRICE>6</d:UNIT_PRICE>

<d:VALID_FROM>2012-01-01T00:00:00</d:VALID_FROM>

<d:VALID_TO>9999-12-31T00:00:00</d:VALID_TO>

<d:IDENT_KEY>1000/1000000</d:IDENT_KEY>

<d:Status />

<d:XCONDTYPEM>Basic rent</d:XCONDTYPEM>

<d:XMCONDPURPOSEEXT>Actual Rent</d:XMCONDPURPOSEEXT>

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

<d:OBJECT_TYPE>IS</d:OBJECT_TYPE>

</m:properties>

</content>

</entry>

- <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

Xiang

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.

Regards

Ron.

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