Purpose
I
nterpreting the HTTP status code after an OData Call 

After an OData call, the GuiXT system variable V[_odatahttpstatuscode] contains the returned status code; ideally, this is 200 = Success.

Here is a quick status code reference for SAP Gateway OData services (v2 and v4): what each status code means and what typically causes it.  

Code Meaning Typical cause with OData / SAP
200OK Success with content GET on an entity or collection, batch standard response
201Created Entity created POST (create); the URL of the new entity is returned in the 'location' header
202Accepted Accepted for asynchronous processing v4 request with Prefer: respond-async
204No Content Success without content PUT / PATCH / MERGE / DELETE
304Not Modified Unchanged GET with if-None-Match and a matching ETag
400Bad Request Malformed request Syntax error in filter:= or expand:=, invalid JSON, wrong data type in the key; SAP returns details in the error message
401Unauthorized Not authenticated Missing or wrong credentials, expired session or cookie
403Forbidden Not authorized Missing SAP user role (S_SERVICE), or missing/invalid CSRF token
404Not Found Resource not found No entity with this key, typo in the entity set name, or service not activated. Check in the SAP transactions /IWFND/MAINT_SERVICE or /IWFND/V4_ADMIN)
405Method Not Allowed Method not permitted Entity set is not creatable, updatable or deletable
406Not Acceptable Format cannot be delivered Unsupported Accept header or $format
409Conflict Conflict Duplicate key on create, lock conflict
412Precondition Failed ETag mismatch If-Match with an outdated ETag; the record was changed in the meantime
415Unsupported Media Type Wrong content type e.g. missing Content-Type: application/json on POST, wrong boundary in batch processing
428Precondition Required ETag required Update without If-match although the service requires ETags
500Internal Server Error Server error ABAP short dump or unhandled exception; analyze with ST22, /IWFND/ERROR_LOG, /IWBEP/ERROR_LOG
501Not Implemented Not implemented Method not redefined in the DPC_EXT class (v2), or operation not supported by the service
502Bad Gateway Proxy error Reverse proxy cannot reach the SAP system or receives an invalid response
503Service Unavailable Unavailable System shut down, ICM overloaded, maintenance
504Gateway Timeout Timeout Long-running query exceeds the proxy or ICM timeout

In batch processing, the outer response is typically 200 (v2) or 200/202 (v4), even if individual operations fail. The actual status codes are then contained in the status code table, which is returned by 'guinet.odata.RequestBatch' as a GuiXT table variable named 'returnStatus:='.

  Components  InputAssistant + GuiXT Controls