cancel
Showing results for 
Search instead for 
Did you mean: 

The body in SAP Smart Forms email message

Former Member
0 Kudos

Hi Experts,

i have a requirement, in smart forms, we did the form to be sent to the email as pdf. we want to add some text in the body of the emil message. can we do this?

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi,

I need to add A WebLink in the body of the mail.

Any help will be great.

thanks

Former Member
0 Kudos

hi,

jst add teh link to the gs_txt structure and append the structure as shown below.

Former Member
0 Kudos

Thanks all for the replay,

i am using the structure SSFCOMPOP (SAP Smart Forms: Smart Composer (transfer) options) to send the email to the recpient. this structure has a field called TDTITLE to set the title in the Email if i set the output device TDDEST as 'EM-R' or EMAIL-REPORT. The qestion is 'Can I add some text in the body of the email that will be sent?'

Former Member
0 Kudos

the gs_txt will hold the body of the mail ....

and coming to the mail the code i had given will help u define the mail subject and body only..............

Former Member
0 Kudos

Hi

Thanks for the replay,

i want to add some fixed text in the email (the body not the subject of the email)

Thanks,

Former Member
0 Kudos

the following is the code for send the mail with both subject and body .plz go thru. hope it will be helpful.

************************************************

  • Creating the document to be sent with success message.

IF gt_error IS INITIAL.

gs_doc_chng-obj_name = 'Standard Price'(010).

gs_doc_chng-obj_descr = 'Material Standard Price update Successful'(011)

.

gs_objtxt = 'Materials updated Sucessfully with new Standard Price'(012)

.

APPEND gs_objtxt TO gt_objtxt.

LOOP AT gt_success INTO gs_success.

gs_objtxt = gs_success.

APPEND gs_objtxt TO gt_objtxt.

ENDLOOP.

ELSE.

  • Creating the document to be sent with error message.

gs_doc_chng-obj_name = 'Error Price'(002).

gs_doc_chng-obj_descr = 'Material Standard Price Updation Errors'(003)

.

gs_objtxt = 'The following Material Numbers failed to update'(004).

APPEND gs_objtxt TO gt_objtxt.

LOOP AT gt_error INTO gs_error.

gs_objtxt = gs_error.

APPEND gs_objtxt TO gt_objtxt.

ENDLOOP.

IF gt_success IS NOT INITIAL.

gs_objtxt = 'Materials updated Sucessfully with New Standard Price'(012)

.

APPEND gs_objtxt TO gt_objtxt.

LOOP AT gt_success INTO gs_success.

gs_objtxt = gs_success.

APPEND gs_objtxt TO gt_objtxt.

ENDLOOP.

ENDIF.

ENDIF.

DESCRIBE TABLE gt_objtxt LINES gv_tab_lines.

READ TABLE gt_objtxt INTO gs_objtxt INDEX gv_tab_lines.

gs_doc_chng-doc_size = ( gv_tab_lines - 1 ) * 255 + STRLEN( gs_objtxt )

.

  • Creating the entry for the compressed document

CLEAR gs_objpack-transf_bin.

gs_objpack-head_start = 1.

gs_objpack-head_num = 0.

gs_objpack-body_start = 1.

gs_objpack-body_num = gv_tab_lines.

gs_objpack-doc_type = 'RAW'.

APPEND gs_objpack TO gt_objpack.

  • Entering names in the distribution list

IF p_plist IS NOT INITIAL.

gs_reclist-receiver = p_plist.

gs_reclist-rec_type = gc_c.

APPEND gs_reclist TO gt_reclist.

CLEAR gs_reclist.

ENDIF.

  • Populating the reciever list

gs_reclist-receiver = p_plist.

gs_reclist-rec_type = gc_u.

APPEND gs_reclist TO gt_reclist.

  • Sending the document

CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'

EXPORTING

document_data = gs_doc_chng

put_in_outbox = gc_x

commit_work = gc_x

TABLES

packing_list = gt_objpack

object_header = gt_objhead

contents_bin = gt_objbin

contents_txt = gt_objtxt

receivers = gt_reclist

EXCEPTIONS

too_many_receivers = 1

document_not_sent = 2

operation_no_authorization = 4

OTHERS = 99.

CASE sy-subrc.

WHEN 0.

WRITE: 'eMail sent successfully'(005).

WHEN OTHERS.

WRITE: / 'eMail could not be sent'(008).

ENDCASE.

ENDFORM. " send_log_mail

Former Member
0 Kudos

tel me the correct requirement do u want to add the data in the form r email