Skip to Content
0

How do I make and test a gateway entity set with only the create operation?

Jan 12, 2017 at 07:31 PM

41

avatar image

How do I make and test a gateway entity set with only the create operation?

I frequently see blogs with comments like:

To test POST operation, 1st execute GET operation and then press Use as Request button which will copy the response to request window and then select operation POST and execute.

Is there a way to get a "blank" document for using as a request without implementing the "get" operation?

I am writing a backend RFC to create maintenance orders and I want to expose it via the gateway.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Krishna Kishor Kammaje
Jan 17, 2017 at 05:46 AM
1

It is actually easy to build the request body in json. Try hand coding as below.

For example

{

'property1' : 'value1',

'property2': 'value2',

'property3': 'value3',

'property4': 'value4'

}

Share
10 |10000 characters needed characters left characters exceeded
Derek Morin Jan 26, 2017 at 12:40 PM
0

I was able to change an update call by manually tweaking the xml. Krishna's post gave me the confidence that I could just easily tweak the xml.

<?xml version="1.0" encoding="utf-8"?>
<entry xml:base="http://xxxxxxxxxxx/sap/opu/odata/sap/ZAPMEXTERNALDATA" 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">
 <link href="CreateMaintOrderSet" rel="edit" title="CreateMaintOrderSet"/>
 <content type="application/xml">
  <m:properties>
  <d:OrderType></d:OrderType>
  <d:ShortText></d:ShortText>
  <d:FunctLoc>?0100000000000000195</d:FunctLoc>
  </m:properties>
 </content>
</entry>
Share
10 |10000 characters needed characters left characters exceeded