Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9242

Re: Raise custom exception

$
0
0

Hi Vedran

 

Based on the discussion above, it looks like the JDBC call returns the error on the RESPONSE message and do not have a FAULT message type, is that right? Also, you mentioned ABAP proxy, so I'm guessing your scenario is synchronous Proxy to JDBC.

 

If the JDBC call does not have a FAULT message, AFAIK I don't think you can map this back to the Proxy fault message.

 

An alternative approach would be to map back the JDBC response to the Proxy response, and handle this in the ABAP proxy.

 

In the proxy coding, you can check for the values in the response for an indicator of the error. If an error happens, you can raise an exception there. You can check out the link below on how to raise fault messages in the proxy.

https://help.sap.com/saphelp_nw04/helpdata/en/5d/a45c3cff8ca92be10000000a114084/content.htm

If you use the application log, or have access to error information from a BAPI return table, you can also use these directly to complete the fault message. In this case, you only need to call the methodCL_PROXY_FAULT=>RAISE of the proxy runtime to trigger the error:

 

CALL METHOD cl_proxy_fault=>raise
  EXPORTING
   exception_class_name  
= <Name of Exception Class>  

   application_log_handle = < Application Log: Handle of a Protocol>  

   bapireturn_tab         = < Table with BAPI Return Information>.

 

The exception class name would be the proxy generated class based on the custom fault type that you declared for the proxy service interface.

 

Once the exception is raised in the ABAP proxy, you will see this as an "Application Error" in SXMB_MONI of your ECC system.

 

Rgds

Eng Swee


Viewing all articles
Browse latest Browse all 9242

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>