cancel
Showing results for 
Search instead for 
Did you mean: 

send smartform document via email to specified address

Former Member
0 Kudos

Hi,

I am working on smartforms and have the following requirement:

The generated document needs to be printed out respectively has to be sent via email.

I defined 2 actions (based on <Smart Forms Mail> and <Smart Forms Print>) which refer to the processing class ZCRM_CL_DOC_PROC_CRM_ORDER (derived from CL_DOC_PROCESSING_CRM_ORDER) and processing method

CRM_SRVORDER_EXEC_SMART_FORM which I adjusted in the class mentioned above.

Printing is working fine but for sending via email there is the requirement that the recipient has to be calculated (within the smartforms coding).

I can see that you can maintain a fixed email address within the action condition settings.

Starting the evaluation of the document is done within class CL_SF_MAIL_PPF (method EXECUTE) which also handles the fixed email address and finally fires the method CRM_SRVORDER_EXEC_SMART_FORM. But I cannot see any way to hand over the calculated email address to this class.

Thanks for any advise how to solve this issue!

Regards,

Wolfhard

Accepted Solutions (0)

Answers (2)

Answers (2)

Sm1tje
Active Contributor
0 Kudos

If you determine this email address within the smartform itself, you should define an export parameter in your function module with this email address. Next retrieve data of smartform by calling this smartform function module and add this as attachment to your mail.

I have used the BCS (business communication services) classes and methods for doing so like CL_BCS. There is a nice blog on how to use this class on SCN (believe is was written by Thomas Jung).

Former Member
0 Kudos

Hi,

I don't want to develop this from the scratch but want to reuse some standard mechanism with some minor enhancements.

As I mentioned I tried it with class CL_DOC_PROCESSING_CRM_ORDER and method CRM_SRVORDER_EXEC_SMART_FORM which is working for a particular partner function which is defined in the action settings.

But in my case I need to perform some checks with different partners i.e. there is a small calculation necessary.

I also tried it with action type "External Communication" and an enhancement of BAdI DOC_PERSONALIZE_BCS but also here I cannot find any place to pass the external mail address/fax number to the process.

Regards,

Wolfhard

Former Member
0 Kudos

Closed.

I used another additional partner function which is used (only) for the action determination.

Former Member
0 Kudos

HI,

I didnt understand ur query.If you are facing E mail issue please use this FM for Email It works fine,

SO_NEW_DOCUMENT_ATT_SEND_API1

Regards