Skip to Content
0
Apr 21, 2014 at 09:17 PM

Beginners Question on CRUD of delivered flight Model for Travel Agency info.

142 Views

I am using the delivered flight model for a simple CRUD application creating a travel agency

The Read, Updates and Deletes are working perfectly. with the following URL's

http://usphlvm2248.phl.sap.corp:55080/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/TravelagencyCollection('00000055')/

However I am having problems with the Create. After reading the documentation, it suggests that one would simply read a record and then use that as the request.

<?xml version="1.0" encoding="utf-8" ?>

- < entry xml:base =" http://usphlvm2248.phl.sap.corp:55080/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/ " xmlns =" http://www.w3.org/2005/Atom " xmlns:m =" http://schemas.microsoft.com/ado/2007/08/dataservices/metadata " xmlns:d =" http://schemas.microsoft.com/ado/2007/08/dataservices " >

< id > http://usphlvm2248.phl.sap.corp:55080/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/TravelagencyCollection('00004689') </ id >

< title type =" text " > TravelagencyCollection('00004689') </ title >

< updated > 2014-04-21T21:08:18Z </ updated >

< category term =" RMTSAMPLEFLIGHT.Travelagency " scheme =" http://schemas.microsoft.com/ado/2007/08/dataservices/scheme " />

< link href =" TravelagencyCollection('00004689') " rel =" edit " title =" Travelagency " />

- < content type =" application/xml " >

- < m:properties >

< d:agencynum > 00004689 </ d:agencynum >

< d:NAME > DEMO </ d:NAME >

< d:STREET > 1234 </ d:STREET >

< d:POSTBOX />

< d:POSTCODE > 30342 </ d:POSTCODE >

< d:CITY > Atlanta </ d:CITY >

< d:COUNTRY > US </ d:COUNTRY >

< d:REGION > GA </ d:REGION >

< d:TELEPHONE > 404-555-1212 </ d:TELEPHONE >

< d:URL > http;//www.sap.com </ d:URL >

< d:LANGU > E </ d:LANGU >

< d:CURRENCY />

< d:mimeType > text/html </ d:mimeType >

</m:properties>

</content>

</entry>







When I do this and change some of the data,ans submit a post I am getting the following error.



< message xml:lang =" en " > Duplicate resource. </ message >

- < innererror >

< transactionid > 5C89C9E388C9F130B1AC0050569A395B </ transactionid >

- < errordetails >

- < errordetail >

< code > /IWBEP/CX_MGW_BUSI_EXCEPTION </ code >

< message > Duplicate resource. </ message >

< propertyref />

< severity > error </ severity >


II am using the URL

http://usphlvm2248.phl.sap.corp:55080/sap/opu/odata/IWFND/RMTSAMPLEFLIGHT/TravelagencyCollection



Which may be wrong.. I am a novice, so please be gentle 😊 I have attached the metadata too...



Thanks!!!!!!





Attachments