Issue in sending a email internet address using 'so_new_document_send_api1'

Hi ,
    I am calling  'SO_NEW_DOCUMENT_SEND_API1' inside an user exit to send an email whenever the notification gets created..If the user exit is called in the same transaction IW21 then the mail is sending successfully.But if the transaction IW21 is called via another transaction say IW31 or IW32 to create a notification,then the mail is not going.instead the mail still in waitning stage in Outbox in SAP business work place.
Note:I should not use commit as 'X in 'SO_NEW_DOCUMENT_SEND_API1' because it is written inside the user exit.
Edited by: Vigneswaran S on Dec 24, 2009 10:17 AM

Hi,
One option is to call the FM using STARTING NEW TASK and then also use commit = 'X'.
Since we are using NEW TASK, it will occur in new task (and will not affect the user exit).
Also the commit will be done INSIDE the new task, and will not affect the current user exit. This will be independent and done paralelly.
Regards,
Amit Mittal.

Similar Messages

  • How to send scripts via email(Internet Address)

    Dear all,
    I want to send scripts/smart forms via email (Internet Address). How can I do that …please advice…?
    If any one has worked on it please send me sample code for the same.
    Thanks in Advance…
    Thanks and Regards:
    M.Manohar

    Hi Manohar,
    Check this Program.
    REPORT zptpfrm202p_pogr_pr_instr MESSAGE-ID zmm.
    TABLES *
    Database table made for getting information about PRINTPREVIEW and
    PRINT command more than one times
    TABLES: zgr_table.
    TYPE-POOLS:syscr.
    GLOBAL TYPE DECLARATION *
    DATA: zdoc_output_info TYPE ssfcrespd, "SF:Return Document Inf.
    zjob_output_info TYPE ssfcrescl, "SF:Return value at end of
    form printing
    i_control TYPE ssfctrlop ,
    i_output_options TYPE ssfcompop,
    zjob_output_opts TYPE ssfcresop. "SF:Return value at start
    of form printing
    *This internal table is used for storing Document Segment: Material
    DATA: BEGIN OF i_mseg.
    INCLUDE STRUCTURE mseg.
    DATA: END OF i_mseg.
    This internal table is used for storing Header: Material Document
    DATA: BEGIN OF i_mkpf.
    INCLUDE STRUCTURE mkpf.
    DATA: END OF i_mkpf.
    *Variables
    DATA flag(1) TYPE c.
    DATA: vfile TYPE string.
    SELECTION-SCREEN *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-000.
    PARAMETERS:p_mblnr TYPE mkpf-mblnr OBLIGATORY MATCHCODE OBJECT zganesh,
    p_mjahr TYPE mkpf-mjahr OBLIGATORY MATCHCODE OBJECT zganesh1,
    p_zeile TYPE mseg-zeile OBLIGATORY MATCHCODE OBJECT zganesh2.
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-001.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 10.
    PARAMETER:r_disp RADIOBUTTON GROUP g1 USER-COMMAND u1 DEFAULT 'X'.
    SELECTION-SCREEN:COMMENT 15(10) text-002 .
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 10.
    PARAMETERS: r_down RADIOBUTTON GROUP g1.
    SELECTION-SCREEN:COMMENT 15(10) text-003.
    *PARAMETERS: v_file LIKE rlgrap-filename .
    *SELECTION-SCREEN:COMMENT 70(50) text-005.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN BEGIN OF LINE.
    SELECTION-SCREEN POSITION 10.
    PARAMETERS: r_print RADIOBUTTON GROUP g1 .
    SELECTION-SCREEN:COMMENT 15(10) text-004.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS: v_file LIKE rlgrap-filename MODIF ID g12.
    SELECTION-SCREEN END OF BLOCK b2.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR v_file.
    DATA : wlv_field_name LIKE dynpread-fieldname,
    wlv_file_name LIKE ibipparms-path.
    wlv_field_name = v_file.
    CALL FUNCTION 'F4_FILENAME'
    EXPORTING
    field_name = wlv_field_name
    IMPORTING
    file_name = wlv_file_name.
    IF sy-subrc EQ 0.
    vfile = wlv_file_name.
    v_file = wlv_file_name.
    ENDIF.
    AT SELECTION-SCREEN OUTPUT.
    LOOP AT SCREEN.
    IF screen-name = 'V_FILE'.
    IF r_disp EQ 'X' OR r_print EQ 'X'.
    screen-input = 0.
    ELSE.
    screen-input = '1'.
    ENDIF.
    MODIFY SCREEN.
    ENDIF.
    ENDLOOP.
    START-OF-SELECTION EVENT *
    START-OF-SELECTION.
    CALLING CONVERSION FUNCTION MODULE 'CONVERSION_EXIT_ALPHA_INPUT' *
    *Conversion function module for appending 00 befor MBLNR FIELD
    CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
    input = p_mblnr
    IMPORTING
    output = p_mblnr.
    Call subroutine for fetching data from database
    PERFORM get_data.
    END-OF-SELECTION EVENT *
    END-OF-SELECTION.
    Call subroutine for calling and processing smartform
    PERFORM call_smartform.
    *& Form get_data
    Subroutine for fetching data from database
    FORM get_data .
    Fetching data from MKPF table with using parameters MBLNR and MJAHR
    SELECT SINGLE * FROM mkpf
    INTO i_mkpf
    WHERE mblnr = p_mblnr
    AND mjahr = p_mjahr.
    IF sy-subrc EQ 0.
    Fetching data from MSEG with using parameters MBLNR,ZEILE and MJAHR
    SELECT SINGLE * FROM mseg
    INTO i_mseg
    WHERE mblnr = i_mkpf-mblnr
    AND mjahr = i_mkpf-mjahr
    AND zeile = p_zeile.
    IF sy-subrc NE 0.
    CLEAR i_mseg.
    ENDIF.
    ELSE.
    MESSAGE i000.
    EXIT.
    ENDIF.
    ENDFORM. " get_data
    *& Form call_smartform
    Subroutine for calling smartform
    FORM call_smartform .
    Local template used in the processing output of smartform
    TYPES: BEGIN OF lt_ztable,
    mandt TYPE sy-mandt,
    mblnr TYPE mseg-mblnr,
    flag(1) TYPE c,
    END OF lt_ztable.
    CONSTANTS: c_x(1) TYPE c VALUE 'X'.
    Workarea
    DATA: lw_ztable TYPE lt_ztable.
    *Variable used in the smartform
    DATA: lv_form(30) TYPE c,
    lv_fm_name(30) TYPE c.
    lv_form = 'ZPTPFRM202L_POGR'.
    *Calling function module SSF_FUNCTION_MODULE_NAME which gives new name
    *to the function module that will generated by smartform.
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = lv_form
    IMPORTING
    fm_name = lv_fm_name
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    *Calling function module that will be generated by smartform
    IF r_disp = c_x.
    i_output_options-tdimmed = space.
    i_output_options-tdnewid = c_x.
    i_output_options-tddest = 'LOCL'.
    i_control-no_dialog = 'X'.
    i_control-preview = 'X'.
    ELSEIF r_print = c_x.
    i_output_options-tdimmed = c_x.
    i_output_options-tddest = 'LOCL'.
    i_control-no_dialog = c_x.
    ELSE.
    i_output_options-tdimmed = space.
    i_output_options-tdnewid = c_x.
    i_output_options-tddest = 'LOCL'.
    i_control-getotf = 'X'.
    i_control-preview = space.
    i_control-no_dialog = c_x.
    flag = c_x.
    ENDIF.
    CALL FUNCTION lv_fm_name
    EXPORTING
    control_parameters = i_control
    output_options = i_output_options
    user_settings = space
    zmkpf = i_mkpf
    zmseg = i_mseg
    IMPORTING
    document_output_info = zdoc_output_info
    job_output_info = zjob_output_info
    job_output_options = zjob_output_opts
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Modify the database table if it found the print command
    IF zjob_output_opts-tdpreview NE c_x.
    lw_ztable-mandt = sy-mandt.
    lw_ztable-mblnr = p_mblnr.
    lw_ztable-flag = c_x.
    MODIFY zgr_table FROM lw_ztable.
    CLEAR lw_ztable.
    ENDIF.
    IF flag EQ c_x.
    DATA: li_lines LIKE tline OCCURS 100 WITH HEADER LINE.
    DATA: lv_file TYPE string,
    lbin_fsiz TYPE i.
    lv_file = v_file.
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    format = 'PDF'
    IMPORTING
    bin_filesize = lbin_fsiz
    TABLES
    otf = zjob_output_info-otfdata
    lines = li_lines
    EXCEPTIONS
    err_max_linewidth = 1
    err_format = 2
    err_conv_not_possible = 3
    err_bad_otf = 4
    OTHERS = 5.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    bin_filesize = lbin_fsiz
    filename = lv_file
    filetype = 'BIN'
    TABLES
    data_tab = li_lines
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    OTHERS = 22.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    ENDIF.
    ENDFORM. " call_smartform
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • Sending mail to Internet address from SAP system

    Hi...
    My requirement is to send a mail to an internet address say ABC@companyid from SAP.
    I have used a FM So_New_Document_Send_API1 for the purpose.For this I have provided
                 e_mailrec-receiver = w_emailid.
                  e_mailrec-rec_type = 'U'.
                  APPEND e_mailrec.
    But I get an error msg in SOST, that the route from (SAP server) to (mail id) not found.
    Instead of internet address when I give rec_type as B i.e. SAP USER it sends a mail to my SAP inbox.
    I have also checked SAPConnect, and it is fine.
    Is the above FM only for sending mails to SAP id, then wats the FM for sending mails to internet address? Its just sending a 1 line mail without attachment.
    P.S: I have gone through search in sdn so please don't provide me with links to other threads.
    Reply only if you can actually help and know wats this about.
    Thnaks and Regards.

    These are the FM for sending external email :-
    SO_DOCUMENT_SEND_API1
    Send new document with attachments via RFC
    SO_NEW_DOCUMENT_ATT_SEND_API1
    (In 4.6C only, You can go to SE37 and click the documentation on how to use it. A sample program is provided there.)
    Send new document with attachments via RFC
    Note : If you are using FM SO_NEW_DOCUMENT_ATT_SEND_API1 then Export Parameter DOCUMENT_DATA-OBJ_DESCR contains the Subject.
    SO_NEW_DOCUMENT_SEND_API1
    Send new document
    For Code
    http://www.forum.saptechies.com/viewtopic.php?t=5562

  • Sending an email to customer using VF02

    Hi Experts
    can anyone help me with the code sending an email to customer using TC:vf02.i already done with config .please help me.

    Reddy,
    Please search in SDN you will find lots of post pertaining to your issue.
    Check this link you might get answers to your problem.
    send email after save VA01
    Cheers.

  • Issue in sending the email with XL attachment in ECC version

    Hi,
    I have an issue with sending the email with XL attachment. My program is sending a mail to the receiver with XLS as attachment. Recently we have migrated from 4.6B to ECC version. Same code was worked in 4.6B.But it is not working in ECC version.When i try to open the attachment, i get a Dialog Box with the following message
    "The file is not in a recognizable format.
    1. if you know the file is from another program whih is incompatible with Microsoft excel,click cancel,then open this file in its original application
    2.If you suspect the file is damaged, click help for more information about solving theproblem.
    3.if you still want to see what text is contained in the file, click OK.Then click the text import wizard. "
    when i click OK, the excel sheet is opening with all required data.
    Can anyone kindly tell me why this is happening.
    I am also attaching part of the coding related to this requirement.
    *&      Form  BUILD_XLS_DATA_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM build_xls_data_table.
      DATA: w_total(13),
      w_clabs(13),
      w_cinsm(13),
      w_ceinm(13),
      w_cretm(13),
      w_cspem(13),
      w_cumlm(13),
      w_exp_date(8),
      w_v_totalp(13),
      w_min_rem(8),
      w_ersda(10),
      w_hsdat(10),
      w_vfdat(10),
      w_ship_date(10),
      w_plnmg(13),
       w_mhdrz(4).
      CLEAR: w_total, w_clabs, w_cinsm, w_ceinm, w_cspem, w_exp_date,
      w_v_totalp, w_min_rem, w_ersda, w_hsdat, w_vfdat, w_ship_date,
      w_plnmg, w_mhdrz.
      w_total = it_batch1-total.
      w_clabs = it_batch1-clabs.
      w_cinsm = it_batch1-cinsm.
      w_ceinm = it_batch1-ceinm.
      w_cspem = it_batch1-cspem.
      w_cumlm = it_batch1-cumlm.
      w_cretm = it_batch1-cretm.
      w_exp_date = it_batch1-exp_date.
      w_v_totalp = it_batch1-v_totalp.
      w_min_rem = it_batch1-min_rem.
      w_plnmg = it_batch1-plnmg.
      w_mhdrz = it_batch1-mhdrz.
      CONCATENATE it_batch1-ersda6(2) it_batch1-ersda4(2)
                  it_batch1-ersda+0(4) INTO w_ersda SEPARATED BY '.'.
      CONCATENATE it_batch1-hsdat6(2) it_batch1-hsdat4(2)
                  it_batch1-hsdat+0(4) INTO w_hsdat SEPARATED BY '.'.
      CONCATENATE it_batch1-vfdat6(2) it_batch1-vfdat4(2)
                  it_batch1-vfdat+0(4) INTO w_vfdat SEPARATED BY '.'.
      CONCATENATE it_batch1-ship_date6(2) it_batch1-ship_date4(2)
                  it_batch1-ship_date+0(4) INTO w_ship_date SEPARATED BY '.'
      CONCATENATE
      it_batch1-werks it_batch1-mtart it_batch1-matnr it_batch1-maktg
    it_batch1-prdha it_batch1-prctr it_batch1-ktext  it_batch1-dispo
      it_batch1-charg it_batch1-lgort it_batch1-herkl w_clabs
      w_cinsm w_ceinm w_cretm w_cspem
      w_cumlm w_total  it_batch1-meins  it_batch1-v_spr_unit
      w_v_totalp it_batch1-waers w_plnmg  it_batch1-meins
      w_ersda w_hsdat w_vfdat  w_exp_date
       w_ship_date  w_mhdrz  w_min_rem it_batch1-zlifer
       it_batch1-doknr it_batch1-dokar it_batch1-doktl  it_batch1-dokvr
               INTO L_STRING SEPARATED BY CON_TAB.
                  INTO l_string SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
      WHILE l_string <> space.
        CALL FUNCTION 'TEXT_SPLIT'
          EXPORTING
            length       = 255
            text         = l_string
            as_character = 'X'
          IMPORTING
            line         = it_attach
            rest         = l_string.
        IF l_string = space.
       CONCATENATE IT_ATTACH CON_CRET INTO IT_ATTACH.
          CONCATENATE it_attach cl_abap_char_utilities=>cr_lf INTO it_attach.
          APPEND it_attach.
          CLEAR it_attach.
        ELSE.
          APPEND it_attach.
          CLEAR it_attach.
        ENDIF.
      ENDWHILE.
    move l_string to it_attach .
    CONCATENATE it_attach cl_abap_char_utilities=>cr_lf INTO it_attach.
    APPEND it_attach.
    CLEAR it_attach.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  SEND_FILE_AS_EMAIL_ATTACHMENT
          text
    -->  p1        text
    <--  p2        text
    FORM send_file_as_email_attachment.
      DATA:w_length TYPE i.
      DATA:  w_cnt TYPE i,
              w_sent_all(1) TYPE c,
              w_doc_data LIKE sodocchgi1,
              gd_error    TYPE sy-subrc,
              gd_reciever TYPE sy-subrc,
              t_attachment LIKE solisti1 OCCURS 0 WITH HEADER LINE.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
    w_doc_data-obj_langu = sy-langu.
    w_doc_data-obj_name  = 'SAPRPT'.
    w_doc_data-obj_descr = text-034 .
    w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
    DESCRIBE TABLE it_attach LINES w_cnt.
      DESCRIBE TABLE it_message LINES w_cnt.
      READ TABLE it_message INDEX w_cnt.
    w_length = STRLEN( it_attach ).
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_message ).
      w_doc_data-obj_langu  = sy-langu.
    w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = text-034.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = it_attach[].
    describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin = space.
      t_packing_list-head_start = 1.
      t_packing_list-head_num = 0.
      t_packing_list-body_start = 1.
    ***Start of changes by 501507008 on 29.01.2009
      t_packing_list-obj_descr  = 'MAIL BODY'.
    ***End of changes by 501507008 on 29.01.2009
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  'XLS'.
      t_packing_list-obj_descr  =  text-034.
      t_packing_list-obj_name   =  'filename'.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      LOOP AT it_adr6.
        t_receivers-receiver = it_adr6-smtp_addr.
        t_receivers-rec_type = 'U'.
        t_receivers-com_type = 'INT'.
        t_receivers-notif_del = 'X'.
        t_receivers-notif_ndel = 'X'.
        APPEND t_receivers.
      ENDLOOP.
    CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
       EXPORTING
         document_data              = w_doc_data
         put_in_outbox              = 'X'
         sender_address             = ' '
         sender_address_type        = ' '
         commit_work                = 'X'
       IMPORTING
         sent_to_all                = w_sent_all
       TABLES
         packing_list               = t_packing_list
         contents_bin               = t_attachment
         contents_txt               = it_message
         receivers                  = t_receivers
       EXCEPTIONS
         too_many_receivers         = 1
         document_not_sent          = 2
         document_type_not_exist    = 3
         operation_no_authorization = 4
         parameter_error            = 5
         x_error                    = 6
         enqueue_error              = 7
         OTHERS                     = 8.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data                    = w_doc_data
         put_in_outbox                    = 'X'
      commit_work                      = ' '
    IMPORTING
      sent_to_all                      =
      new_object_id                    =
    tables
            packing_list               = t_packing_list
            contents_bin               = t_attachment
            contents_txt               = it_message
            receivers                  = t_receivers
      contents_hex                     =
      object_para                      =
      object_parb                      =
       exceptions
         too_many_receivers               = 1
         document_not_sent                = 2
         document_type_not_exist          = 3
         operation_no_authorization       = 4
       parameter_error                  = 5
       x_error                          = 6
       enqueue_error                    = 7
       OTHERS                           = 8.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM.                    " SEND_FILE_AS_EMAIL_ATTACHMENT

    Hi,
    could you tell me which opeion should i select in SCOT under INT node. I have tried with diffrent options. but no luck.
    SAPscript/Smart Forms  - No Conversion
    ABAP List                     - No Conversion
    Business Object/Link     - No Conversion
    RAW Text                     - No Conversion

  • How to Send an Email to Outlook using process type in RSPC?

    Hi,
    How to Send an Email to Outlook using process type in RSPC?
    We created lot of process variants, actually we want to send an mail to users if the DP Background job was succesfully finished.
    Actually i tried with create message its not happening...
    Plz let me know .. its urgent ...
    Regards,
    Satish

    Hello Satish,
    If you want to send a friendly message to your users, then you can do this by building an ABAP program that calls function module SO_NEW_DOCUMENT_SEND_API1 . You can then insert this ABAP program in your process chain (using the ABAP program process type) or as a second step in your background job. With this technique, you can send an email to SAP users, or to external users (e..g Outlook email addresses)
    Here's  a sample ABAP code:
      data: ls_docdata type SODOCCHGI1,
            lt_objcont type table of solisti1,
            lt_receivers type table of somlreci1,
            ls_objcont type solisti1,
            ls_receivers type somlreci1,
            ls_user type syuname.
    * Fill these variables with subject and msg lines that you need.
    data: MAIL_SUBJECT     TYPE STRING,
    MSG_LINE1     TYPE STRING,
    MSG_LINE2     TYPE STRING,
    MSG_LINE3     TYPE STRING,
    MSG_LINE4     TYPE STRING,
    MSG_LINE5     TYPE STRING.
      ls_docdata-obj_descr = mail_subject.
      ls_objcont-line = msg_line1.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line2.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line3.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line4.
      append ls_objcont to lt_objcont.
      ls_objcont-line = msg_line5.
      append ls_objcont to lt_objcont.
    * t_userlist contains the list of users to whom th email will be sent.
      loop at t_userlist into ls_user.
        ls_receivers-receiver = ls_user.
    "Change the type  here if email is for outlook users, See documentation
    " of function module in SE37
        ls_receivers-rec_type = 'B'.            
        ls_receivers-express = 'X'.
        append ls_receivers to lt_receivers.
      endloop.
      CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
        EXPORTING
          document_data                   = ls_docdata
        tables
         OBJECT_CONTENT                   = lt_objcont
         receivers                        = lt_receivers
       EXCEPTIONS
         TOO_MANY_RECEIVERS               = 1
         DOCUMENT_NOT_SENT                = 2
         DOCUMENT_TYPE_NOT_EXIST          = 3
         OPERATION_NO_AUTHORIZATION       = 4
         PARAMETER_ERROR                  = 5
         X_ERROR                          = 6
         ENQUEUE_ERROR                    = 7
         OTHERS                           = 8
    You can test out the function module first in SE37 (just put the name of the FM and click execute). Testing it in SE37 will help you get your parameters right.
    Hope this helps.

  • MAIL WILL REPLY, BUT WON'T SEND FRESH EMAILS FROM ADDRESS BOOK

    HI, Recently set up my pop3 account on mail. And hit a problem. Mail will receive emails, will send "REPLYS" but will not send fresh emails from address book or even if i type them in manually.
    This is so stupid.
    Help guys, Thanks
    Liam

    You should set it to Port 465, and select SSL, assuming this is the smtp.gmail.com server. Your ISP is probably blocking use of such a SMTP on Port 25, and that is very common policy.
    Ernie
    Message was edited by: Ernie Stamper

  • When I send an email the box use to be smaller. Now it is much bigger. What did I touch?

    When I send an email, the box use to be much small, like 4" X 6", but now it takes up the entire screen. How can I get it to go back to the smaller scree?. What did I accidentally touch?

    If you are in full screen mode you can exit. Double arrows in upper right corner,
    or the shortcut keys control command F

  • Sending Mail to Internet Address Maintained in Infotype 105

    Hi All,
    I have a requirement wherein I have to send mail to the Internet Address of the employee which is maintained in Infotype 0105. Now I have gone through the SDN where in they have said that using select or FM get the Employee details and pass it to a container which will be added in the Send Mail step. I have understood all this thing. But Since I am new to workflow Concepts. Can someone guide me where to write this peice of code to fetch email id from INfotype 0105 and how to get that value in a workflow container.
    If anyone has done this scenario , I will be very grateful if you can guide me step by step how to do it.
    I am an Abaper and understands ABAP OO and BOR Concepts very well.
    Regards,
    Akhil Rai

    I am an Abaper and understands ABAP OO and BOR Concepts very well.
    Createa a method in the BOR and impor the employee number for whom you need to determine the EMAIL ID by using the FM HR_READ_INFOTYPE pass the infotype as 0105 and subtype as 0010 to get the email Id.
    and once the email ID is determined then export the email back to workflow by using binding concept
    Pass the pernr from WORKFLOW  ---> TASK  ---> method container ( For importing into method )
    Pass any value METHOD ---> TASK ---> Workflow Container ( for exporting to workflow )..
    and if possible instead of using send mail step call the standrad FM and mention the address type as U external address and pass the email ID and content...

  • Issues while sending automatic email from job scheduled via sm36

    Dear basis guys,
    We are on Netweaver 2004s, ERP 6 .
    I am scheduling (in SM36) a standard report output as background job, send its output to a pdf device and send this pdf automatically to email address. Everything is working fine except that I am not able to do the following:
    1. Cannot change the email title (APR****-spool request no.) and body from "The Mail Attachment Contains the Print File Created by User..."
    2. I need to send the email to several people.  Cannot use the distribution list with the pdf device. IF I use in sm36 "spool list recipients"  instead,  the attachment sent as pdf will result truncated. Not all report lines will show.
    Could someone help on any of the above?
    Thank you in advance for any input.

    Dear basis guys,
    We are on Netweaver 2004s, ERP 6 .
    I am scheduling (in SM36) a standard report output as background job, send its output to a pdf device and send this pdf automatically to email address. Everything is working fine except that I am not able to do the following:
    1. Cannot change the email title (APR****-spool request no.) and body from "The Mail Attachment Contains the Print File Created by User..."
    2. I need to send the email to several people.  Cannot use the distribution list with the pdf device. IF I use in sm36 "spool list recipients"  instead,  the attachment sent as pdf will result truncated. Not all report lines will show.
    Could someone help on any of the above?
    Thank you in advance for any input.

  • Need help: Sending mail to internet address without commit work statement

    Dear Experts,
            I have a problem in sending mails from sap to internet address.Am using the function module
    SO_NEW_DOCUMENT_SEND_API1 and am passing parameters like,
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
         EXPORTING
              DOCUMENT_TYPE  = 'RAW'
              DOCUMENT_DATA  = DOC_CHNG
              PUT_IN_OUTBOX  = 'X'
         TABLES
              OBJECT_CONTENT = OBJCONT
              RECEIVERS      = RECLIST
         EXCEPTIONS
              TOO_MANY_RECEIVERS         = 1
              DOCUMENT_NOT_SENT          = 2
              OPERATION_NO_AUTHORIZATION = 4
              OTHERS                     = 99.
    submit rsconn01 with mode = 'INT'
                        with output = 'X'
                        and return.
    My problem here is,with the commit work statement after FM, the mail is triggering correctly.but if, am not using the commit work statement,at the very first time of execution mail is not triggering, and the second time of execution first mail is triggering like wise it is going.The status of the message is waiting in queue.
    i have refresh receiver's list also.I want to use this concept in badi.So anyone can pls help me,how to send a mail without commit work statement.
    Thanks in advance.

    There is a parameter Commit_Work pass it as 'X'
    <code>
    CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
    EXPORTING
    DOCUMENT_TYPE = 'RAW'
    DOCUMENT_DATA = DOC_CHNG
    PUT_IN_OUTBOX = 'X'
    commit_work = 'X'
    TABLES
    OBJECT_CONTENT = OBJCONT
    RECEIVERS = RECLIST
    EXCEPTIONS
    TOO_MANY_RECEIVERS = 1
    DOCUMENT_NOT_SENT = 2
    OPERATION_NO_AUTHORIZATION = 4
    OTHERS = 99.
    submit rsconn01 with mode = 'INT'
    with output = 'X'
    and return.
    </code>
    Edited by: Saravanan Ramasamy on Nov 11, 2009 1:31 PM

  • Trigger to Send Seperate Emails per Address on New Subscricption Insert

    Hi Everyone,
    I am trying to create a trigger that, on insert into and delete from a email_subscription table, will send an email to our MailMan server to subscribe or unsubscribe a member for each email address they have. The problem is I am not sure how to get the information form the other two related tables required to compose the message(s).
    The tables are:
    Email_Subscription (Member, Email_List)
    Email (Member, Email)
    EmailList (EmailListID, Email_List)
    (where Email_Subscription.Member = Email.Member and Email_Subsciption.Email_List = EmailList.EmailListID)
    A Member can have zero or more Email addresses but can only have one Email Subscription per Email List.
    So this code:
    utl_mail.send(
    '[email protected]', --From
    EmailList.Email_List || '[email protected]', --To
    '', --BCC
    '', --CC
    'subscribe nodigest address=' || Email.Email, --Subject (subscribe on insert, unsubscribe on delete)
    '', --Message
    'text/plain; charset=us-ascii', --Email type
    3); --Priority
    Should be executed for each address the member has when a new email subscription is entered for them or to put it another way, the code should be run for each result of this query:
    Select E.email, EL.email_list
    From emaillist EL, email E
    Where :NEW.member = E.member
    And :NEW.email_list = EL.emaillistid
    I know how to write a trigger that will insert a record once into another table but cannot work out how to run code for multiple records from related tables.
    BTW I am using Oracle XE running on Windows 2003 and Utl_mail is set up and tested.
    Any help is much appreciated.

    Welcome to OTN.
    I'm not sure sending a mail through trigger is at all a good option or not though it sounds rational but would like to share some thoughts.
    satyaki>
    satyaki>select * from v$version;
    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod
    PL/SQL Release 10.2.0.1.0 - Production
    CORE    10.2.0.1.0      Production
    TNS for Linux: Version 10.2.0.1.0 - Production
    NLSRTL Version 10.2.0.1.0 - Production
    Elapsed: 00:00:00.08
    satyaki>
    satyaki>
    satyaki>create table email_subq
      2   (  
      3     sr_no       number(5),
      4     s_name      varchar2(40),
      5     s_mail      varchar2(60)
      6   );
    Table created.
    Elapsed: 00:00:01.02
    satyaki>
    satyaki>create table send_mail_log
      2    (
      3      recipient_name   varchar2(40),
      4      email_id         varchar2(60)
      5    );
    Table created.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>create or replace trigger subsq_notifier
      2  before insert on email_subq
      3  for each row
      4  begin
      5    insert into send_mail_log values(:new.s_name,:new.s_mail);
      6  end;
      7  /
    Trigger created.
    Elapsed: 00:00:00.09
    satyaki>
    satyaki>
    satyaki>insert into email_subq values(1,'SATYAKI','[email protected]');
    1 row created.
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>select * from email_subq;
         SR_NO S_NAME                                   S_MAIL
             1 SATYAKI                                  [email protected]
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>select * from send_mail_log;
    RECIPIENT_NAME                           EMAIL_ID
    SATYAKI                                  [email protected]
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>insert into email_subq values('A1','BILLY','[email protected]');
    insert into email_subq values('A1','BILLY','[email protected]')
    ERROR at line 1:
    ORA-01722: invalid number
    Elapsed: 00:00:00.01
    satyaki>
    satyaki>select * from email_subq;
         SR_NO S_NAME                                   S_MAIL
             1 SATYAKI                                  [email protected]
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>select * from send_mail_log;
    RECIPIENT_NAME                           EMAIL_ID
    SATYAKI                                  [email protected]
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>rollback;
    Rollback complete.
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>select * from email_subq;
    no rows selected
    Elapsed: 00:00:00.00
    satyaki>
    satyaki>select * from send_mail_log;
    no rows selected
    Elapsed: 00:00:00.00Now, check the last part. If user somehow rollback it - still your mail will be send to the recipient which might be annoying for the user - i guess. ;)
    So, my suggestion would be do not implement this kind of mailing approach through trigger. You can store them in any intermediate table and then after thorough verification you can send the mail using any job or scheduler that available in your version.
    Regards.
    Satyaki De.

  • Issue while sending an email on saving the PO in trnasaction ME22

    “  Adobe Reader could not open ‘XeroxPurchase order 80000001222_20070327064958_X.PDF’ because it is either not supported file type or because the file has been damaged (for example, it was sent as an email attachment ans wasn’t correctly decoded)”.
    While saving a PO I should send an email.  Here the email is triggering. However at requisitioner level the attachment can not be opened, instead of that it is throwing the above message during time opening the PDF form of attachment.
    I have used the following parameters in my smart form .
      lw_ctrlop-getotf = 'X'.
      lw_ctrlop-no_dialog = 'X'.
      lw_compop-tdnoprev = 'X'.
      CALL FUNCTION  fm_name
        EXPORTING
          control_parameters  = lw_ctrlop
            output_options    = lw_compop
            USER_SETTINGS    = 'X'
    Please advice.

    We can dirctky transfre it to PDF , So try to Change the OTF format from SSF into PDF .
    Hope this will helpyou.
    Thx
    Parthi
    Reward if found useful.

  • After I send an email, the address disappears from contnets sidebar

    Let's say I want to send an email to [email protected] The address is in the email contents sidebar, and I click twice on it to put the address in the To: space, and Send the email. Okay -- after doing that, if I then go back to the contents sidebar and look for that address, it has disappeared. (But, if I then type the name in the To: space, the entire address will appear.) It is also still in the Address Book. How do I stop the email addresses from being eliminated from the contents sidebar? Thank you very much! --Tom Carter, [email protected]

    Please ignore this question!   I am devolving into an even less capable computer user.  I realized that all my "Sent" emails have my address on the top. 
    BUT!  if someone could tell me how to display the address of the person I'm sending the email to…..  That would be very helpful.
    Cheers,
    S

  • How to send BULK email into INBOX using ASP

    Dear Gurus,
    I am using GOMAIL to send newsletter to 2000 of my subscribed
    users. but no
    one is getting their emai intheir inbox
    Only users other than yahoo,hotmail,rediff,gmail are getting
    in their inbox
    I want to know how can I make sure that users who has hotmail
    and yahoo
    accounts also get my newsletter into their inbox cos
    currently it goes to
    their JUNK email or bulk email folder.
    I know lots of companies who send newsletter to my HOTMAIL
    inbox.
    Please suggest as this is very important

    You can send email from javascript in an content editor web part or HTML Form webpart  (if someone is doing this interactively in the browser AND they have an email client installed) by changing the current page ref to a mailto: reference.
    location.href="mailto:"+emailTo+emailSub+emailBody;
    var emailSub = "?subject=xxxxx";
    var emailBody = "&body=xxxxx";
    That will pop up an email window. Build up the emailTo by using Javascript/JQuery to pick up selected people on the page, or all rows on the page, or use something like SPServices or web service calls to pick up all items in a specific view. Depends totally
    on how you want the UI to work. Not sure I'd do this on an external facing SP site since you wouldn't want any emails addresses in the clear to harvest, but inside a company intranet should be fine.
    For example, you could read all records in the Supervisors view, build up the emailTo var with the correct addresses or names that your email client needs, then set location.href to the correct mailto: link.
    Robin

Maybe you are looking for