on 10-21-2021 2:39 PM
Hey Experts,
we published an ABAP Restful API (Release 19/09, unmanaged implementation, OData V2), which is consumed by an Azure Function.
We implemented the CREATE behaviour and everything is working well. We just want to implement different answers for the Create or POST event.
So for Example if something is already created we want to return an HTTP Status 208 Already Reported or something similar. So is there any way of changing the status codes without throwing erros ?
Best Regards
Björn
I can confirm that this probably can't be done in ABAP Platform 2021.
By debugging, I managed to find class CL_SADL_GW_DPC_UTIL, method GET_HTTP_STATUS_FOR_FAILURE, where the HTTP code is determined as a mapping from an internal field called "failure reason".
(This field "failure reason" is set to "NON_SPECIFIC" by default and only changed by the RAP runtime for very specific errors. Programmers of RAP services can't touch it.
No HTTP code is actually mapped to this "failure reason" - it will be later set to 400 by a subsequent routine -.)
There is an internal field %FAIL_INFO used as basis for the "failure reason", but I could not find a way to set it. Even if you could, you are quite limited, unless you enhance the above class and/or modify the constant list for "failure reason".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
75 | |
10 | |
8 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.