on 09-25-2014 12:38 PM
Hello
Successfull update will always shows 204 and no content is retuned.
So u need to raise an exception when ur update fails with the error messages.
When no error are encountered during update and if its success then u can decide update is successful based on 204 status.
U can also set ur custom messages as well like Syam suggested with appropriate success message returned by ur backend logic.
Regards
Ashwin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks All,
Can anybody please provide me a sample code how to raise an exception from the update method.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sending error messages (with return code 204) for an Update operation in Response Header is a workaround and not really OData compliant. You need to raise an exception if you need to get error messages as others suggested.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ravi,
"When processing a PUT request servers return status 204 (No Content) to indicate success, no response body is needed"
Sreehari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi,
If you want to display messages in Update and Delete operations, you can use below code. the messages you can see in response headers.
DATA ls_header TYPE ihttpnvp.
IF lv_message IS NOT INITIAL.
ls_header-name = 'STATUS' .
ls_header-value = lv_message.
/iwbep/if_mgw_conv_srv_runtime~set_header( ls_header ).
else.
ls_header-name = 'STATUS' .
ls_header-value = 'FAIL'."lv_message.
/iwbep/if_mgw_conv_srv_runtime~set_header( ls_header ).
Thanks
Syam
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.