Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Internal & external email

Former Member
0 Likes
448

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.

1 ACCEPTED SOLUTION
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
424

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

3 REPLIES 3
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
425

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

Read only

0 Likes
424

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.

Read only

Former Member
0 Likes
424

Hi,

refer

Hope this solves your purpose.

Award points if it helps.

-Gaurang