cancel
Showing results for 
Search instead for 
Did you mean: 

Smart forms - Recipient ID change

Former Member
0 Kudos

Hi Experts,

We are working on smart form which needs to be mailed to few recipients.

I'm aware of the configuration which allows the distribution list to be configured to which the mail can be sent.

But, Is there a way where we can determine and change the recipient with in the smartform dynamically ?

Any suggestions/pointers in this regard will be of great

Thanks in advance.

Kris.

Accepted Solutions (1)

Accepted Solutions (1)

former_member205763
Active Contributor
0 Kudos

Instead of using the standard sap functionality try implementing it with custom coding.

this wiki will guide u i this

http://wiki.sdn.sap.com/wiki/display/Snippets/mailsendthroughoutputcontrols

Former Member
0 Kudos

Hi Kartik,

thats a really helpful link.

But in our case, we have the action Profiles confiigures to send a PDF attachement up on the trigger of an event.

As per my knowledge, the method explained by your link is the way you send a mail when no action profile is configured (Correct me if wrong).

Is there a way where the configured action profile can trigger a mail where in the subject and body of the mail are dynamically generated from within the code?

Thanks in advance.

Kris.

former_member205763
Active Contributor
0 Kudos

>

> Is there a way where the configured action profile can trigger a mail where in the subject and body of the mail are dynamically generated from within the code?

> Thanks in advance.

>

> Kris.

I am not sure if subject or and body of mail can be dynamically configured from code when action profile is triggering the mail.

Thats the reson i sent you the link, if you dont find a way to change the subject or mail dynamically, then you can use the method.

But if you find some other way of achieveing it, then do let me know.

Former Member
0 Kudos

Hi Kartik.

I need your help in identifying the following.

1. While calling the driver program function module, the interface has 3 standard parameters

MAIL_APPL_OBJ

MAIL_RECIPIENT

MAIL_SENDER.

Any idea how these can be used?

Your inputs would be of great help. Points assured.

Thanks in advance,

Kris.

former_member205763
Active Contributor
0 Kudos

Hi,

Points assured

First of all please do not mention this as this is against the forum rules.

now coming to your question

mail_sender and mail_recipient are of type "swotobjid".

They are used when the device type is configured as MAIL, In this case you can specify the mail subject in mail texts section of the output type configured in NACE.

The earlier link that i sent you requires the device type to be 'PRINTER' so if u want to implement that u need to device type as PRINTER so u dont require MAIL_SENDER and MAIL_RECIPIENT, but if u plan to use these parameters give device type as 'MAIL'

and implement following coding.


 DATA: lv_ip_mailaddr TYPE so_name, "Address of a Mail Recipient
            lv_ip_type_id TYPE so_escape, "Recipient type
            ls_recipient_id TYPE swotobjid, "Structure for recvr obj ID 
            ls_sender_id TYPE swotobjid. "Structure for sender obj id

 CONSTANTS: lc_ip_type_id TYPE so_escape VALUE 'U', "For internet address.
 lv_ip_type_id = lc_ip_type_id.

* Create recipient object 
CALL FUNCTION 'CREATE_RECIPIENT_OBJ_PPF'
 EXPORTING ip_mailaddr = lv_ip_mailaddr
                     ip_type_id = lv_ip_type_id
 IMPORTING ep_recipient_id = ls_recipient_id
 EXCEPTIONS invalid_recipient = 1
                       OTHERS = 2.

* Get sender object id
CALL FUNCTION 'CREATE_SENDER_OBJECT_PPF'
 EXPORTING ip_sender = sy-uname
 IMPORTING ep_sender_id = ls_sender_id
 EXCEPTIONS invalid_sender = 1
                      OTHERS = 2.

кu03B1ятu03B9к

Edited by: Kartik Tarla on Oct 3, 2009 10:27 AM

Former Member
0 Kudos

Hi Kartik,

Thats a helpful piece of code.

But I'm using SAP CRM and hence doesn't have the transaction NACE.

Any work around for this?

Thanks in advance,

Kris.

former_member205763
Active Contributor
0 Kudos

In the output_options that u pass to smartforms, u have this field TDTITLE . pass your text to tdtitle and check if its appearing in subject line

former_member205763
Active Contributor
0 Kudos

In the output_options that u pass to smartforms, u have this field TDTITLE . pass your text to tdtitle and check if its appearing in subject line

Former Member
0 Kudos

HI,

I am having the same issue can u pls tell how to solve this just i want to add the subject line once so as per ur suggestion i want to add this line to tdtitle so where i can findout this field so how can i add this is there any need of concatenate the strings so can u pls provide me the solution

Regards

Raju

Former Member
0 Kudos

Perfect. Kartik you solved this.

Addind the line to the TDTITLE can add subject line to the mail.

Regret that I'm prolonging this thread, but is there a way we can pass the body of the mail too?

Also, when I add TDTITLE, the same is the name of the attachement as well. Is there a way we can have a different subject line and different attachement name?

Former Member
0 Kudos

Hi Kris,

I am having the same issue to change the subject line for two cases i want to change the subject so can u pls tell me where can i find the TDTITLE option in out put options pls let me know how can i change the subject dynamically

Regards

Ravi

Answers (0)