cancel
Showing results for 
Search instead for 
Did you mean: 

Smartform as email to external mail id

Former Member
0 Kudos

Hi all

I have to send a smartform as an email to an external e-mail id. This has to be achieved through Action profile. I have created a Z-class by copying the class CL_DOC_PROCESSING_CRM_ORDER. I have attached my smartform name also to the action.

What code do I have to write to pass the external mail id??

Plz help.

Points will be rewarded generously for useful answers.

Thanks and regards

Debolina

Accepted Solutions (1)

Accepted Solutions (1)

stephenjohannes
Active Contributor
0 Kudos

Debolina,

You can use the function module to create the recipient address. You then need to pass the recipient entry to the mail_recipient parameter of the smartform.

lv_mailaddr is the e-mail or distribution list name

lv_type_id is either 'C' - shared distribution list or 'U' -external e-mail address

ls_recip_id is a single receipient or et_receipient is a table(say from a distribution list)

    CALL FUNCTION 'CREATE_RECIPIENT_OBJ_PPF'
        EXPORTING
          IP_MAILADDR       = lv_mailaddr
          IP_TYPE_ID        = lv_type_id
        IMPORTING
          EP_RECIPIENT_ID   = ls_recip_id
          ET_RECIPIENT      = et_receipient
        EXCEPTIONS
          INVALID_RECIPIENT = 1
          OTHERS            = 2.

Take care,

Stephen

Former Member
0 Kudos

Thanks a lot Stephen

So, after that I can pass the ls_recip_id to the IS_MAIL_RECIPIENT while calling the Smartform, right??

Thanks and regards

Debolina

stephenjohannes
Active Contributor
0 Kudos

Debolina,

If the parameter is of the correct type that is generated by that function module, then I believe so yes. In my system on 620, the generated type is SWOTOBJID.

Good luck,

Stephen

Answers (0)