on 06-04-2018 11:08 AM
I have created an OData service and implemented the get_entityset and get_entity method. The get_entityset is working fine but the get_entity method throws a 404 error. Below is the code for the get_entity method and the DB table has 6 fields as seen in the code. Also, find the error screenshot in gateway client.error.png
I have used this link as a reference.
METHOD headerset_get_entity.
DATA: ls_key_tab TYPE /iwbep/s_mgw_name_value_pair,
lv_tor_id TYPE zpayment_header-tor_id,
ls_header TYPE zpayment_header.
READ TABLE it_key_tab WITH KEY name = 'TOR_ID' INTO ls_key_tab.
lv_tor_id = ls_key_tab-value.
SELECT SINGLE * FROM zpayment_header INTO ls_header WHERE tor_id = lv_tor_id.
IF sy-subrc = 0.
er_entity-tor_id = ls_header-tor_id.
er_entity-source = ls_header-source.
er_entity-destination = ls_header-destination.
er_entity-dept_date_time = ls_header-dept_date_time.
er_entity-amount = ls_header-amount.
er_entity-status = ls_header-status.
ENDIF.
ENDMETHOD.
Hello ,
Since select fails and sy-subrc er_entity is blank this error appears . Please comment er_entity code and then try to debug the service
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your OData call should be like below
1. Get Entityset: <service path>/<EntitysetName>?<$format=......(additional parameters and filters)
2. Get Entity: <service path>/<EntitysetName>(key1=value1,key2=value2)?<$format=......(additional parameters and filters)
Value for keys need to be encapsulated in single quotes if its a character type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.