cancel
Showing results for 
Search instead for 
Did you mean: 

Throws validation errors to NWPM

Former Member
0 Kudos

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 missingBUKRS </SAP:P3>

<SAP:AdditionalText />

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

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

</SAP:Error>

but while i am trying to test the data in message mapping it will show one error.

and with out using abap code it works successfully but while i am adding Abap code in interface mapping it will show the following error.

"Runtime exception when processing target-field mapping /ns0:MT_DB2_SourcePlant/Record/SourcePlant; root message: Exception:[java.lang.NullPointerException: while trying to invoke the method com.sap.aii.mapping.api.DynamicConfiguration.put(com.sap.aii.mapping.api.DynamicConfigurationKey, java.lang.String) of an object loaded from local variable '<9>'] in class CHRYSLER_com_test_scenario.ErrorHandling method testingError[, 4, , com.sap.aii.mappingtool.tf7.rt.Context@749119e6]"

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?

Accepted Solutions (0)

Answers (3)

Answers (3)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

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

you need to fix the above error first. This could be due to not proper proxy configuration or Integration Directory objects are not created or defined.

Test the ID objects using ID test tool

DO SXI_CACHE and see all your Reciever Determination, Receiver / Sender Business systems and REceiver agreeemnt are active and available

Then go for the mapping error. As you know Receiver Determination occurs first in pipeline steps then mapping step.

stefan_grube
Active Contributor
0 Kudos

When you have an error message like "NO_RECEIVER_CASE_ASYNC", then your mapping will not be executed, therefore you cannot evaluate the error message in mapping.

RKothari
Contributor
0 Kudos

Hello,

The ABAP code looks ok except the missing if error != null statement.

Please check the similar code for raising exception provided in the below blog:

/people/ravi.gupta4/blog/2010/02/04/automating-cancellation-of-a-failed-message-in-xi

Also, Can you check whether exception is raised using Dynamic config UDF and a call to abap mapping is made.

Check the other approach of raising an exception:

/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping

-Rahul