‎2009 Dec 06 3:14 PM
Hi,
I'm tested the below sample code to test the email sending functionality with the attachments and email body contents. It was working fine in system version 4.6C by called FM: SO_DOCUMENT_SEND_API1.
However, I did the same test to system with version SAP NetWeaver 2004s, the attachment file name is get missing and cant displayed. As the results, its only displayed as .XLS without the filename. Can anyone please advise if there any wrong with it?
Sample code for testing
refer to internet:
‎2009 Dec 07 4:44 AM
Hi Blue,
Use FM: SO_NEW_DOCUMENT_ATT_SEND_API1 for attachment sending.
check using this.
Regards,
Tutun
‎2009 Dec 07 5:07 AM
Hi,
For sending attachments you can try using function module:
SO_NEW_DOCUMENT_ATT_SEND_API1 ,
in this FM you can create packing list internal table like:
data:objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE.
Hope it helps
Regards
Mansi
‎2009 Dec 07 2:28 PM
Hi,
Use the following FM:
DATA: i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objpack TYPE sopcklsti1 OCCURS 0 WITH HEADER LINE,
i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
i_objhead TYPE solisti1 OCCURS 0 WITH HEADER LINE,
i_otfin TYPE soli_tab,
i_receivers TYPE somlreci1 OCCURS 0 WITH HEADER LINE,
i_mail_data TYPE sodocchgi1 OCCURS 0 WITH HEADER LINE,
i_objtxt TYPE solisti1 OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = i_mail_data
put_in_outbox = c_x
TABLES
packing_list = i_objpack[]
object_header = i_objhead[]
contents_bin = i_objbin[]
contents_txt = i_objtxt[]
receivers = i_receivers[]
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.
‎2014 Oct 09 5:37 AM
Hi Blue Sky,
I am facing the exact same problem.
How did u solve the problem ?
Thanks,
Vishal
‎2014 Oct 09 7:39 AM
Hi Blue,
Please use the class CL_BCS for sending emails.
Regards,
FB