cancel
Showing results for 
Search instead for 
Did you mean: 

Container Variable in Alert Cat

Former Member
0 Kudos

Hi,

I have a FTP To FTP scenario, where I have to handle alerts if any error occurs in PI. For Example FTP Password is changed in the Target system and not updated in the Receiver Channel. Obviously the Adapter throws an error saying the Password is wrong.

My motto is to send an alert mail to External ID with the details of the Error occurred in the XI and the name of the file for which this error occurred.

As the Container Variable are limited in the Alert Category, how can I catch the file name for which the error occurred.

Could some throw light on it.

Thanks

Azias

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

You can use this link to see How to raise Alerts with variables from the messages payload XI:

/people/michal.krawczyk2/blog/2005/03/13/alerts-with-variables-from-the-messages-payload-xi--updated

.

USE THE FOLLOWING UDF TO GET THE VALUE OF THE SOURCE FILENAME AND STORE THE VALUE OF THIS SOURCE FILENAME IN AN EXPORT PARAMETER NAMED "exportParam" declared under the Signature tab of message mapping:

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

String ourSourceFileName = conf.get(key);

GlobalContainer gc = container.getGlobalContainer();

OutputParameters params= gc.getOutputParameters();

if(params.exists("exportParam") == true)

{

params.setString("exportParam", ourSourceFileName);

}

return ourSourceFileName;

}

Then use the value of this export parameter exportParam to raise an alert in BPM control step where you can easily use the value of this parameter in the short or long text of alert.

For this, you need to create a container variable in BPM of category SimpleType and Type as xsd:string with some name say "param".

Then in the alert text, you can make use of this parameter as &param& to get its value in alert short or long text.

Thanks

Biswajit

Edited by: 007biswa on Feb 12, 2011 11:07 AM

Former Member
0 Kudos

Hi Azias

You need to use BPM with Alert Management.

*) While creating the Alert Category select the option, Dynamic Text.

In case you are not sending the File Name in payload then you need to select the Adapter Specific Attributes in Sender File Adapter & use following in message mapping UDF to get the file name-->

<i>DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");</i>

Using this you can store the FileName in one of the parameter.

*) Now assign this parameter to the container variable of type String in BPM using container operation.

*) During Exception Handling in BPM, you can call the Alert & in Alert Message provide this

<b>Alert Message :: &FleName& is not processed</b>

considering FleName as container variable above

- Lalit -

bhavesh_kantilal
Active Contributor
0 Kudos

One option would be to overwite one of the runtime variables with the filename in the mapping so that the the alert will then use this as the value of the variable when sending the alert.

But, you will have to consider the fact that you are over writing the runtimke variable which is not recommended.

Regards

Bhavesh

Former Member
0 Kudos

Hello Bhavesh,

I would like to overwrite the runtime value of "SXMS_ERROR_CAT" with some other value in mapping.

How can i do this? could you please let me know

I just want to pass the exception message that is raised in mapping to this container variable. so that i can send the alert mail with correct exception message that is populated.

Regards

bhavesh_kantilal
Active Contributor
0 Kudos

You cannot do this with Alerts without BPM.

The alerts from the alert framework can only use the container variables in the help.sap.

Regards

Bhavesh

PS: You have opened an earlier thread with the issue of alerts and emails. Please do update the thread on the issues faced / or close the thread by awarding points.