cancel
Showing results for 
Search instead for 
Did you mean: 

How to send mapping trace info through e-mail using Alerts

Former Member
0 Kudos

Hi All,

We are designing a scenario where the requirement is that we have to send the entire 'mapping trace info' through email if the particular mapping program fails.

We are calling the RFC '<b>SALERT_CREATE</b>' to invoke the alert category through a user-defined java function in our mapping program.

here we are able to see other runtime constants such as

String Constant Key

MESSAGE_CLASS MessageClass

PROCESSING_MODE ProcessingMode

MESSAGE_ID MessageId

TIME_SENT TimeSent

Now when we try to access and send the String Constant '<b> MAPPING_TRACE </b>', it does not show anything.

The sample code that we are using is:

<i>String headerField;

java.util.Map map;

// get runtime constant map

map = container.getTransformationParameters();

// get value of header field by using variable key

headerField = (String) map.get(key); </i>

We have read many blogs, forum topics and help available at help.sap.com and came to a conclusion that the string constant 'MAPPING_TRACE' is used to write some more info in the trace, while we want to read the Mapping Trace.

Any genuine help is solicited.

Regards,

Varun

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Varun,

If you want you can do it without a BPM

and throw an exception in case any of the values is missing:

have a look at this weblog on how to throw exceptions

in a nice way:

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

Also just go through <a href="/people/sap.user72/blog/2005/02/23/raising-exceptions-in-sap-xi-mapping Exceptions in SAP XI Mapping</a> and see if it helps you solve the problem.

Also go through these links:

http://help.sap.com/saphelp_nw04/helpdata/en/dc/6b7f2243d711d1893e0000e8323c4f/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/68/253239bd1fa74ee10000000a114084/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/cf/f2bbc8142c11d3b93a0000e8353423/frameset.htm

http://help.sap.com/saphelp_nw04/helpdata/en/5d/2166e6a91d11d188de0000e8216438/content.htm

http://help.sap.com/saphelp_nw04/helpdata/en/05/bb223905b61b0ae10000000a11402f/content.htm

For a Simple case with BPM refer:

http://help.sap.com/saphelp_nw2004s/helpdata/en/33/4a773f12f14a18e10000000a114084/frameset.htm

To send an EMAIL, assign an EMAIL ID to the corresponding user in the transaction SU01 and then set up SCOT and you can send emails when the ALERT is triggered..

Once you have configure Alerts, you will get the Alerts into ALERT INBOX in RWB of the user. To also get the email, the following needs to be done,

1. In SU01 -- Assign the Email ID for the Recipient of the ALERT.

2. In , RWB>ALERT INBOX> PERSONALIZATION--> Time Independent Delivery and Email are selected.

3. Finally, SCOT needs to be set up to send Emails. Check this for the same. You can ask your BASIS team to do this step.

http://help.sap.com/saphelp_nw04/helpdata/en/23/1edf098ea211d2b47300609419ed29/frameset.htm

Also, In ALRTCATDEF, go to SETTINGS--> CONFIGURATION. By default, the option selected is INTERNAL PROCESSING. Select the option SMTP FORWARDING AS XML and give the email id. This will enable you to send an email alert whenever an error occurs in XI.

I hope it helps.....

Regards,

Abhy

Former Member
0 Kudos

Hi,

If your requirement is to send e-mail wenever your MM goes into error theny u can dot he same using ALERT confgiuration and send mail from Alerts.

You can capture the follwoing details of the error.

http://help.sap.com/saphelp_nw04/helpdata/en/d0/d4b54020c6792ae10000000a155106/content.htm

Hope this helps.

regards

Vijaya

bhavesh_kantilal
Active Contributor
0 Kudos

Varun,

Did you have a look at my blog,

/people/bhavesh.kantilal/blog/2006/07/25/triggering-xi-alerts-from-a-user-defined-function

Meanhwile, I dont think it is going to be possible to read a TRACE object. You can add trace warning , info etc which will be used to add log statements , but reading log statements that have already been wrtiten would not be possible.

Anyways, using the ALERTCREATE, FM, you can pass any Dynamic Value to the container element you have defined in ALRTCATDEF and this can be seen in the Alert inbox.

Ofcourse, if your mapping goes into error , you can actaully create Alert rules and capture the Alert.

Regards,

Bhavesh