cancel
Showing results for 
Search instead for 
Did you mean: 

Change sender e-mail in e-mails alerts

Former Member
0 Kudos

Hello,

We are using the e-mail alerts sending by the standard. Now we need to change the the sender to "NOREPLY@xx".

The standard FM used in to send e-mails and alerts is SALRT_CREATE_API. We checked this FM but we couldn't found any way to change the sender.

How can we do this?

Thanks & Regards,
SM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

I think you can maintain the sender email address in SPRO

go to CRM->Marketing->Marketing planning and campaign management->maintain sender addresses for E Mail

Thanks and Regards

Shanto Aloor

Former Member
0 Kudos

Hi,


Thanks for your answer, but I think that the configuration that you suggest is only for emails sended in Marketing context.

In our case we need to change the sender for the emails sent via the Alerts Management.


Tks & regards,
SM

VishnAndr
Active Contributor
0 Kudos

Hello, Susana.

You can configure from which e-mail address alerts are sent defining alert user at: IMG -> CRM -> Basic Functions -> Alert Management -> Central Alert Server Configuration. There is a field User in Inbound Processing section. His e-mail will be used then for sending e-mail notifications out. Otherwise current (system) user which trigger alert sending will be used. Check method SEND in class CL_ALERT_MANAGER.

For instance there is a code in this method (ls_conf-alertuser is from table SALRTCONF which is maintained in above settings):

* set reply_to

*   Get reply_to object

        IF NOT ls_conf-alertuser IS INITIAL.

          lo_reply_to = cl_sapuser_bcs=>create( ls_conf-alertuser ).

*   Add reply_to

          CALL METHOD lo_send_request->set_reply_to

            EXPORTING

              i_reply_to = lo_reply_to.

        ENDIF.

Former Member
0 Kudos

Hi Andrei,

I've made what you suggest and when I checked the method SEND in class CL_ALERT_MANAGER the variable ls_conf-alertuser is filled with the user mantained in the table SALRTCONF.

But the construction of the e-mail sender is made in the following instruction:

*   Get sender object: either alert user (from configuration) or current user
        IF ( sy-uname = 'SAPSYS' OR sy-batch = 'X' ) AND NOT ls_conf-alertuser IS INITIAL."#EC *
          l_uname = ls_conf-alertuser.

But here if I run the program in background the sy-batch variable is allways empty (without X), so the instrution  l_uname = ls_conf-alertuser is never verified.

Any sugestion to this problem?

Tks & Regards,
Susana Morgado

VishnAndr
Active Contributor
0 Kudos

Susana,

could you please explain steps how you run the program in background? Which one?

Former Member
0 Kudos

I've created an Z programa that invoke the FM SALRT_CREATE_API.

For execute the z program in background:

  • T-code SE38
  • menu->program->execute->Backgroud
VishnAndr
Active Contributor
0 Kudos

I've checked the same: at the very beggining of SALRT_CREATE_API sy-batch is filled.

Could you check the same please? And could you please provide a code how do you call the function module?

Former Member
0 Kudos

I've checked, and the very beginning of SALRT_CREATE_API sy-batch is filled.
But when I checked the sy-batch in SEND method of CL_ALERT_MANAGER this is empty.

Z_PROGRAM:
...
  CALL FUNCTION 'ZCRM_MOVIMENTOS_SEND_ALERT'
              EXPORTING
                i_category         = 'ZALERTA_SEGMENT'
                i_bp_id            = wa_but000-partner
*               i_task_id          = wa_orderadm_h-object_id
*               i_task_description = wa_orderadm_h-description
                i_bp_text          = wa_but000-name_org1
                i_bp_seg_mes       = periodo
                i_id_segment       = wa_ztab00003n-zzfld00000r.

...

In attached the FM ZCRM_MOVIMENTOS_SEND_ALERT (the FM SALRT_CREATE_API is called in the end of this).

Thanks for your help.

VishnAndr
Active Contributor
0 Kudos

I'd start from creating a watchpoint on sy-batch. As far as it is filled at the start and is not at the end then something reset it in the middle. So perhaps you'll be able to identify the place using watchpoint.

If I have a chance I'll try myself to do a similar example tomorrow and get back here.

Former Member
0 Kudos

Hello,

Any additional idea for this problem?

Tks

VishnAndr
Active Contributor
0 Kudos

Have you put a watchpoint on sy-batch?

Former Member
0 Kudos

Yes, but it dosen't works.

VishnAndr
Active Contributor
0 Kudos

What do you mean? If you put a watchpoint on sy-batch when it's not initial then you'll find where it becomes initial and therefore don't let you achieve desired result.

Former Member
0 Kudos

Sorry, I haven't explain me correctly.

1 - First I tried to use a breakpoint with the program running in background (though SM50).

 

     I put the breakpoint in method SEND in class CL_ALERT_MANAGER:

     (line 200)

     **Get sender object: either alert user (from configuration) or current user
             IF ( sy-uname = 'SAPSYS' OR sy-batch = 'X' ) AND NOT ls_conf-alertuser IS INITIAL."#EC *
              l_uname = ls_conf-alertuser.

     Here I checked that the sy-batch was initial.

2 - Then I tried to use an watchpoint on sy-batch = ' '

      I ran the program in background but the program doesn't stop when sy-batch is initial.

I can't understand what's going on?

Could you help please?

Thanks for your help and time.

Answers (0)