Skip to Content

SAP Gateway Exception

Hi everybody.

I'm starting with sap gateway and i'd like to custom my error response when i'm calling the exception.

It would be possible? For example:

The original response:

{

"error": {

"code": "SY/530",

"message": {

"lang": "pt",

"value": "MESSAGE I"

},

"innererror": {

"application": {

"component_id": "BC",

"service_namespace": "/SAP/",

"service_id": "ZGW_PLANNING_PRODUCTION_SRV_01",

"service_version": "0001"

},

"transactionid": "57CE749CDC2E533AE1000000AC0C0CD0",

"timestamp": "",

"Error_Resolution": {

"SAP_Transaction": "",

"SAP_Note": "See SAP Note 1797736 for error analysis (https://service.sap.com/sap/support/notes/1797736)"

},

"errordetails": [

{

"code": "",

"message": "MESSAGE I.",

"propertyref": "",

"severity": "error",

"target": ""

},

{

"code": "",

"message": "MESSAGE II.",

"propertyref": "",

"severity": "error",

"target": ""

},

{

"code": "/IWBEP/CX_MGW_BUSI_EXCEPTION",

"message": "",

"propertyref": "",

"severity": "error",

"target": ""

}

]

}

}

}

I'd like to receive the following structure:


{

"errordetails": [

{

"code": "",

"message": "MESSAGE I",

"propertyref": "",

"severity": "error",

"target": ""

},

{

"code": "XX",

"message": "MESSAGE II",

"propertyref": "",

"severity": "error",

"target": ""

}

]

}


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

1 Answer

  • Posted on Sep 13, 2016 at 07:50 PM

    Hi Enio,

    Is there some reason you would want to reduce the amount of information that is returned? The error payload is in a straightforward JSON string format that can easily be converted into a JavaScript object with one line of code. Likely any attempt to intercept the message output for an exception and override the value would require a number of standard code changes.

    Regards,

    Ryan Crosby

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.