2023 Jan 11 10:21 AM
Hi,
My Odata Services is working for get entityset perfectly and able to use display in the browser or gateway service.
The problem is when I try to use get_entity method where I use the signature of the method.
read table it_key_tab into data(ls_key_tab) with key name = 'Vbeln'.
It shows client error 400.
Why can't I read the table it_key_tab ?
Thanks
Jyothsna
2023 Jan 11 10:38 AM
2023 Jan 11 2:43 PM
What prevents from getting the same data which was working in select statement into the et_entityset
but not into er_entity ?
Thank you. I checked the said sample project and copied the following that is relevant to my usage of tables. It didnot solve the problem. Hence I changed it to
METHOD SALESDOCHEADERSE_GET_ENTITY.
* DATA: ls_converted_keys TYPE /iwbep/cl_gwsample_bas_mpc=>ts_salesorder,
* lv_source_entity_set_name TYPE /iwbep/mgw_tech_name.
*
* lv_source_entity_set_name = io_tech_request_context->get_source_entity_set_name( ).
*
* IF lv_source_entity_set_name IS INITIAL.
* io_tech_request_context->get_converted_keys(
* IMPORTING
* es_key_values = ls_converted_keys ).
*
**er_entity = so_get_entity( ls_converted_keys-so_id ).
** ELSE.
** resolve_navigation_path(
** EXPORTING
** io_tech_request_ctx_entity = io_tech_request_context
** IMPORTING
** er_result = er_entity ).
* ENDIF.
DATA(lt_keys) = io_tech_request_context->get_source_keys( ) .
data: ls_key like line of lt_keys.
* read table lt_keys into ls_key with key name = 'Vbeln'. " This is giving error of expected edm.string
* hence
data: ls_vbeln type string value 'Vbeln'.
read table it_keys into ls_key with key name = ls_vbeln.
if Sy-subrc eq 0.
select single * from vbak into er_entity
where vbeln = ls_key-value.
endif.
ENDMETHOD.
Still the same 404 error.