Skip to Content
0
Former Member
Jul 19, 2007 at 10:02 AM

How to send a predefined email

40 Views

Hello,

I'm trying to send a predefined email which contains the subject and the body text in my bsp/abap application but it doesn't work. <i><b>Does anyone could help me, please?</b></i>

I have this error message :

<b>Exception CX_SY_DYN_CALL_PARAM_MISSING</b>

<b>Method</b> : OninputProcessing

<u>This is my abap source code in my OninputProcessing</u> :

data : adress_mail type AD_SMTPADR.
  adresse_mail = 'MyEmail@myProvider.com'.
  data msg(200) VALUE 'Data stored :'.
  data : subject type SO_OBJ_DES.
  data : subj type SOLI.

      subject = 'New event - Please check'. 

      concatenate msg subj into subject separated by
space.
   

* Add data at the end of the mail
    if not ( strlen( subj ) = 0 ).
      append subj to texttab.
    endif.

* Send email 
    CALL FUNCTION 'Z_YX_SEND_SMTP'
      exporting
        I_SAV_SMTP_RECEIVER  = adress_mail
        I_SAV_SUBJECT        = subject
      
      exceptions
        when others = 1.

    if sy-subrc <> 0.
      error_code = 'SEND-001'.
    endif.

endif.