Using  so_new_document_send_api1 ?

hi there,
i am using FM  so_new_document_send_api1 for sending emails from z-abap.
is there any possibility that i can send the email IMMEDIATELY ?
now it is getting into the queue (in SCOT). there we have a job running every
5 minutes which sends the emails.
but for this case i need it directly after call of  so_new_document_send_api1.
any ideas ?
b.regards, Martin

Hi Martin,
In the Standard FM 'SO_NEW_DOCUMENT_SEND_API1' , we have a RECEIVERS parameter, in the TABLES tab. Here, the  RECEIVER parameter is of the type of the STRUCTURE  SOMLRECI1, which has a flag EXPRESS need to be set in order to send the mail immediately.
Hope this is helpful to you. If you need further information, revert back.
Reward all the helpful answers.
Regards
Nagaraj T

Similar Messages

  • Multiple lines appended in mail body while using SO_NEW_DOCUMENT_SEND_API1.

    Hi,
    I built the text(Body) of the mail with 19 lines. But while triggering through workflow the last 3 lines of the body displayed in the same line instead of different line. I used SO_NEW_DOCUMENT_SEND_API1 function module for mail sending activity,
    Can anybody experienced this kind of problems earlier? If so please kindly help me to sort out this asap. Useful responses will be rewarded.
    Thanks in advance.

    Hi
    I have used this function module to send mail.
    SO_NEW_DOCUMENT_SEND_API1
    I have not problem and not found any duplicate entries.
    Please send your piece of code where you are adding text line.
    It may happened because of not clearing the memory values.
    Rgds,
    Sriram

  • How to use 'SO_NEW_DOCUMENT_SEND_API1' function module

    Hello Experts,
    Please anybody tell me how to use 'SO_NEW_DOCUMENT_SEND_API1' function module

    hi,
    umesh see below code copy it and compile it and see how it works!!
    REPORT  ZSEND_SMS.
    parameters: sms_num type text20 obligatory.
    parameters: subject type SO_OBJ_DES default sy-sysid.
    parameters: sms_txt type text50 obligatory.
    data: receivers like somlreci1 occurs 0 with header line,
    objhead like solisti1 occurs 0 with header line,
    objtxt like solisti1 occurs 0 with header line,
    p_rec like receivers-receiver,
    p_type like receivers-rec_type.
    *users like ywf_ea_user_task occurs 0 with header line.
    data: count type i,
    p_email(50),
    doc_chng like sodocchgi1,
    objcont like solisti1 occurs 5 with header line,
    p_count(5).
    start-of-selection .
    clear receivers.
    refresh receivers.
    receivers-receiver+9 = 'SMS'.
    receivers-receiver+13 = sms_num.
    move 'K' to receivers-rec_type.
    append receivers.
    clear doc_chng.
    doc_chng-obj_descr = subject. "Subject zpravy
    doc_chng-obj_name = 'SMS'.
    doc_chng-doc_size = strlen( doc_chng-obj_descr ).
    refresh objtxt.
    objtxt = 'SMS message'. "message
    append objtxt.
    call function 'SO_NEW_DOCUMENT_SEND_API1'
    exporting
    document_type = 'RAW'
    document_data = doc_chng
    commit_work = 'X'
    tables
    object_header = objhead
    object_content = objtxt
    receivers = receivers
    exceptions
    too_many_receivers = 1
    document_not_sent = 2
    operation_no_authorization = 4
    others = 99.
    if sy-subrc ne 0.
    message e208(00) with 'Error'.
    endif.
    Hope magic Works!
    Regards,
    Purvesh.

  • How to send html in an email (46C) using SO_NEW_DOCUMENT_SEND_API1

    I am having trouble sending an email so that it appears in HTML format, nice and pretty.  I have been experimenting with FM SO_NEW_DOCUMENT_SEND_API1 and ATTSEND_API1.  I have been able to successfully send an email to myself (using an email address outside of SAP), but all I see is the html source code.   If I set the DOC_TYP to "HTM", I get the error "Message cannot be processed as it cannot be converted.".  Below is my sample code.   Has anyone been able to do this in 46C ?
    Thanks,  Mark
    REPORT ZYR_EMAIL_TEST1 .
    * SAP 46C
    data: maildata   type sodocchgi1,
          mailhdr    type table of solisti1    with header line,
          mailtxt    type table of solisti1    with header line,
          mailbin    type table of solisti1    with header line,
          mailpack   type table of sopcklsti1  with header line,
          mailrec    type table of somlreci1   with header line,
          tab_lines  type i.
    define bld_txt.
         clear mailtxt.
         mailtxt = &1.
         append mailtxt.
    end-of-definition.
    define bld_bin.
         clear mailbin.
         mailbin = &1.
         append mailbin.
    end-of-definition.
    start-of-selection.
      clear:    maildata, mailhdr, mailtxt,  mailbin, mailrec, tab_lines.
      refresh:  mailhdr, mailtxt, mailbin, mailrec.
      perform build_header.
      perform build_message.
      perform build_pack_list.
      perform build_receivers.
      perform send_mail_nodialog..
    * Use form initiate_mail_execute_program OR process
    * with txn SCOT.  Check status of mail with txn SOST.
    *  perform initiate_mail_execute_program.
      write: / 'End of program.'.
    *      Form  BUILD_HEADER
    form build_header.
      maildata-obj_name   = 'Email_Name'.
      maildata-obj_descr  = 'Email_Description'.
    *  maildata-obj_langu  =
    *  maildata-obj_sort   =
      mailhdr  = 'MYTEST.HTM'.
      append mailhdr.
    endform.
    *      Form  BUILD_MESSAGE
    form build_message.
      bld_txt '<html>'.
      bld_txt '<head>'.
      bld_txt '<title>Untitled Document</title>'.
      bld_txt '<meta http-equiv="Content-Type" content="text/html;'.
      bld_txt 'charset=iso-8859-1">'.
      bld_txt '</head>'.
      bld_txt '<body>'.
      bld_txt '<div align="center"><em><font' .
      bld_txt 'color="#0000FF" size="+7" face="Arial,'.
      bld_txt 'Helvetica, sans-serif">THIS'.
      bld_txt '  IS A TEST </font></em><br><font' .
      bld_txt 'color="#0000FF" size="+7" face="Arial,'.
      bld_txt 'Helvetica, sans-serif">Yahoo</font>'.
      bld_txt '</div>'.
      bld_txt '</body>'.
      bld_txt '</html>'.
    * Doc_Size is length of last line + ( nbr of other lines x 255 ).
      describe table mailtxt lines tab_lines.
      read     table mailtxt index tab_lines.
      maildata-doc_size = ( ( tab_lines - 1 ) * 255 ) + strlen( mailtxt ).
    endform.
    *      Form  BUILD_PACK_LIST
    form build_pack_list.
      clear mailpack.
      refresh mailpack.
    *  mailpack-transf_bin = 'X'.
      mailpack-head_start = 1.
      mailpack-head_num = 0.
      mailpack-body_start = 1.
      describe table mailtxt lines tab_lines.
      mailpack-body_num = tab_lines.
      mailpack-doc_type = 'HTM'.
      append mailpack.
    endform.
    *      Form  BUILD_RECEIVERS
    form build_receivers.
      mailrec-receiver  = '[email protected]'.
      mailrec-rec_type  = 'U'.
      mailrec-com_type = 'INT'.
      append mailrec.
    endform.
    *      Form  SEND_MAIL
    form send_mail.
      call function 'SO_NEW_DOCUMENT_SEND_API1'
           exporting
                document_type              = 'HTM'
                document_data              = maildata
    *           put_in_outbox              = ' '
           tables
                object_header              = mailhdr
                object_content             = mailtxt
                receivers                  = mailrec
           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.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        write: / 'There was error.  sy-subrc = ', sy-subrc.
      endif.
    endform.
    *    Form  INITIATE_MAIL_EXECUTE_PROGRAM
    *   Instructs mail send program for SAPCONNECT to send email.
    form  initiate_mail_execute_program.
      wait up to 2 seconds.
      submit rsconn01 with mode = 'INT'
                    with output = 'X'
                    and return.
    endform.

    Yes, the OBJ_HTM function exists.  I found these also, that exist on our system.
    SX_OBJECT_CONVERT        
    SX_OBJECT_CONVERT_ALI_HTM
    SX_OBJECT_CONVERT_ALI_PRT
    SX_OBJECT_CONVERT_ALI_RAW
    SX_OBJECT_CONVERT_ALI_TXT
    SX_OBJECT_CONVERT_INT_RAW
    SX_OBJECT_CONVERT_OBJ_HTM
    SX_OBJECT_CONVERT_OBJ_R3O
    SX_OBJECT_CONVERT_OTF_PDF
    SX_OBJECT_CONVERT_OTF_PRT
    SX_OBJECT_CONVERT_OTF_RAW
    SX_OBJECT_CONVERT_RAW_SCR
    SX_OBJECT_CONVERT_RAW_TXT
    SX_OBJECT_CONVERT_SCR_OTF
    SX_OBJECT_CONVERT_TO_AFX 
    SX_OBJECT_CONVERT_TXT_INT
    And these are the entries I see in the SXCONVERT table:
    SX_OBJECT_CONVERT_ALI_HTM 
    SX_OBJECT_CONVERT_ALI_PRT 
    SX_OBJECT_CONVERT_ALI_RAW 
    SX_OBJECT_CONVERT_ICS_RAW 
    SX_OBJECT_CONVERT_INT_RAW 
    SX_OBJECT_CONVERT_OBJ_HTM 
    SX_OBJECT_CONVERT_OTF_PDF 
    SX_OBJECT_CONVERT_OTF_PRT 
    SX_OBJECT_CONVERT_OTF_RAW 
    SX_OBJECT_CONVERT_RAW_SCR 
    SX_OBJECT_CONVERT_RAW_TXT 
    SX_OBJECT_CONVERT_SCR_OTF 
    SX_OBJECT_CONVERT_TXT_INT 
    SX_OBJECT_CONVERT_OBJL_HTM

  • 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.

  • E-mailing logos using SO_NEW_DOCUMENT_SEND_API1

    Hello!
        I would like to send an e-mail with a company logo on it using the function SO_NEW_DOCUMENT_SEND_API1.  I have the HTML portion of the e-mail set up and it is working correctly, but I am lost on the logo part.  I see on a thread here (Sending HTML Mails using SO_DOCUMENT_SEND_API1) that say it can be done.  Can anyone explain how this can be done?  I will reward points quickly for responses.
    Thanks!
    John

    This was resolved by adding the image source from our Intranet site to the HTML.

  • Mail not sent using SO_NEW_DOCUMENT_SEND_API1

    Hi,
    I am using report RSCONN01 after the FM SO_NEW_DOCUMENT_SEND_API1 to send email.
    Eg:
    submit rsconn01 with mode = 'INT'
                    with output = 'X'
                    and return.
    But this report gives a popup which is creating a problem.
    Is there any way to suppress this popup or any other report to send emails.
    Thanks.
    Edited by: Thomas on Feb 24, 2009 10:04 AM
    Edited by: Thomas on Feb 24, 2009 10:06 AM

    Hi,
    i do it like this and don't get an popup.
      SUBMIT RSCONN01 WITH MODE   = 'INT'
                      WITH OUTPUT = ' '
                      AND  RETURN.
    Regards, Dieter

  • Formating the output using SO_NEW_DOCUMENT_SEND_API1

    Hi ,
    I am using the FM 'SO_NEW_DOCUMENT_SEND_API1' for sending data in an internal table as an email . I am wondering whether it will be possible to to send it in the table format with the field names intact. Currently i am able to send the mail but without the table field names . Please help
    Regards,
    Tashi

    hello gurus,
    please check this below program.
    TABLES : ADR6.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    PARAMETERS : SPOOLNO TYPE TSP01-RQIDENT OBLIGATORY.
    SELECT-OPTIONS :  MAILS FOR ADR6-SMTP_ADDR DEFAULT 'xyz.com' OBLIGATORY NO INTERVALS.
    SELECTION-SCREEN END OF BLOCK B1.
    DATA SEND_REQUEST  TYPE REF TO CL_BCS.
    DATA DOCUMENT      TYPE REF TO CL_DOCUMENT_BCS.
    DATA RECIPIENT     TYPE REF TO IF_RECIPIENT_BCS.
    DATA BCS_EXCEPTION TYPE REF TO CX_BCS.
    DATA SENT_TO_ALL   TYPE OS_BOOLEAN.
    DATA PDF_SIZE      TYPE SO_OBJ_LEN.
    DATA PDF_CONTENT   TYPE SOLIX_TAB.
    DATA PDF_XSTRING   TYPE XSTRING.
    DATA MAILTO TYPE AD_SMTPADR.
    START-OF-SELECTION.
      PERFORM CREATE_PDF.
      PERFORM SEND.
    *&      Form  send
    FORM SEND.
      TRY.
        -------- create persistent send request ------------------------
          SEND_REQUEST = CL_BCS=>CREATE_PERSISTENT( ).
        -------- create and set document -------------------------------
          PDF_CONTENT = CL_DOCUMENT_BCS=>XSTRING_TO_SOLIX( PDF_XSTRING ).
          DOCUMENT = CL_DOCUMENT_BCS=>CREATE_DOCUMENT(
                I_TYPE    = 'PDF'
                I_HEX     = PDF_CONTENT
                I_LENGTH  = PDF_SIZE
                I_SUBJECT = 'sending pdf as email' ).           "#EC NOTEXT
        add document object to send request
          SEND_REQUEST->SET_DOCUMENT( DOCUMENT ).
        LOOP AT MAILS. " for sending multiple mails we can use this logic
            MAILTO = MAILS-LOW.
        --------- add recipient (e-mail address) -----------------------
        create recipient object
            RECIPIENT = CL_CAM_ADDRESS_BCS=>CREATE_INTERNET_ADDRESS( MAILTO ).
        add recipient object to send request
          SEND_REQUEST->ADD_RECIPIENT( RECIPIENT ).
      ENDLOOP.
        ---------- send document ---------------------------------------
          SENT_TO_ALL = SEND_REQUEST->SEND( I_WITH_ERROR_SCREEN = 'X' ).
          COMMIT WORK.
          IF SENT_TO_ALL IS INITIAL.
            MESSAGE I500(SBCOMS) WITH MAILTO.
          ELSE.
            MESSAGE S022(SO).
          ENDIF.
      ------------ exception handling ----------------------------------
      replace this rudimentary exception handling with your own one !!!
        CATCH CX_BCS INTO BCS_EXCEPTION.
          MESSAGE I865(SO) WITH BCS_EXCEPTION->ERROR_TYPE.
      ENDTRY.
    ENDFORM.                    "send
    *&      Form  create_pdf
    Create PDF Content
    1) get attributes of spool request
    2) convert spool request to PDF dependent on document type
    FORM CREATE_PDF.
      DATA RQ       TYPE TSP01.
      DATA BIN_SIZE TYPE I.
      DATA DUMMY    TYPE TABLE OF RSPOATTR.
      ------------ get attributes of spool request ---------------------
      CALL FUNCTION 'RSPO_GET_ATTRIBUTES_SPOOLJOB'
        EXPORTING
          RQIDENT     = SPOOLNO
        IMPORTING
          RQ          = RQ
        TABLES
          ATTRIBUTES  = DUMMY
        EXCEPTIONS
          NO_SUCH_JOB = 1
          OTHERS      = 2.
      IF SY-SUBRC <> 0.
        MESSAGE E126(PO) WITH SPOOLNO.
      ENDIF.
      --- convert spool request into PDF, dependent on document type ---
      IF RQ-RQDOCTYPE = 'OTF' OR RQ-RQDOCTYPE = 'SMART'.
        CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
          EXPORTING
            SRC_SPOOLID              = SPOOLNO
            NO_DIALOG                = 'X'
            PDF_DESTINATION          = 'X'
            NO_BACKGROUND            = 'X'
          IMPORTING
            PDF_BYTECOUNT            = BIN_SIZE
            BIN_FILE                 = PDF_XSTRING
          EXCEPTIONS
            ERR_NO_OTF_SPOOLJOB      = 1
            ERR_NO_SPOOLJOB          = 2
            ERR_NO_PERMISSION        = 3
            ERR_CONV_NOT_POSSIBLE    = 4
            ERR_BAD_DSTDEVICE        = 5
            USER_CANCELLED           = 6
            ERR_SPOOLERROR           = 7
            ERR_TEMSEERROR           = 8
            ERR_BTCJOB_OPEN_FAILED   = 9
            ERR_BTCJOB_SUBMIT_FAILED = 10
            ERR_BTCJOB_CLOSE_FAILED  = 11
            OTHERS                   = 12.
        IF SY-SUBRC <> 0.
          MESSAGE E712(PO) WITH SY-SUBRC 'CONVERT_OTFSPOOLJOB_2_PDF'.
        ENDIF.
      ELSEIF RQ-RQDOCTYPE = 'LIST'.
        CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
          EXPORTING
            SRC_SPOOLID              = SPOOLNO
            NO_DIALOG                = 'X'
            PDF_DESTINATION          = 'X'
            NO_BACKGROUND            = 'X'
          IMPORTING
            PDF_BYTECOUNT            = BIN_SIZE
            BIN_FILE                 = PDF_XSTRING
          EXCEPTIONS
            ERR_NO_ABAP_SPOOLJOB     = 1
            ERR_NO_SPOOLJOB          = 2
            ERR_NO_PERMISSION        = 3
            ERR_CONV_NOT_POSSIBLE    = 4
            ERR_BAD_DESTDEVICE       = 5
            USER_CANCELLED           = 6
            ERR_SPOOLERROR           = 7
            ERR_TEMSEERROR           = 8
            ERR_BTCJOB_OPEN_FAILED   = 9
            ERR_BTCJOB_SUBMIT_FAILED = 10
            ERR_BTCJOB_CLOSE_FAILED  = 11
            OTHERS                   = 12.
        IF SY-SUBRC <> 0.
          MESSAGE E712(PO) WITH SY-SUBRC 'CONVERT_ABAPSPOOLJOB_2_PDF'.
        ENDIF.
      ELSE.
        MESSAGE E789(PO) WITH RQ-RQDOCTYPE.
      ENDIF.
      PDF_SIZE = BIN_SIZE.
    ENDFORM.                    "create_pdf

  • Receiver shows in Cc only when using SO_NEW_DOCUMENT_SEND_API1

    I'm using FM SO_NEW_DOCUMENT_SEND_API1 to send external emails from SAP.  I have everything working quite well except...
    The receivers e-mail address only appears in the "Cc" field in the e-mail's header.  I cannot get it to show in the "To" field.

    Hello Donald,
    While populating the Recipient List you must have checked the COPY field of the structure SOMLRECI1.
    DATA:
    wa_reclist TYPE somlreci1,
    it_reclist TYPE STANDARD TABLE OF somlreci1.
    l_wa_reclist-copy = 'X'
    I think this must be the cause.
    BR,
    Suhas
    Edited by: Suhas Saha on Feb 27, 2009 3:22 PM

  • Sending table using SO_NEW_DOCUMENT_SEND_API1

    Dear All,
    I want to display a table in the mail sent from the SAP system using the function module SO_NEW_DOCUMENT_SEND_API1.
    Is there any way to do this? or Is there any other function module for doing this?
    Thanks
    Manik L Dhakate
    Message was edited by:
            Manik Dhakate

    u can send mail as a Excel Atts'. please check this link.
    How to Change Report in XLS Format
    or check Doc_types.
    Regards
    Peram

  • Sending email using SO_NEW_DOCUMENT_SEND_API1 & SO_NEW_DOCUMENT_ATT_SEND_AP

    Hi All,
    I am trying to send a message using the above function modules .. however .. from the beginning of the second line onwards I can see a lot of "SPACES" (leading SPACES from the second line onwards). I am concatenating the fields from an internal table having structure solisti1.
    Please view 2 lines below :-
    e,g.
    1DETAILS OF RECORDS PROCESSED FOR FILEWORKS ON 04/17/2007
    2 -
    SPACES----
                                                                                    The following RECs are in the BDC session

    I am working in ECC 6.0 this is an internal mail to the SAP Business Workplace
    This is part of the code:-
    CONCATENATE 'DETAILS OF RECORDS PROCESSED FOR FILEWORKS ON' l_date INTO
    itabmail2-str SEPARATED BY SPACE.
    Append itabmail2.
    Clear itabmail2.
    form WRITE_STATUS_HEAD.
          CASE  itabtemp-status.
            WHEN 'OK'.
              CONCATENATE '' 'The following RECs are processed sucessfully'
                INTO itabmail2-str SEPARATED BY w_con_tab.
            WHEN 'No SSN'.
              CONCATENATE '' 'The following RECs are bypassed due to invalidity'
                INTO itabmail2-str SEPARATED BY w_con_tab.
            WHEN 'In BDC'.
              CONCATENATE '' 'The following RECs are in the BDC session'
                INTO itabmail2-str SEPARATED BY w_con_tab.
          ENDCASE.
          APPEND itabmail2.
         CLEAR itabmail2.
         CONCATENATE ' ' 'SSN' 'WT 2030' 'WT 2160' 'WT 2031' 'WT 2161' 'WT 2162' 'CURR' INTO itabmail2-str
                       SEPARATED BY w_con_tab.
                      APPEND itabmail2.
                      CLEAR itabmail2.
    endform.                    " WRITE_STATUS_HEAD
    form send_detailed_email .
    data: w_docdata like sodocchgi1 OCCURS 1  WITH HEADER LINE,"Header
    t_objpack   LIKE sopcklsti1 OCCURS 1  WITH HEADER LINE, "Att desc
    t_objhead   LIKE solisti1   OCCURS 1  WITH HEADER LINE, "
    t_objtxt    LIKE solisti1   OCCURS 10 WITH HEADER LINE, "Body
    t_objbin    LIKE solisti1   OCCURS 10 WITH HEADER LINE, "Attachment
    t_objhex    LIKE solix      OCCURS 10 WITH HEADER LINE,
    t_reclist   LIKE somlreci1  OCCURS 1  WITH HEADER LINE,
    w_tab_lines type i,
    w_att_type(3) type c.
    CLEAR:   w_docdata ,w_tab_lines, w_att_type ,
             t_objpack, t_objtxt,    t_objbin,   t_objhex,    t_reclist.
    REFRESH: t_objpack, t_objhead,   t_objtxt,  t_objbin,    t_objhex,
             t_reclist.
    CONCATENATE 'Wageworks Details for run on ' l_date INTO w_docdata-obj_descr SEPARATED BY SPACE.
    t_objtxt = 'Please Open Attachment for Details'.
    Append t_objtxt.
      t_reclist-receiver = 'ADCB123'.
      append t_reclist.
    clear t_objbin.
    loop at itabmail2.
      CONCATENATE itabmail2 l_con_cret INTO t_objbin.
      Append t_objbin.
        if itabmail2+1(5) = 'TOTAL'.
            CONCATENATE '' l_con_cret INTO t_objbin.
            Append t_objbin.
       endif.
    endloop.
    DESCRIBE TABLE t_objtxt LINES w_tab_lines.
      READ TABLE t_objtxt INDEX w_tab_lines.
      w_docdata-doc_size = ( w_tab_lines - 1 ) * 255 + STRLEN( t_objtxt ).
      CLEAR t_objpack-transf_bin.
      t_objpack-head_start = 1.
      t_objpack-head_num = 0.
      t_objpack-body_start = 1.
      t_objpack-body_num = w_tab_lines.
      t_objpack-doc_type = 'XLS'.
      APPEND: t_objpack, w_docdata.
      CLEAR t_objpack.
      DESCRIBE TABLE t_objbin LINES w_tab_lines.
      READ TABLE t_objbin INDEX w_tab_lines.
      CLEAR t_objpack-transf_bin.
      t_objpack-doc_size = ( w_tab_lines - 1 ) * 255 + STRLEN( t_objbin ).
      t_objpack-transf_bin = 'X'.
      t_objpack-head_start = 1.
      t_objpack-head_num = 1.
      t_objpack-body_start = 1.
      t_objpack-body_num = w_tab_lines.
      t_objpack-doc_type = 'XLS'.
    t_objpack-doc_type = 'TXT'.
      t_objpack-obj_name = 'ATTACHMENT'.
      t_objpack-obj_descr = 'List'.
      APPEND t_objpack.
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           EXPORTING
                document_data              = w_docdata
                put_in_outbox              = 'X'
                commit_work                = 'X'  "used from rel. 6.10
           TABLES
                packing_list               = t_objpack
                object_header              = t_objhead
                contents_bin               = t_objbin
                contents_txt               = t_objtxt
                receivers                  = t_reclist
           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.
    SUBMIT rsconn01 WITH mode = 'INT'
    WITH output = 'X'
    EXPORTING LIST TO MEMORY
    AND RETURN.
    endform.                    " send_detailed_email

  • Link to a SAP transaction in the body mail using SO_NEW_DOCUMENT_SEND_API1

    Hi everyone,
    Is it possible to set a link to a text in the body of a mail sent by SO_NEW_DOCUMENT_SEND_API1, in order to navigate to a SAP transaction?
    Example:
    Body (in sbwp):
    Distribution done. Click  here for going to transfer program.
    And the link is a transaction to a report program.
    Regards everybody in advance. Points promised for every help answer.

    Hi
    Re: link to FM
    Regards
    pavan

  • How to use 'so_new_document_send_api1' in background

    Hi All ,
    A Report program contains function module 'so_new_document_send_api1' to send PDF email to external id  .
    Can anyone let me know whether this program will send PDF email , if it is scheduled in backgroud ?
    Thanks in advance.
    U.Varalakshmi.

    HI,
    Check this link for XLS attachement.
    http://www.sapdevelopment.co.uk/reporting/email/attach_xls.htm
    Check this link for PDF attachment.
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Hope it helps
    Regards
    Mansi

  • Pbm iin the alignment of data using SO_NEW_DOCUMENT_SEND_API1

    Hi experts,
    My requirement is to send mail to SAP users. Im usig SO_NEW_DOCUMNET_SEND_API1 fm for sending mail.
    My pbm is that, i want to write 4 field data in (internal table with 4 columns), But the 4 columns are not displayed in the proport format.. That is , each columns should start iin the same line. But its is getting collapsed and not displayed in teh correct format.
    Can anyone tell me how to display data in table format with propor format ?

    HI,
    Concatenate your 4 fields seperated by cl_abap_char_utilities=>horizontal_tab while populating to objtxt tab.
    Regards,
    Vinod.

  • Trapping invalid email address with batch use of SO_NEW_DOCUMENT_SEND_API1

    Hi there,
    Am using SO_NEW_DOCUMENT_SEND_API1 in batch to issue emails containing multiple  blind copied recipients. I load recipient email addresses into RECLIST (see below line)
    "DATA: RECLIST       LIKE SOMLRECI1  OCCURS 0 WITH HEADER LINE.
    I have two problems. My first problem is if any one email address in a batch of 10 recipients is formated incorrectly, none of 10 recipients receive emails. My second problem is "incorrect" email addresses. While these do not prevent the remaining 9 emails being  delivered I would also like to capture these. How might I capture these 2 conditions at or immediately after function module execution for batch reporting ?
    Thank you for your time and help, Harold

    Hi All,
             I have not used that parameter ( Contents_bin ).Its in disable mode only.see my code below and please tell me how to avoid it.
    DESCRIBE TABLE i_body LINES g_att_lines.
    READ TABLE i_body INTO lw_body INDEX g_att_lines.
    gd_doc_data-doc_size = ( g_att_lines - 1 ) * 255 + STRLEN( lw_body ).
    lw_packing_list-transf_bin = space.
    lw_packing_list-head_start = 1.
    lw_packing_list-head_num   = 0.
    lw_packing_list-body_start = 1.
    lw_packing_list-body_num   = g_att_lines.
    lw_packing_list-doc_type   = 'RAW'.
    lw_packing_list-doc_size   = 255 *  g_att_lines.
    APPEND lw_packing_list TO i_packing_list .
    CLEAR lw_packing_list.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
        document_data                    = gd_doc_data
        put_in_outbox                    = 'X'
        commit_work                      = 'X'
    IMPORTING
      SENT_TO_ALL                      =
      NEW_OBJECT_ID                    =
      TABLES
        packing_list                     = i_packing_list
        object_header                    = i_context
        contents_txt                     = i_body
        receivers                        = i_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          .
    Regards,
    Rakesh.

Maybe you are looking for