cancel
Showing results for 
Search instead for 
Did you mean: 

Need to send the logo in smartform via mail.

Former Member
0 Kudos

Hi All,

I have smartform with the company logo uloaded. I have requirement to send the smartform with logo output via mail .

Points will be rewarded....

thanks,

mahantesh

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Can u be more specific

As far as i understand u have a smartform with only logo, u need send this logo via mail

is my undersrtanding correct ?

if so ... sending the logo via mail is same as sending smartfom output via mail u have many FM' s for doing the same

if my understanding is wrong , kindly be more specific

Reward if u find it useful

Sap Surfer

Former Member
0 Kudos

Hi,

Requirement is I have a smrtform with som text & a logo on it. I have taken the output of the smartform in OTF format and sent it using the FM. But text is displayed in mail but logo is not being displayed.

Can you please help me in this problem.

Thanks,

mahantesh.

Edited by: Mahantesh Patil on Feb 21, 2008 6:06 AM

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank u for ur reply...

Former Member
0 Kudos

hi,

1. check if are getting the logo in the print preview, ifso

2. use the following piece of code to send the mail (by converting otf to pdf)

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

*For sending email

DATA:

i_otf type standard table of itcoo ,"OCCURS 0 WITH HEADER LINE,

i_tline type table of tline with header line,

i_receivers type standard table of somlreci1 ,

i_record type table of solisti1 initial size 0 with header line,

  • Objects to send mail.

i_objpack type table of sopcklsti1 initial size 0 with header line,

i_objtxt type table of solisti1 initial size 0 with header line,

i_objbin type table of solisti1 initial size 0 with header line,

i_reclist type table of somlreci1 initial size 0 with header line,

  • Work Area declarations

wa_objhead type soli_tab,

w_ctrlop type ssfctrlop,

w_compop type ssfcompop,

w_return type ssfcrescl,

wa_doc_chng type sodocchgi1,

wa_buffer type string, "To convert from 132 to 255

  • Variables declarations

v_len_in like sood-objlen,

v_lines_txt type i,

v_lines_bin type i.

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

clear v_len_in.

i_otf[] = w_return-otfdata[].

clear v_len_in.

call function 'CONVERT_OTF'

exporting

format = 'PDF'

max_linewidth = 132

importing

bin_filesize = v_len_in

tables

otf = i_otf

lines = i_tline

exceptions

err_max_linewidth = 1

err_format = 2

err_conv_not_possible = 3

others = 4.

if sy-subrc eq 0.

loop at i_tline.

translate i_tline using '~'.

concatenate wa_buffer i_tline into wa_buffer.

endloop.

translate wa_buffer using '~'.

do.

i_record = wa_buffer.

append i_record.

shift wa_buffer left by 255 places.

if wa_buffer is initial.

exit.

endif.

enddo.

  • Attachment

refresh: i_reclist,

i_objtxt,

i_objbin,

i_objpack.

clear wa_objhead.

i_objbin[] = i_record[].

  • Create Message Body Title and Description

i_objtxt = 'PFA are the Service Entry Sheet details.'.

append i_objtxt.

append initial line to i_objtxt.

describe table i_objtxt lines v_lines_txt.

read table i_objtxt index v_lines_txt.

wa_doc_chng-obj_name = 'Service Entry Sheet '.

wa_doc_chng-expiry_dat = sy-datum + 10.

wa_doc_chng-sensitivty = 'F'.

wa_doc_chng-doc_size = v_lines_txt * 255.

concatenate 'Service Entry Sheet' nast-objky(10) into wa_doc_chng-obj_descr separated by space.

  • Main Text

clear i_objpack-transf_bin.

i_objpack-head_start = 1.

i_objpack-head_num = 0.

i_objpack-body_start = 1.

i_objpack-body_num = v_lines_txt.

i_objpack-doc_type = 'RAW'.

append i_objpack.

  • Attachment (pdf-Attachment)

i_objpack-transf_bin = 'X'.

i_objpack-head_start = 1.

i_objpack-head_num = 0.

i_objpack-body_start = 1.

describe table i_objbin lines v_lines_bin.

read table i_objbin index v_lines_bin.

i_objpack-doc_size = v_lines_bin * 255 .

i_objpack-body_num = v_lines_bin.

i_objpack-doc_type = 'PDF'.

i_objpack-obj_name = 'smart'.

i_objpack-obj_descr = 'Service Entry Sheet '.

append i_objpack.

  • Get email id .

clear i_reclist.

i_reclist-receiver = 'arun.sapsurfer@gmail.com'. "email address

i_reclist-rec_type = 'U'.

append i_reclist.

if i_reclist[] is not initial.

call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'

exporting

document_data = wa_doc_chng

put_in_outbox = 'X'

commit_work = 'X'

tables

packing_list = i_objpack

object_header = wa_objhead

contents_bin = i_objbin

contents_txt = i_objtxt

receivers = i_reclist

exceptions

too_many_receivers = 1

document_not_sent = 2

document_type_not_exist = 3

operation_no_authorization = 4

parameter_error = 5

x_error = 6

enqueue_error = 7

others = 8.

if sy-subrc <> 0.

  • Error When Sending the File

retcode = sy-subrc.

perform protocol_update1 .

endif.

endif.

else.

  • Error When generating the File

retcode = sy-subrc.

"perform protocol_update .

endif.

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

Reward if u find it useful

Regards

Arun T

Former Member
0 Kudos

Hi,

I don't want to send this file as an attachment.

It should be like normal mail.

thanks,

mahantesh

Former Member
0 Kudos

FOR SENDING THE SMARTFORM AS EMAIL USE THE BELOW LINK :

[https://forums.sdn.sap.com/click.jspa?searchID=9026781&messageID=4900505]