cancel
Showing results for 
Search instead for 
Did you mean: 

How to track custom mails in sourcing

Former Member
0 Kudos

Hi Experts,

As per our requirement we have implemented the explicitly called script to send mails to the MA/SA collaborators on agreement expire date.

We have not used SAP provided custom mail template for this, we have used send mail function in script.

Mails are going out without an issue, but for our internal tracking purpose we are printing the log message saying that "custom mail sent to"+username.

But it is so difficult for us to check the log messages every day because every time we need to ask our basis team for logs and need lot of approvals for that.

So we are looking for an alternative to track the custom mail sent from explicitly called script.

Please help us, if anyone have an idea on this.

Regards,

Lava

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member190023
Contributor
0 Kudos

Hi Lava,

Both custom & standard emails will be listed in the Processed Messages report:

Bogdan

Former Member
0 Kudos

Hi Bogdan,

Thanks for your quick reply.

But in our case we are not using SAP provided custom templates. We are using mimemessage in our script, so out going mails are not capturing in processed messages.

So we are using logs for tracking purpose.

Please let me know if there is any alternative for this.

Regards,

Lava

former_member190023
Contributor
0 Kudos

Hi Lava,

I actually misread your comment and thought you ARE using built-in custom emails

First of all I need to ask why have you chosen this solution instead of built-in custom emails. There are some alternatives (including a licensed add-on for emails).

Bogdan

Former Member
0 Kudos

Hi Bogdan,

We have chosen this solution because of two reasons.

First one, we tried to send an email using "Custom Template 1" by following the vikram's blog then we are able to send the mails successfully. But here we want to use sender mail id as company email id instead of user mail id. We are not able to set the company email id.

Second one, first one we have tested in our development system , then we moved same script to our UAT system. Then for testing purpose we executed the script but unfortunately we are getting data base error. Please see below screen shots for the same.

If you have any idea on how to set the company email id as sender id and what is the data base error, i request you please help us.

Regards,

Lava

Former Member
0 Kudos

Hello Lava and Bogdan,

For the currently implemented solution here is a round about way I suggest for tracking. I assume that you have at least one Custom Master Data Type or UDO Type free.

1. Rename a Custom Master Data Type or UDO Type to "Mail Tracking" or something similar. This is only to distinguish it from other types.

2. Create an extension collection on this type with 2 fields: "Sent to" and "Date". Take care to use the correct field types

3. Manually create a document of the "Mail Tracking" type we created in Step 1. Name it "Mail Tracker" or something similar. We will use this name later.

This document will have the collection we created in step 2

4. In the Explicitly Called Script, use the respective APIs to find the document (bean) we created in Step 3 using the Name(Step 3) or external ID.

5. Each time you send an email write a new entry to the collection using the same values you are using to send the email.

Thanks

Devesh

PS: I cannot comment on the scalablility of this solution.

former_member190023
Contributor
0 Kudos

Hi Lava,

Always have an Oracle DB expert close by: your error is coming because the system is trying to insert a larger-than-possible VARCHAR2 into the DB.

After decoding the ORA error, then your problem is simple to find:

     Properties props = System.getProperties(); - why?!

You should have:

     Properties props = new Properties();

@Devesh: Solution is interesting, and can be scalable if also implementing a 'cleaning' mechanism, similar to what is there in the core email; but you would be reinventing the wheel.

In any case, I would vote against customising emails; instead implement the mail add-on for Sourcing that solves all possible email issues.

Regards,

Bogdan

Former Member
0 Kudos

Hi Bogdan,

Initially we have used  Properties props = new Properties(); and we were able to send custom mails without any issues.

But when we have used this we were not able to bold text in mail body.

We have used FORMAT("b", "Contract :")%TOKEN2% in our custom mail body. FORMAT was not working with above code. So we have shifted to Properties props =System.getProperties(); then it is working in development system and not working in Test(SIT) system.

If you have any idea on enabling HTML_MAIL property using Properties props = new Properties();, please help us.

Regards,

Lava

Former Member
0 Kudos

Hi Devesh,

Thanks for your valuable time and solution.

I will check on this.

Regards,

Lava

former_member190023
Contributor
0 Kudos

What you are saying is very strange ... System.getProperties() method will return all java VM properties. These should not have any impact on email functionality.

It's most likely that the 'fix' is actually somewhere else... Have you checked all the properties related to HTML email? Both on configuration and on user account settings. Make sure all of them are ON and try again.

If SAP suggested to use the System.getProperties someone should really have a go at them

Do one thing. Get a dump of System.getProperties from both systems (DEV/QA) - just write a simple test script and dump them into the log. Then send them here so we could also have a look, maybe something is actually there that we don't see.


Regards,

Bogdan