2009 Mar 06 6:44 AM
Does function SO_OBJECT_SEND allow to send e-mail with attachment?
Does function SO_DOCUMENT_SEND_API1 allow to send e-mail in HTML format?
2009 Mar 06 7:54 AM
Hi S.S,
yes you can use both of them because SO_DOCUMENT_SEND_API1 used function SO_OBJECT_SEND internally.
but I would recommend you to use CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = your document data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = your packing list
object_header = your email header
contents_hex = your attachment
contents_txt = contents
receivers = email receiver
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc EQ 0.
MESSAGE
ENDIF.
this fm allows you send any type of attachment.
hope this helps. cheers
You can use BCS class also for this purpose.
Regards
Sathar
2009 Mar 06 6:47 AM
2009 Mar 06 6:48 AM
2009 Mar 06 6:48 AM
2009 Mar 06 6:49 AM
2009 Mar 06 6:50 AM
hi,
the Output is relied on the SCOT tcode settings.
where, you define the type of output to be sent.
2009 Mar 06 6:51 AM
Hi SS
Use
SO_DOCUMENT_SEND_API1Check Advance Search https://www.sdn.sap.com/irj/scn/advancedsearch?cat=sdn_all&query=so_document_send_api1&adv=false&sor...
Regards
Sachin
2009 Mar 06 6:57 AM
I am using SO_OBJECT_SEND yet.
How send e-mail with attachments with this function?
There is tables ATT_CONT and ATT_HEAD, how to fill this tables to create attachment?
2009 Mar 06 6:59 AM
Hi ,
This function module will help you in attaching the file in the prescribed format.
1. SO_NEW_DOCUMENT_ATT_SEND_API1.
Good luck,
Varghese.K.Oommen
2009 Mar 06 7:37 AM
Hi,
Kindly go through this link,
Here i have sended 2 attachments to mail id in xls format ,you can change
it to html likewise and rest sample code can be used :
Hope it helps
Regrds
Mansi
2009 Mar 06 7:39 AM
Yes, but i want to send e-mail with attachnment by SO_OBJECT_SEND.
2009 Mar 06 7:54 AM
Hi S.S,
yes you can use both of them because SO_DOCUMENT_SEND_API1 used function SO_OBJECT_SEND internally.
but I would recommend you to use CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = your document data
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = your packing list
object_header = your email header
contents_hex = your attachment
contents_txt = contents
receivers = email receiver
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF sy-subrc EQ 0.
MESSAGE
ENDIF.
this fm allows you send any type of attachment.
hope this helps. cheers
2009 Mar 06 8:30 AM
2009 Mar 06 9:07 AM
Bu how to send email by 'SO_NEW_DOCUMENT_ATT_SEND_API1' in HTML format?
2009 Mar 06 9:34 AM
Hi SS
See if you can understand this sample program
PARAMETERS: po_email TYPE AD_SMTPADR LOWER CASE.
DATA: li_objcont TYPE STANDARD TABLE OF solisti1,
li_reclist TYPE STANDARD TABLE OF somlreci1,
li_objpack TYPE STANDARD TABLE OF sopcklsti1,
li_objhead TYPE STANDARD TABLE OF solisti1,
li_content TYPE STANDARD TABLE OF solisti1,
lwa_objcont TYPE solisti1,
lwa_reclist TYPE somlreci1,
lwa_objpack TYPE sopcklsti1,
lwa_objhead TYPE solisti1,
lwa_content TYPE solisti1,
lwa_doc TYPE sodocchgi1,
l_lines TYPE i.
REFRESH: li_objcont[], li_reclist[],
li_objpack[], li_objhead[],
li_content[].
CLEAR: lwa_objcont, lwa_reclist,
lwa_objpack, lwa_objhead,
lwa_content, lwa_doc.
MOVE '<body>' TO lwa_objcont.
APPEND lwa_objcont TO li_objcont.
MOVE '<p>' TO lwa_objcont.
APPEND lwa_objcont TO li_objcont.
MOVE 'This is a sample HTML content from test program' TO lwa_objcont.
APPEND lwa_objcont TO li_objcont.
MOVE '</p>' TO lwa_objcont.
APPEND lwa_objcont TO li_objcont.
MOVE '</body>' TO lwa_objcont.
APPEND lwa_objcont TO li_objcont.
lwa_reclist-receiver = po_email.
lwa_reclist-rec_type = 'U'.
APPEND lwa_reclist TO li_reclist.
lwa_objhead = 'test.htm'.
APPEND lwa_objhead TO li_objhead.
lwa_content = 'Please find attached document for more details'.
APPEND lwa_content TO li_content.
CLEAR l_lines.
DESCRIBE TABLE li_content LINES l_lines.
READ TABLE li_content INTO lwa_content INDEX l_lines.
lwa_doc-doc_size = ( l_lines - 1 ) * 255 + STRLEN( lwa_content ).
lwa_doc-obj_langu = 'E'.
lwa_doc-obj_name = 'Test HTML file'.
lwa_doc-obj_descr = 'Test HTML file'.
CLEAR lwa_objpack-transf_bin.
lwa_objpack-head_start = 1.
lwa_objpack-head_num = 0.
lwa_objpack-body_start = 1.
lwa_objpack-body_num = l_lines.
lwa_objpack-doc_type = 'RAW'.
APPEND lwa_objpack TO li_objpack.
CLEAR: lwa_objpack, l_lines.
DESCRIBE TABLE li_objcont LINES l_lines.
READ TABLE li_objcont INTO lwa_objcont INDEX l_lines.
lwa_objpack-doc_size = ( l_lines - 1 ) * 255 + STRLEN( lwa_objcont ).
lwa_objpack-transf_bin = 'X'.
lwa_objpack-head_start = 1.
lwa_objpack-head_num = 0.
lwa_objpack-body_start = 1.
lwa_objpack-body_num = l_lines.
lwa_objpack-doc_type = 'HTM' .
lwa_objpack-obj_name = 'Test HTML file'.
lwa_objpack-obj_descr = 'Test HTML file'.
APPEND lwa_objpack TO li_objpack.
*Sending the mail
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = lwa_doc
put_in_outbox = 'X'
TABLES
packing_list = li_objpack
object_header = li_objhead
contents_bin = li_objcont
contents_txt = li_content
receivers = li_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
OTHERS = 99.
IF sy-subrc NE 0.
WRITE:/ 'Document sending failed'.
ELSE.
WRITE:/ 'Document successfully sent'.
COMMIT WORK.
ENDIF.
This should give you all you need to know to send an HTML file.
Thanks buddy
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |