‎2010 May 07 1:59 PM
Hello Abapers,
I'm using FM SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail with multiple attachment.
Is it possible to display->
Some text_1
Attachment_1
Some text_2
attachment_2
Can anyone enlighten me?
thanks
‎2010 May 07 2:05 PM
For send multiple Attachments you need to use CL_BCS class
To learn more about it, give a look at example report from BCS_EXAMPLE_1 to BCS_EXAMPLE_5
With FM SO_NEW_DOCUMENT_ATT_SEND_API1 you cannot send more than 1 attachment each time
‎2010 May 07 2:17 PM
Hi,
It is possible to send multiple attachments using SO_NEW_DOCUMENT_ATT_SEND_API1. All files will be in one internal table contents_bin and you need to specify the filelength for and name for each attachment in table packing_list. So the program will know which lines of contents for which file and it is easy to have filelength if you are uploading the files.
LOOP AT gt_attach INTO gs_attach.
* describe table i_objbin lines v_lines_bin .
i_objpack-body_num = gs_attach-count .
PERFORM get_file_ext_name USING gs_attach-path
CHANGING i_objpack.
*Get file extension and name
* SPLIT gs_attach-path AT '.' INTO TABLE LT_SPLIT.
* READ TABLE LT_SPLIT INTO LS_SPLIT INDEX 2.
* TRANSLATE LS_SPLIT TO UPPER CASE.
* i_objpack-doc_type = LS_SPLIT .
i_objpack-obj_name = lv_n .
* i_objpack-obj_descr = gs_attach-docname .
i_objpack-transf_bin = 'X' .
i_objpack-doc_size = gs_attach-filelength .
gv_filelength_all = gv_filelength_all + gs_attach-filelength.
i_objpack-body_start = lv_n.
lv_n = lv_n + gs_attach-count.
IF gv_filelength_all > '5000000'.
APPEND i_objpack TO i_objpack2.
ELSE.
APPEND i_objpack.
ENDIF.
ENDLOOP.Edited by: Gungor Ozcelebi on May 7, 2010 3:17 PM
‎2016 Mar 24 9:54 AM
Hi ,
Can You Explain with full Example For Two separate smartform in single mail
Regards
Saranya
‎2010 May 07 3:14 PM
Hi,
You can use CL_BCS class to send emails with multiple attachments. Below URL of my article has code snippet of how it can be done. Hope it helps.
Cheers,
Ravikiran
‎2010 May 08 6:22 PM
Look at that wiki: [Sending Mails - Home Page|http://wiki.sdn.sap.com/wiki/display/ABAP/SendingMails-HomePage]
Use CL_BCS examples (SO_* function modules are obsolete and complex to make them work if you're not an expert)