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: 

Problem with send mail

Former Member
0 Kudos

Hi,

i want to send email when an user modify informations in HR infotype so i put some code into PAI, i've created a module send_mail, and his this last i put a FM 'Z_HR_SEND_MAIL_PROCESS'.

The function 'Z_HR_SEND_MAIL_PROCESS' work fine, i receive my email correctly. Nice.

Now when FM 'Z_HR_SEND_MAIL_PROCESS' is call by my PAI, i don't receive email, debug is correct, no dump, no error, parameters are correct...

I don't undertand.

Thanks for help.

Regards.

Message was edited by: tafkap

Message was edited by: tafkap

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

Insert the code

<b> submit rsconn01 with mode = 'INT'

with output = 'X'

and return.</b>

after the call to the fm becomes succesful.

Regards,

Ravi

11 REPLIES 11

Former Member
0 Kudos

hi,

please see to it that u commit the work.

after sending mail write.

commit work.

Mark helpfull answers

Regards

0 Kudos

Hi,

put an explicit commit work after function module and see.

rgds,

latheesh

former_member181962
Active Contributor
0 Kudos

Hi Tafkap,

How do you know that the fm 'Z_HR_SEND_MAIL_PROCESS' is working fine? Did you run it in se37?

May be your code is not populating all the required parameters to the FM.

INside the 'Z_HR_SEND_MAIL_PROCESS' function, it should be calling a standard sap fm.

May be it is failing at that stage and you are not able to capture the sy-subrc for such errors.

Regards,

Ravi

former_member188685
Active Contributor
0 Kudos

Hi,

check in <b>SCOT</b> transaction , there might be some pending mails in Queue. so Try to send it from there manually using <b>Start Send Process or CTRL+F7</b> .

Regards

vijay

former_member181962
Active Contributor
0 Kudos

Insert the code

<b> submit rsconn01 with mode = 'INT'

with output = 'X'

and return.</b>

after the call to the fm becomes succesful.

Regards,

Ravi

0 Kudos

Thanks for answer.

In fact, i use FM send mail from /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface

It's work fine and at the end of FM we can find :

  • Send document

CALL METHOD send_request->send( ).

COMMIT WORK.

Yes i test FM Z_HR_SEND_MAIL_PROCESS in SE37, it's work fine. Parameters are good.

When i test FM, email is not send immediately because :

  • send_request->set_send_immediately( 'X' ).

so email is in SCOT, i must Start Send Process.

Thanks

0 Kudos

Try to Reward for helpful answers.

Regards

vijay

0 Kudos

Hi tafkap,

Schedule report RSCONN01 to run regularly, it will take care of mail sending.

Br,

Hannu

0 Kudos

<Try to Reward for helpful answers.

???????????????

0 Kudos

<Try to Reward for helpful answers.

?????????????

0 Kudos