on 08-08-2019 11:10 AM
hello,
I am working on posting log using odata service and I keep getting an error stating unsupported format.
I tried changing the content type to application/xml but that also didn't work.
where am i going wrong??
entityset
class
METHOD DATALOGSET_CREATE_ENTITY.
DATA: IT_ENTITY TYPE ZCL_ZIOT_DATAENTRY_MPC=>TS_DATALOG,
EXREF TYPE REF TO CX_ROOT,
IT_IOT TYPE ZIOT_DATA_REC=>TT_IOT,
WA_IOT TYPE ZIOT_DATA_REC=>TS_IOT,
G_REF TYPE REF TO ZIOT_DATA_REC.
CREATE OBJECT G_REF.
TRY.
CALL METHOD IO_DATA_PROVIDER->READ_ENTRY_DATA
IMPORTING
ES_DATA = IT_ENTITY.
CATCH /IWBEP/CX_MGW_TECH_EXCEPTION INTO EXREF.
ENDTRY.
IF IT_ENTITY IS NOT INITIAL.
CALL FUNCTION 'ABI_TIMESTAMP_CONVERT_FROM'
EXPORTING
IV_TIMESTAMP = IT_ENTITY-DATETIME
IMPORTING
O_DATE = WA_IOT-POSTING_DATE
O_TIME = WA_IOT-POSTING_TIME
* EXCEPTIONS
* CONVERSION_ERROR = 1
* OTHERS = 2
.
APPEND WA_IOT TO IT_IOT.
CALL METHOD ZIOT_DATA_REC=>GET_DATA
EXPORTING
IM_IOT = IT_IOT
* IMPORTING
* EX_STATUS =
.
ENDIF.
ENDMETHOD.
service maintainance
input:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="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" xml:base="http://IILTEST:8000/sap/opu/odata/sap/ZIOT_DATAENTRY_SRV/">
<id>http://IILTEST:8000/sap/opu/odata/sap/ZIOT_DATAENTRY_SRV/dataLogSet</id>
<title type="text">dataLogSet</title>
<updated>2019-08-08T10:04:09Z</updated>
<author>
<name />
</author>
<link href="dataLogSet" rel="self" title="dataLogSet" />
<entry>
<id>http://IILTEST:8000/sap/opu/odata/sap/ZIOT_DATAENTRY_SRV/dataLogSet('0000000001')</id>
<title type="text">dataLogSet('0000000001')</title>
<updated>2019-08-08T10:04:09Z</updated>
<category term="ZIOT_DATAENTRY_SRV.dataLog" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" />
<link href="dataLogSet('0000000001')" rel="self" title="dataLog" />
<content type="application/xml">
<m:properties>
<d:MachineId>0000000001</d:MachineId>
<d:Set>Prod1</d:Set>
<d:DateTime>2019-07-26T12:39:14</d:DateTime>
<d:Approve>X</d:Approve>
<d:Reject />
<d:Hold />
</m:properties>
</content>
</entry>
</feed>
error
please help
thanking in advance
Siddharth
You can also set the DateTime field Nullable. You can check Nullable in property.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
77 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.