Application Development 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: 

Send e-mail on ME21N

marcelom_bovo
Participant
0 Kudos

Hi people,

I have to send a e-mail to the supplier after creating the Purchase Order on me21n.

But I think that I can only do that after the approval of the PO on the workflow.

So, can I use the function to send the e-mail right after save the PO on me21n or I have to wait all the way..?

I don´t know anything about workflow, so that is the problem...

I think I can use the "messages" button and, put0 my e-mail there, so it will be send just after the approval..

what do u think?

tks

17 REPLIES 17

Former Member
0 Kudos

Hi dear Bovo

try use exits ME_PURCHDOC_POSTED

and put your e mail code here

this link will give you a better solution

link:

Edited by: Nelson Rodrigo on Nov 18, 2010 1:35 AM

Former Member
0 Kudos

hi ,

i got this requirement once . i used ME_PROCESS_PO_CUST for sending mail . u can use this.

Regards,

karthikeyan k s.

0 Kudos

Hi karthikeyanks,

But this badi is executed just after the PO is approved on the workflow?

Do you use the post method?

Because, if the process before the approval, the e-mail is not created...

0 Kudos

Hi karthikeyanks,

But this badi is executed just after the PO is approved on the workflow?

Do you use the post method?

Because, if the process before the approval, the e-mail is not created...

Former Member
0 Kudos

Hi Marcelo Marinho Bovo,

PO should be sent only when it gets approved. You can use customer exit MM06E005. Use function exit EXIT_SAPMM06E_013 to write the code to trigger email to the Supplier/Vendor. Function Exit EXIT_SAPMM06E_013 will get triggered just before saving.

To find whether PO got released or not, check field I_EKKO-FRGKE = 'R' , then send the mail.

Thanks & Regards,

Faheem.

0 Kudos

So,

If I put the code in the exit EXIT_SAPMM06E_013, the program will pass trough this step only after the PO is approved.

correct?

What I am also thinking, is that I can create a e-mail message, in the "messages" button, and do the programming on the "form entry".

Do you think it can work out?

tks

0 Kudos

Yes, I don't understand why you would ever use a user exit to send an email from the PO application. Use message determination - that's what it's designed for...

0 Kudos

Tks Brad,

Do you know how can I do That?

I have to send the PO on a PDF file and there is no standard kind of message to do that.

Threre is a sapscript for the message that is used to print the PO, what I have to do is convert the printable version(I already have the function to do that) to a PDF, attach it on the mail and send to vendor...

If you have a document explaining how to use the message determination, it would help.

thanks

0 Kudos

Check the Purchasing section of the IMG (Messages -> Output Control). There is plenty of documentation there (including fast setup tips) or in the help files. The steps have also been outlined on the forums many times - you might find a good post by searching on transaction 'NACE'. For starters, you only need to convert the output if you DO NOT accept the standard process. Using the 'External Send' option and the standard output program for PO's, SAP will automatically convert the OTF to PDF (assuming your SAPConnect SMTP node is configured to do this) and attach it to an email to the vendor address on the vendor master. The subject is configurable as well. If you wish to have a more elaborate/professional email, i.e., HTML-based content, special subject, different recipients, etc., then you need to intervene with a custom output program, either copied from the standard or built from scratch.

0 Kudos

Hi Brad,

Nace was configurated for "external send" the same way as "print output".

I have set SMTP on SCOT and it seens ok.

but when I creat a external "send message" on me22n, I don´t get the e-mail(i´ve put my e-mail on vendors profile).

Do you know any orther reaseon for that?

I´ve put a break point on entry form, but the program don´t stop there(stop only queh I click on preview button).

I have 2 option, set the "external send" or do "print" and use function to send the e-mail. but I do´n´t know wich point I can code...

tks

0 Kudos

Hi

U need to check if your mail is in SCOT, u can do it by transactions SOST.

You have to consider SAP doesn't immediatelly send the mail to external destination, i.e if a mail is sent by any transaction, it will be placed in SCOT.

Then the mail will be really sent as soon as the program RSCONN01 runs

This program is usually scheduled in a periodic job (for example it starts about on every 15 minutes) or it can be called from your transaction

Max

0 Kudos

Thanks very much Max...

Mail was in SOST, meybe it doesn´t run on QAS... because there are a lot of mail in there... so I executed it manually.... and it works...

So, the main process is ok, now comes next step...lol.

Before saving the PO. I need to make a pop-up with 3 choices to user... Send PO trought mail, fax or print...

So, is better I do this code on EXIT_SAPMM06E_013? witch table can I save NEU?

another question is...can i change the receiver mail from vendor to one user typed? how?

tks very much...

0 Kudos

Hi

U need to set your message (for all medium: print, fax and mail) by transaction NACE,

Now the problem is you need to update the NAST in order to set the medium choosen by user, this table is not available in EXIT_SAPMM06E_013 and/or EXIT_SAPMM06E_012.

U can try to insert a popup in a requirement (set in the procedure for PO message)

Max

0 Kudos

Typically, RSCONN01 does not run automatically in a test environment unless you have set the restrictions on the SMTP node to stop sends except to specific addresses or an internal domain. That's why.

As for your other requirements, you can handle those somewhat with the standard approaches by entering the output type and medium at the output screen and with different partner functions. Also, you may want to take a look at communication strategies, which allows you to pre-determine how an output will be sent based on the communication data maintained on the partner.

0 Kudos

Max,

You say to change the the "form entry"?

So, a standard print should be set, and o entry, I change it to another type?

Brad,

I can´t find the web app... on spro..

I´ve read in other threads that is not possible to change the receiver mail(vendor) on message output. junst on vendor master...

Is that right?

0 Kudos

No

If you check the procedure (trx NACE) assigned to PO you can see it's possible to indicate a requirement in order to set if the message has to be created or not.

The requirement can be set by trx VOFM

I believe (but I'm not sure) this routine is called before the user-exit you've indicated

Max

0 Kudos

Hi Max, Brad

I could change NAST on the first custom-function i found.

I used (SAPLV61B)XNAST

Just Added a line into that table and it went right to the NAST table and messages...

Now, I´m going to creat the pop-up in this customer-function, and depending on user decision, I´ll create a mail, fax or print line into the NAST...

One thing I´d like to know is if there is a way to change the mail body, like including a signature...

Can you help me with that?

tks