cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Odata Create/Post Method Issue

Former Member
0 Likes
3,150

Hello Experts ,

    Currently Issue is with SAP Netweaver Gateway Odata Services .

I am Trying to POST the Records into Database table Using Odata Create Method, For that I am Using T-Code SE80 and creating GW Data Model and Consumption Model ,generating the Model . Later on tried to Run the Odata service URL in the REST client . I am Getting the Error message as "System expected a value for the type g" . I am Using POST Method here and the Content-type = application/atom+xml and also Using x-csrf-token .

In The Request Header, Passing the Data Record to be created in XML Format as shown below.

XML Format:


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

<atom:entry xml:base="http://host:port/sap/opu/odata/sap/ZCUSTOMER_RFC/"

xmlns:atom="http://www.w3.org/2005/Atom"

xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"                       

xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"

xmlns:sap="http://www.sap.com/Protocols/SAPData">

           <atom:content >

                   <m:properties>

                   <d:empno>0000000020</d:empno>

                   <d:city>UK</d:city>

                   <d:ename>Ram</d:ename>

                 </m:properties>

           </atom:content>

   </atom:entry>

Could anyone suggest whether the Format and Procedure I am using is correct or not ? and also the reason for the error 500 Internal server error with code CX_ST_MATCH_TYPE and Message "System expected a value for the type g".

 

     Appreciate your Help.

Thanks,

Uday.

View Entire Topic
shivakishore
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Uday,

This error comes only when your "POST" body is improper.

I would suggest you to do "GET" operation on any record and check whether your "POST" body matches with it else change the body accordingly.

thanks & regards,

Shivakishore

Former Member
0 Likes

Hi Uday,

Please check the schema which is been used as the error which you are encountering is from the backend gateway data type .

Also please check the POST body ,whether you have missed any mandatory field.

Hope this information helps.

Thanks ,

Latha