I have configured Extended Notifications for workflow (SWNCONFIG etc), which works just fine. I am using my own BSP for the email layout and have used custom classes to replace some of the standard handlers. So far so good.
There is a new requirement to include a PDF document as an attachment in the notification email. As far as I can see from analysing the various parameters and methods available to me, there is no way to do this. The only attachment-related functionality is related to the SAP attachment to execute a workitem etc. This is not what I need.
I can see 2 promising parameters in the settings for the subscription (SHOW_DOCUMENTS_AS & SHOW_OBJECTS_AS), but these don't seem to do much and are not mentioned in the help.
Does anybody know if this is possible and, if so, how to do it.
Thanks & Regards
I was hoping that someone would post this as a new issue at some point in the future,so that I could jumpin with the answer and improve my miserable tally of 2 points. Oh well..
It doesn't seem possible to add an attachment to the notification object itself. At least I couldn't find the way in.
Instead, I focused my attention on the final part of the process, namely the deliverer.
If you look right at the bottom in SWNCONFIG, you can either define your own delivery types or, if you are happy to make a change for all notifications of a given delivery type, simply modify the SAP delivery type to reference your own handler class.
I wanted to keep the standard type EMAIL_HTML, so made a copy.
The standard handler class at this level is CL_SWN_DELIVERER_BCS, which already has functionality to add the SAP standard attachments. I created my own subclass of this and redefined the IF_SWN_DELIVERER~SEND method (you could also simply redefine the ADD_ATTACHMENTS method) to call my new attachment-creating method. Simple.
Note: Be careful if you create your own new HTML delivery type as I did, you will also have to make changes wherever (for example) the constant swn1_deltype_email_html is used, since there are a couple of places in other methods, where the delivery type is explicitly checked, to work out whether SAP should send a HTML email or not. Otherwise you will only get plain text coming out. This will involve redefining some of the standard handler classes for other areas in SWNCONFIG.
Hope this helps,
Thanks! The satisfaction of helping unknown legions of future readers far outweighs any worthless points that may be gathered. If you want some easy points just answer some of the often very basic questions asked here.
I really can't imagine why anyone would want to send attachments with Extended Notifications but that doesn't stop "the business" from asking for it!
FYI - in my case, "the business" wanted a PDF image of an invoice (from the archive) attached to the email.
Its part of an offline invoice approval solution. They will have the choice to approve via email (no log in), or execute the workitem via a link (log in).
Since they have extended notifications already in place, I wanted to achieve this without writing something from scratch.
I agree in principle with how one can “harvest” points if one has the time, but for some reason you don’t always get credited as helpful, or even as the right answer, when you tell people to press F1 and read the online help - or even search for previous answers to the same question. Odd, isn’t it?
Message was edited by: Kjetil Kilhavn:
Currently being moderated? That is both a sad and a good thing. Sad that one has to resort to moderation, and good that the questions to which answers are found in the online help or Frequently Answered Questions are now (hopefully in most cases at least) rejected by moderators.