‎2007 May 15 6:28 AM
Hi Experts,
Please help me...
I need to create email through my program(Module-pool program) on click on a push button a internal(external) email should be generate .
How can i do it ?
If you have any program please send me that will become more helpful for me.
Thanks in advance.
Ankur Garg.
‎2007 May 15 6:32 AM
Hi
Hope it can works properly.
This is the sample code I was used previously for the same requirement.
Use as if sy-ucomm = 'button's ok_code'. then
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1' " IN UPDATE TASK "/ .
exporting
document_data = l_doc_chng
put_in_outbox = k_x
tables
packing_list = l_objpack
object_header = l_objhead
contents_bin = l_objbin
contents_txt = l_objtxt
receivers = l_reclist
exceptions
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
others = 99.
if sy-subrc <> 0.
write: / 'unsuccessful', sy-subrc.
else.
concatenate l_mail ',' l_mail1 ',' l_l_mail into l_recipents.
syst-msgid = '8I'.
syst-msgno = '000'.
syst-msgty = 'S'.
syst-msgv1 = text-008.
skip.
syst-msgv2 = text-009.
syst-msgv3 = l_recipents.
clear: syst-msgv4. "syst-msgv2, syst-msgv3,
perform protocol_update.
write: / 'successful'.
endif.
Check in sost tcode whether mail is sending successfully or not?
Regards,
Sreeram Kumar.Madisetty
‎2007 May 15 6:32 AM
Hi
Hope it can works properly.
This is the sample code I was used previously for the same requirement.
Use as if sy-ucomm = 'button's ok_code'. then
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1' " IN UPDATE TASK "/ .
exporting
document_data = l_doc_chng
put_in_outbox = k_x
tables
packing_list = l_objpack
object_header = l_objhead
contents_bin = l_objbin
contents_txt = l_objtxt
receivers = l_reclist
exceptions
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
others = 99.
if sy-subrc <> 0.
write: / 'unsuccessful', sy-subrc.
else.
concatenate l_mail ',' l_mail1 ',' l_l_mail into l_recipents.
syst-msgid = '8I'.
syst-msgno = '000'.
syst-msgty = 'S'.
syst-msgv1 = text-008.
skip.
syst-msgv2 = text-009.
syst-msgv3 = l_recipents.
clear: syst-msgv4. "syst-msgv2, syst-msgv3,
perform protocol_update.
write: / 'successful'.
endif.
Check in sost tcode whether mail is sending successfully or not?
Regards,
Sreeram Kumar.Madisetty
‎2007 May 15 6:42 AM
Hi Ram,
Thanks for this code could you please send me complete code ?
Because there is you create some id's like objectid , textid, message id etc..
How you create? There is some table, internal table use. I hope complete code will more helpful.
Thanks.
Ankur.
‎2007 May 15 6:32 AM