Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Regarding Email Attachment

sreeramkumar_madisetty
Active Contributor
0 Likes
313

Hi Folks

I have i pdf file in my desktop and i want to send that pdf file to multiple users.

Can anyone give me any idea or sample code on this.

<b>Points are assured for needful answers.</b>

Regards,

Sreeram

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
294

Hi Ram,

Please try this. Hope it works.

FORM sendmail.

*

doc_chng-obj_name = 'ANGEBOT'.

doc_chng-obj_DESCR = 'Test data file'.

objtxt = 'See attachment'.

append objtxt.

Describe table objtxt lines tab_lines.

Read table objtxt index tab_lines.

Doc_chng-doc_size = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).

clear objpack-transf_bin.

objpack-head_start = 1.

objpack-head_num = 0.

objpack-body_start = 1.

objpack-body_num = tab_lines.

objpack-doc_type = 'RAW'.

append objpack.

loop at i_csv.

append i_csv to objbin.

endloop.

Describe table objbin lines tab_lines.

Objhead = 'aka.csv'. Append objhead.

clear objpack-transf_bin.

objpack-transf_bin = 'X'.

objpack-head_start = 1.

objpack-head_num = 1.

objpack-body_start = 1.

objpack-body_num = tab_lines.

objpack-doc_type = 'TXT'.

*objpack-doc_type = 'CSV'.

objpack-obj_name = 'ANLAGE'.

objpack-obj_descr = 'FILE.CSV'.

objpack-doc_size = tab_lines * 255.

append objpack.

reclist-receiver = p_email.

reclist-rec_type = 'U'.

append reclist.

call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'

exporting

Document_data = doc_chng

put_in_outbox = 'X'

Tables

Packing_list = objpack

object_header = objhead

contents_bin = objbin

contents_txt = objtxt

Receivers = reclist

Exceptions

too_many_receivers = 1

Document_not_sent = 2

Operation_no_authorization = 4

others = 99.

endform.

2 REPLIES 2
Read only

Former Member
0 Likes
295

Hi Ram,

Please try this. Hope it works.

FORM sendmail.

*

doc_chng-obj_name = 'ANGEBOT'.

doc_chng-obj_DESCR = 'Test data file'.

objtxt = 'See attachment'.

append objtxt.

Describe table objtxt lines tab_lines.

Read table objtxt index tab_lines.

Doc_chng-doc_size = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).

clear objpack-transf_bin.

objpack-head_start = 1.

objpack-head_num = 0.

objpack-body_start = 1.

objpack-body_num = tab_lines.

objpack-doc_type = 'RAW'.

append objpack.

loop at i_csv.

append i_csv to objbin.

endloop.

Describe table objbin lines tab_lines.

Objhead = 'aka.csv'. Append objhead.

clear objpack-transf_bin.

objpack-transf_bin = 'X'.

objpack-head_start = 1.

objpack-head_num = 1.

objpack-body_start = 1.

objpack-body_num = tab_lines.

objpack-doc_type = 'TXT'.

*objpack-doc_type = 'CSV'.

objpack-obj_name = 'ANLAGE'.

objpack-obj_descr = 'FILE.CSV'.

objpack-doc_size = tab_lines * 255.

append objpack.

reclist-receiver = p_email.

reclist-rec_type = 'U'.

append reclist.

call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'

exporting

Document_data = doc_chng

put_in_outbox = 'X'

Tables

Packing_list = objpack

object_header = objhead

contents_bin = objbin

contents_txt = objtxt

Receivers = reclist

Exceptions

too_many_receivers = 1

Document_not_sent = 2

Operation_no_authorization = 4

others = 99.

endform.

Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
294

It's answered