on 04-02-2014 5:19 PM
All,
I have created a GW Service with READ, QUERY and POST. READ & QUERY are using SAP delivered BAPIs, for POST I wrote a custom BAPI so I could include the commit.
When READ or QUERY fails (ie cannot find a record with the given params), I get a message back from the service, which is great ... the issue is around POST. If the object fails to create in the POST custom BAPI (say an equipment), technically the POST was successful, but the equipment failed to create, so I would like to not return a status_code 201 and status_reason Created.
What am I missing here?
Thanks, Mike
To clarify a bit more ... perhaps I don't need to change the status_code 201 and status_reason Created ... but if the equipment fails to create how do I let the user know if POST does not return any params and the status says it is okay?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can raise an exception in the Gateway data provider class and pass the message. Message should be available at the client.
/IWBEP/CX_MGW_BUSI_EXCEPTION - SAP NetWeaver Gateway Foundation (SAP_GWFND) - SAP Library
So I tried a test with the NW GW Client and this is what I got back ... doesn't seem right:
<?xml version="1.0" encoding="utf-8" ?>
</errordetail>
</errordetails>
</innererror>
</error>
Okay, I was with you until that last comment.
I have the custom RFC BAPI mapped to the Create (POST) method of my GW Service. The POST method does not (appear to) return any parameters, how would I capture the the error message in the RFC and raise the exception (where?). I am looking at the classes that are generated by the service builder, perhaps somewhere in there?
-Mike
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.