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: 

Trigger email after saving details in VA01.

Former Member
0 Kudos

hi,

can anyone please tell me how we can trigger an email

right after the details are put in the VA01 and saved??

All the values input should be sent in throught the mail.

Kindly help...point will be awarded to the most appropriate

replies.

1 ACCEPTED SOLUTION

naimesh_patel
Active Contributor
0 Kudos

I don't think we have any exit in VA01 which can be triggered after the VA01 save.

But you can use the USEREXIT_SAVE_DOCUMENT in the program MV45AFZZ to have your funcationality. To change this program you need to have the access key for that.

This User exit triggers just before saving. SO, many be you can use it.

Inside the USEREXIT_SAVE_DOCUMENT you can access workarea VBAK, and tables XVBAP, XVBEP for the transactional data for that SO.

Regards,

Naimesh Patel

10 REPLIES 10

naimesh_patel
Active Contributor
0 Kudos

I don't think we have any exit in VA01 which can be triggered after the VA01 save.

But you can use the USEREXIT_SAVE_DOCUMENT in the program MV45AFZZ to have your funcationality. To change this program you need to have the access key for that.

This User exit triggers just before saving. SO, many be you can use it.

Inside the USEREXIT_SAVE_DOCUMENT you can access workarea VBAK, and tables XVBAP, XVBEP for the transactional data for that SO.

Regards,

Naimesh Patel

former_member589029
Active Contributor
0 Kudos

You can use userexit USEREXIT_SAVE_DOCUMENT in include 'MV45AFZZ'. In there you have all the internal tables from VA01 available (e.g. VBAK, XVBAP, XVBEP, etc.) to collect the data from.

Then call function 'SO_NEW_DOCUMENT_SEND_API1' to send the email.

Regards,

Michael

Former Member
0 Kudos

You could use USEREXIT_SAVE_DOCUMENT as suggested and create a sub routine that is only called on commit -

PERFORM send_email_details ON COMMIT

That way the email would only be sent if and when the order is actually commited to the DB.

The other thing to check is if there are any change pointers you could use to trigger a process - I don't know if there are off the top of my head so try searching this forum for info in that area.

Gareth.

0 Kudos

hi all,

if i do want to use the user exit USEREXIT_SAVE_DOCUMENT as suggeted by you,

but i dont have the access key..is there any other way out?

0 Kudos

Then go to your basis person and get them to register the change to obtain an access key - this is common practice when changing the user exits in SAPMV45A.

Gareth.

Former Member
0 Kudos

Hi Bumba ,

In this case User-Exit wont help because they are triggerred before saving the document .

If you want to trigger an email after saving the document in VA01 .

You can create a program that will call the transaction VA01.

Normally messages will be returned after calling the transaction ,

You can capture the messages in your program BDCMSGCOLL.

IF BDCMSGCOLL is containing any error messages then we can skip the Email functionality .

Else Email will be generated.

For sending email you can use FM . SO_NEW_DOCUMENT_SEND_API1

0 Kudos

hi manoj,

actually i want the email functionality triggered everytime

an entry is made into the VA01 transaction and saved.In

the solution you have written.if i use my own program,the

email will be triggered only if my program is executed..and

that is not what i actually want.

But i really appreciate the help from your side.

former_member589029
Active Contributor
0 Kudos

This include is intended to be modified. It contains the 'older' user exits from SAP where you still had to make a 'modification' to a standard SAP program. That's why you need the access key to be able to change it.

Regards, Michael

Former Member
0 Kudos

VA01 Extras->output->header->edit

Setup an output message for internet mail.Ask help from an SD consultand

Former Member
0 Kudos

Thanx for the replies.That was a gr8 help!