cancel
Showing results for 
Search instead for 
Did you mean: 

Consolidate all errors in UDF and than send email

Former Member
0 Kudos

All,

I have already configured the UDF that will generate an email if the one of the mandatory field is missing. It will invoke a mail channel and send email.

However the place I am facing challenge is that I want to send one consolidated email from PI using the UDF for all the mandatory fields that are missing, instead of sending one email for each mandatorey field.

Please advice.

Accepted Solutions (0)

Answers (3)

Answers (3)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

XML validation is the pipeline step already available. you can use that step and fail the message. when the message fails create alert mechanism to send mail. This is one approach. Otherwise I would recommend you to use Java mapping and inside java mapping does all the validation and collect as the concataneted string and send mail via java mapping class itself.  This is another approach. 

ambrish_mishra
Active Contributor
0 Kudos

Hi Vicky,

IMO, these kind of issues should be handled at source. A field mandatory from a ECC/PI perspective should be populated at source. Only in exceptional case, should this be handled in PI. Such records with mandatory data missing should error out in source system itself.

If at all, you want to stick to the existing design, then a generic UDF is not possible. You cannot have dynamic number of parameters as input to a generic UDF. you will have to copy the code across different mappings.

You can have a customized message for failure through ABAP mappin (I have implemented it) but then failure induced in PI for mandatory fields missing is not an ideal case.

Hope it helps!

Ambrish

former_member184720
Active Contributor
0 Kudos

I don't know what is the purpose of this.. but you can do one thing

Create a UDF - pass the all mandatory fields as input

Check their existence in the UDF and append all the missing fields to a string.

map the output of this UDF to your email UDF which will trigger an email if the input string is not empty.

You can do this mapping at root node creation.

Regards,

Hareesh

Former Member
0 Kudos

Problem is I want to use one UDF all across mappings and having all mandatory fields as input to the UDF may not work as differwent mappings will have different number of mandatory fields.

Also the reason I want to try UDF to gebnerate alerst is beacuse this will help me create customize alerts.

former_member184720
Active Contributor
0 Kudos

Then i don't think it is possible.

Also the reason I want to try UDF to generate alert is because this will help me create customize alerts.

Using UDF, you can get the error text in sxmb_moni(customized) error text and with the help of RWB alerts the same customized error text can be sent to business teams over the email.

Instead of invoking a mail channel from the mapping, this is the best option in all the terms.

Simple mapping

improved performance

no new message will be created(mail channel)

i hope you already refered to the below blog.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2007/04/26/xipi-throwing-generic-exceptions-...

Regards,

Hareesh