In the context of a customer project we recently implemented ERMS in SAP CRM (E-Mail Response Management System – SAP Library) for the handling of inbound customer emails. An nice collection of links to documentation, best practices and OSS notes related to ERMS is available in the blog´ERMS Configuration Guides and Documentation by John Burton.
In the context of our project we faced the challenge, that not all customer emails could directly be routed to the SAP CRM system. Instead, some customer email would arrive e.g. in the private email inboxes of customer agents or general purpose inboxes. Therefore, the requirement was to being able to manually select and forward emails from those inboxes to the CRM system. However, the problem with forwarding of emails is that the information in the email header regarding sender and receiver is changed. Consequently, it is not possible to e.g. send automatic responses to the original sender of the email.
In this blog I’ll share how we solved the scenario mentioned above. In particular the described approach shows what is possible with inbound email handling in
The first thing I did was to ask on twitter if someone ever solved a similar problem. In the cause of this discussion Gregor Wolf gave me the hint that it might be possible to implement something in the inbound email handling to solve our requirement. He also warned me, that it also might be quite difficult. Unfortunately, there is not much documentation available regarding inbound email processing besides the following to articles:
Nevertheless, it is enough information so I could come up with an initial solution approach. The solution approach consists of the following steps:
While the solutions approach looks quite simple it took a significant amount of debugging and trail and error to get it finally working. The code snippet below (also available here: #10770844 – Pastie) shows the implementation of the interface IF_INBOUND_EXIT_BCS( for detailed configuration instructions see the article by Thomas Jung mentioned above):
Lines 34-40 check if the email was sent from one of the defined email inboxes. If yes, lines 42-49 check if there is an email MIME object attached to the inbound email. If one is found it is converted into a new inbound send request (lines 50-58), the new inbound send request is processed (lines 65 and 66) and the original inbound request is terminated (line 68). If anything goes wrong, the system simply continues with the standard inbound processing (line 72 ff).
With this implementation in place the inbound processing in transaction SCOT shows how emails a processed (cf. screenshot below). First a email from c.drumm@… is send to test-crm@…, the CRM inbound mailbox. This email contains an email as an attachment. Therefore, the processing of the initial inbound request is terminated (no internal recipient) and new inbound send request is created. The new inbound send request is created for the original sender christian.dr…@… and the original recipient c.drumm@…
I hope this blog helps anybody trying to implement advances inbound email handling in CRM.
great that you've shared this with the SCN community. For robustness I would do a TRANSLATE TO UPPERCASE for the from address. You never now what external systems send you.
I did a to_lower( ) in line 34. Admittedly not as easy to spot as a TRANSLATE TO UPPERCASE would have been .
Very cool stuff! Thanks for sharing with everyone! I updated my ERMS Configuration Guides and Documentation article with a reference to your post above as well.，自助建站系统哪个好，中国电信物联网，云服务器器，大数据培训哪好，懒懒淘客