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

OData V4: Actions parameter = entity?

Former Member
0 Likes
1,499

Model-Provider-Class:

" entity
DATA(entity_type) = io_model->create_entity_type( 'TESTENTITY' ).
entity_type->set_edm_name( 'Testentity' ).

DATA(property) = entity_type->create_prim_property( 'FIELD' ).
property->set_edm_name( 'Field' ).
property->set_edm_type( 'String' ).
property->set_max_length( '5' ).
property->set_is_key( ).

DATA(entity_set) = entity_type->create_entity_set( 'TESTENTITYSET' ).
entity_set->set_edm_name( 'TestentitySet' ).

" action
DATA(action) = io_model->create_action( 'AC_TEST' ).
action->set_edm_name( 'AcTest' ).

DATA(parameter) = action->create_parameter( 'TESTENTITY' ).
parameter->set_entity_type( 'TESTENTITY' ).
parameter->set_edm_name( 'Testentity' ).

DATA(action_import) = action->create_action_import( 'AI_TEST' ).
action_import->set_edm_name( 'Test' ).

Gateway Batch Request:

--batch_0001
Content-Type: multipart/mixed;boundary=changeset_01

--changeset_01
Content-Type: application/http
Content-Transfer-Encoding: binary
Content-ID: TEST

POST Test HTTP/1.1
Content-Type: application/json

{
  "Field" : "asdf"
}
--changeset_01--
--batch_0001--

Response:

--5170F0E00ABC31DBD2B902B3C76275690
Content-Type: application/http
Content-Length: 987
content-transfer-encoding: binary

HTTP/1.1 400 Bad Request
Content-Type: application/json;odata.metadata=minimal;charset=utf-8
Content-Length: 827
content-language: de
odata-version: 4.0

{"error":{"code":"005056A509B11ED1B9BF94F386DD82E6","message":"Die Data-Services-Anforderung wurde wegen einer deformierten Syntax nicht verstanden.","@SAP__common.ExceptionCategory":"Client_Error","@SAP__common.Application":{"ServiceRepository":"DEFAULT","ServiceId":"ZE01_MYSERVICE","ServiceVersion":"0003"},"@SAP__common.TransactionId":"6DC3040F5FD600D0E005E3A5A0A4AC33","@SAP__common.Timestamp":"20200207162042.088783","@SAP__common.ErrorResolution":{"Analysis":"Run transaction /IWFND/ERROR_LOG on SAP Gateway hub system and search for entries with the timestamp above for more details","Note":"See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"},"details":[{"code":"001560AA0E081DEB8CA398CC1690D406","message":"Fehler beim Parsen eines XML-Streams.","@SAP__common.Severity":""}]}}
--5170F0E00ABC31DBD2B902B3C76275690--

What is wrong in the syntax!?

How can I get a more detailed error message which line or content exactly is wrong?

Accepted Solutions (0)

Answers (1)

Answers (1)

wagners
Discoverer
0 Likes

It seems that this is not supported by SAP (yet?).

If you have a closer look into the class /IWCOR/CL_OD_EP_READER_JSON, Method /IWCOR/IF_OD_EP_READER~READ_ACTION_PARAMETERS you can see that in case of non primitive values an exception is thrown.