Quantcast
Channel: SCN : Unanswered Discussions - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 6719

Question about using UDF to generate Exception and Alert for Mandatory Field Check

$
0
0

Hi Experts,

 

I have add UDF according to the thread of Amit in my mapping in order to produce runtime exception as below:

 

public void CheckMandatory(String[] var1, String[] IDocNr, String[] FeldName, ResultList result, Container container) throws StreamTransformationException

{

     for(int i=0;i<var1.length;i++)

     {

           if(var1[i].equals(""))

           { 

                 throw new RuntimeException("The Field " +FeldName[0]+ " in "+"IDoc: "+IDocNr[0]+" is missing");

           } 

            else 

       result.addValue(var1[i]);

      }

}

 

In the Mapping Test Module it works fine and give the exception as belows:

 

Exception:[java.lang.RuntimeException: The field XXX in IDoc: 0000000027180117 is missing] in class com.sap.xi.tf._MM_ORERS_ORDERS05_to_InsertOrders_ method CheckMandatory[[Ljava.lang.String;@6b237f5b, [Ljava.lang.String;@677e6650, [Ljava.lang.String;@1b6f4345, com.sap.aii.mappingtool.tf7.rt.ResultListImpl@25a97515, com.sap.aii.mappingtool.tf7.rt.Context@1845c904]

 

But, in the Runtime Workbench, I send the same message over "Message Test".

It gives the normal Error in the SXMB_MONI:

 

<SAP:Stack>Während des Anwendungs-Mappings com/sap/xi/tf/_MM_ORERS_ORDERS05_to_InsertOrders_ ist eine RuntimeException aufgetreten. com.sap.aii.mappingtool.tf7.MessageMappingException: Runtime exception when processing target-fieldmapping /ns0:INSERT_Orders/StatementPosition/dbTa~</SAP:Stack>

 

And the alert has the same texts as above.

 

Could anyone give me tips?

 

Thanks a lot!

 

Regards

Rene


Viewing all articles
Browse latest Browse all 6719

Trending Articles



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