Skip to Content
0
Former Member
Jan 21, 2011 at 07:05 AM

ABAP Mapping for Error handling in Proxy to JDBC

39 Views

Hi All,

I am working on a proxy to jdbc scenario in which we have to throw validation errors to NWPM(Net Weaver Process Monitor Tool)

I am following the below steps,

step 1 - In message mapping a UDF is created to catch errors and store them in a variable using dynamic configuration

step 2 - writing abap mapping for handling this thrown exception and im reading the dynamic configuration in the abap class and raising exception. The exception format expected is

SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>XIServer</SAP:Category>

<SAP:Code area="RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC</SAP:Code>

<SAP:P1>ZPI_THROW_EXCEPTION</SAP:P1>

<SAP:P2>001</SAP:P2/>

<SAP:P3>Mandatory field is missing[BUKRS] </SAP:P3>

<SAP:AdditionalText />

<SAP:Stack>No receiver could be determined</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

I have written the following ABAP code to achieve this:

method IF_MAPPING~EXECUTE.

DATA l_record type mpp_dynamic.

DATA error type String.

  • getting dynamic configuration value

  • filled in by any previous mapping

CALL METHOD DYNAMIC_CONFIGURATION->GET_RECORD

EXPORTING

NAMESPACE = 'http://sap.com/xi/XI/System/ERROR'

NAME = 'ERROR'

RECEIVING

RECORD = l_record.

error = l_record-value.

*raising exception with our message

RAISE EXCEPTION TYPE CX_MAPPING_FAULT

EXPORTING

  • TEXTID =

  • PREVIOUS =

ERROR_CODE = '001'

ERROR_TEXT = error .

RAISE EXCEPTION TYPE CX_MAPPING_FAULT

EXPORTING

  • TEXTID =

  • PREVIOUS =

ERROR_CODE = '003'

ERROR_TEXT = error .

endmethod.

I am gettign the following message for our code:

SAP:Error SOAP:mustUnderstand="" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">

<SAP:Category>XIServer</SAP:Category>

<SAP:Code area="RCVR_DETERMINATION">NO_RECEIVER_CASE_ASYNC</SAP:Code>

<SAP:P1 />

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText />

<SAP:Stack>No receiver could be determined</SAP:Stack>

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

Could you please help in finding the solution for getting currect error message from ABAP class?

Edited by: SwethaC on Jan 21, 2011 8:18 AM