‎2008 Feb 06 3:46 PM
hi gurus i work in 4.7,
hi use transaction: ME22N and i need to send via e-mail attach file in Object Service.
I look for table SRGBTBREL and FM SO_DOCUMENT_READ_API1
but i dont know the correct way to send e-mail.
Please help me.
‎2008 Feb 06 4:01 PM
Hi,
Check this
i_object-typeid = 'BUS2012'. " I think object name is BUS2012
i_object-catid = 'BO'.
i_object-instid = v_docno. " PO document Number
refresh : i_brel, i_link.
* Get Attachment List
append 'ATTA' to i_brel.
if not i_brel is initial.
select *
from srgbtbrel
appending corresponding fields of table i_link
for all entries in i_brel
where
instid_a eq i_object-instid and
typeid_a eq i_object-typeid and
catid_a eq i_object-catid and
reltype eq i_brel-reltype.
endif.
wa_filter-send_info = 'X'.
wa_filter-no_content = 'X'.
loop at i_link into ls_link.
clear : wa_doc_data.
wa_fol_cont-doc_id = ls_link-instid_b.
call function 'SO_DOCUMENT_READ_API1'
exporting
document_id = wa_fol_cont-doc_id
filter = wa_filter
importing
document_data = wa_doc_data
tables
object_header = obj_head
object_content = obj_cont
object_para = obj_para
object_parb = obj_parb
attachment_list = obj_attl
receiver_list = obj_recs
exceptions
document_id_not_exist = 1
operation_no_authorization = 2
others = 3.
if sy-subrc eq 0 and not wa_doc_data is initial.
" <<<<< Call here fm SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail using OBJ_CONT table
" that comes from SO_DOCUMENT_READ_API1
endif.
endloop.
a®
‎2008 Feb 06 4:26 PM
‎2008 Feb 06 4:33 PM
Here it is
data: gos_attachment type ref to cl_gos_attachment_query,
i_object type sibflporb.
data: i_brel type table of t_brel,
ls_stat type sgs_s_acnt,
ls_link type obl_s_link,
i_link type obl_t_link.
data: wa_filter like sofilteri1.
data: wa_doc_data like sofolenti1.
data: wa_fol_cont like sofolenti1 occurs 20 with header line.
a®
‎2008 Feb 06 5:24 PM
can i help me with the fm SO_NEW_DOCUMENT_ATT_SEND_API1??
thaks.
‎2008 Feb 06 5:30 PM
Please search in this forum you can tons of examples for SO_NEW_DOCUMENT_ATT_SEND_API1
a®