Send email to external user using fm 'SO_NEW_DOCUMENT_ATT_SEND_API1'

Hi friends,
I wrote this code to send mail to external user from sap.
It did not work properly can anyone help me to send email to extenal user.
The return code after executing the function module is 2.
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS  2 WITH HEADER LINE.
DATA: OBJHEAD LIKE SOLISTI1   OCCURS  1 WITH HEADER LINE.
DATA: OBJBIN  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE.
DATA: OBJTXT  LIKE SOLISTI1   OCCURS 10 WITH HEADER LINE.
DATA: RECLIST LIKE SOMLRECI1  OCCURS  5 WITH HEADER LINE.
DATA: DOC_CHNG LIKE SODOCCHGI1.
DATA: TAB_LINES LIKE SY-TABIX.
Creating the document to be sent
DOC_CHNG-OBJ_NAME = 'OFFER'.
DOC_CHNG-OBJ_DESCR = 'abcd'.
OBJTXT = 'aaaaaaaaaaa:'.
APPEND OBJTXT.
OBJTXT = 'bbbbbbbbbb'.
APPEND OBJTXT.
OBJTXT = 'ccccccccccccc.'.
APPEND OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
RECLIST-RECEIVER = mail address.
RECLIST-REC_TYPE = 'U'.
RECLIST-COM_TYPE = 'INT'.
RECLIST-NOTIF_DEL = 'X'.
RECLIST-NOIF_NDEL = 'X'.
APPEND RECLIST.
Creating the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM   = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM   = TAB_LINES.
OBJPACK-DOC_TYPE   = 'RAW'.
APPEND OBJPACK.
Creating the document attachment
(Assume the data in OBJBIN are given in BMP format)
OBJBIN = ' \O/ '. APPEND OBJBIN.
OBJBIN = '     '. APPEND OBJBIN.
OBJBIN = ' / \ '. APPEND OBJBIN.
DESCRIBE TABLE OBJBIN LINES TAB_LINES.
OBJHEAD = 'picasso.bmp'. APPEND OBJHEAD.
Creating the entry for the compressed attachment
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM   = 1.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM   = TAB_LINES.
OBJPACK-DOC_TYPE   = 'BMP'.
OBJPACK-OBJ_NAME   = 'ATTACHMENT'.
OBJPACK-OBJ_DESCR = 'Reproduction object 138'.
OBJPACK-DOC_SIZE   = TAB_LINES * 255.
  APPEND OBJPACK..
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
     EXPORTING
          DOCUMENT_DATA = DOC_CHNG
          PUT_IN_OUTBOX = 'X'
          COMMIT_WORK   = 'X'
     TABLES
          PACKING_LIST  = OBJPACK
          OBJECT_HEADER = OBJHEAD
         CONTENTS_BIN  = OBJBIN
           CONTENTS_TXT  = OBJTXT
           RECEIVERS     = RECLIST
      EXCEPTIONS
           TOO_MANY_RECEIVERS = 1
           DOCUMENT_NOT_SENT  = 2
           OPERATION_NO_AUTHORIZATION = 4
           OTHERS = 99.
IF SY-SUBRC NE 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

Hi,
Check in SCOT t-code whether it has been properly configred to send the mails
Regards,
siva chalasani.

Similar Messages

  • How to send email to external users using the distribution list from workflow

    I have created distribution list in SO23 with external email addresses.
    How I can use distribution list in "Send Mail component" or I should use another component?
    It works fine for a single email address. And distribution list works fine when I use it via SBWP.

    Hi,
      Take activity step instead of Mail step. User fm SO_NEW_DOCUMENT_ATT_SEND_API1 to send mail.
    And use fm SO_DLI_READ_API1 to find list of user from    distribution list. You can    find how to use this fm in rule 30000012

  • Send email to multiple users using form

    I am using following code to send email from forms.
    But i want to send email to multiple users like atleast 10 users
    It i sworking for one user.
    If i give mail_pkg.send('tim@'oracle.com;[email protected]','Testing Oracle forms to send email','Testing oracle forms to send email','c:/x.pdf');
    The email is not going
    Can anybody help how to send to multiple users
    Thanks for your help
    T
    PACKAGE Mail_pkg IS
    session OLE2.OBJ_TYPE; /* OLE object handle */
    args OLE2.LIST_TYPE; /* handle to OLE argument list */
    procedure logon( Profile IN varchar2 default NULL );
    procedure logoff;
    procedure send( Recp IN varchar2,
    Subject IN varchar2,
    Text IN varchar2,
    Attch IN varchar2
    END;

    As said,
    Reports9i is better than Reports6i as far as sending emails is concerned. Reports9i allows you to send Reports in different formats as email attachements (PDF v3 is only one option). You can set subject, cc, bcc and some body text the way you want it. The Reports server only needs the address of a SMTP Server and you are ready to go. In Reports6i this is a bit more limited as you are not able to provide your own subject and body texts.
    I know that you can do this with PL/SQL from teh databae, but never tried it before.
    There is another option, which is to use a Java Bean in Forms for email. Thsi only works on the Web and a demo is included in teh Forms9i demos that can be downloaded from OTN. Though the demo is written for Forms9i it should work with Forms6i as well (not the Forms demo files because they are created in Forms9i).
    Fran

  • Help with sending emails to multiple users.

    Currently we have a process to send mail to muliple users by looping through the list of users and sending each individual an email
    <Action id='1' name='sendEmail' application='com.waveset.provision.WorkflowServices'>
    <Argument name='op' value='notify'/>
    <Argument name='template' value='$(template)'/>
    <Argument name='toUser' value='$(tuser)'/>
    <Argument name='catch' value='notificationException'/>
    </Action>
    The variable tuser contains a single email address.
    Is there any way to setup tuser to contain multiple email addresses?
    I have tried passing a list and a string separated by colons (ex: <s>[email protected]; [email protected]</s>) and neither one works.
    Question 2
    Is it a bad idea to try and send email to up to 50000 users at once using IDM? Besides the fact that I would need to search for specific users and get their email addresses based on their capabilities.

    Hi,
    For sending emails to multiple users, use to instead of toUser. Put the names in comma seperated values
    <Action id='0' application='com.waveset.provision.WorkflowServices'>
    <Argument name='op' value='notify'/>
    <Argument name='template' value='$(template)'/>
    <Argument name='to' value='$(to)'/>
    <Argument name='cc' value='$(cc)'/>
    <Argument name='catch' value='notificationException'/>
    </Action>
    You can use IDM to send emails.
    it will be a good idea to break down the email that you are sending into groups/batches. If possible, you can send email to DL s
    Else, you can segregate the users based on roles and send emails. This will reduce the load. Hope it helps
    Regards
    Arjun
    Edited by: arjun.sengupta on Dec 4, 2012 3:26 AM

  • How to send an  email to external user (offline form) from se38

    Hi all
    how to send an  email to external user (offline form) from se38 and upload the same from recipent.
        we have sent mail using scripts and smartforms but couldnt do here. It will be helpful if you can give us any sample code
    regards
    mohammed

    Hi,
    Have a look at this thread [Re: Sending PDF forms (created using SFP) as Email Attachment]  i explain all the solution with a sample code .
    Hope it's help you
    regards

  • Send email on external email address using sap workflow

    Dear All,
    I wat to send email( on external email address) to all users on under one position in org unit using sap workflow.
    I have retrived all users under given postion using FM   'RH_OM_GET_HOLDER_OF_POSITION'.
    Please let me know how to get their email ids.
    Thanks & Regards
    Rajshree

    Hi Rajasree,
    You can get the email address by passing the PERNR of employee and read the infotype '0105' (communication) with subtype '0010'.
    DATA: lt_p0105 LIKE p0105 OCCURS 0 WITH HEADER LINE.
    CALL FUNCTION 'HR_READ_INFOTYPE'
       EXPORTING
    *   TCLAS                 = 'A'
        pernr                 = pernr
        infty                 = '0105'
        begda                 = sy-datum
        endda                 = sy-datum
    *   BYPASS_BUFFER         = ' '
    *   LEGACY_MODE           = ' '
    * IMPORTING
    *   SUBRC                 =
       TABLES
         infty_tab             = lt_p0105
      EXCEPTIONS
        infty_not_found       = 1
        OTHERS                = 2.
    IF sy-subrc <> 0.
    * Implement suitable error handling here
    ENDIF.
    READ TABLE lt_p0105 WITH KEY subty = '0010'.
    email = lt_p0105-usrid_long.
    Regards,
    Pipit

  • How to send HTML email to End User using OOTB email processs?

    Hi,
    We are using OOTB Send email process to send email to end user.
    Templates has been created inside /etc/workflow/ProjectName/email folder.
    Its working properly for plain text email.but for html template ,It send the email with html tags.
    Any pointer on how to write html template for OOTB email process and activate email type as html ?
    Thanks
    Deepika

    Thanks Sham..
    I am able to send HTML email following above link.
    The problem i am facing is,When i am deploying the code through crxde.Code is working fine.
    But using maven deploy..Bundle get activated ..But at line:
    messageGateway = this.messageGatewayService.getGateway(HtmlEmail.class);
    ,it gives null Pointer exception.
    Any pointer,why its not working from maven deployment.
    Regards
    Deepika

  • How to send emails to Multiple Users from a Single People Picker lookup field using Sharepoint designer workflow

    Hi All,
    I am working with SharePoint 2013 designer workflow. we are using office 365.
    Our requirement to send email to multiple users, get the user groups from lookup list people and groups column.
    But SP designer sending emails to the first user alone.
    Please guide me to proceed.
    Advance Thanks.
    Regards
    Jenkins NS
    Thanks and Regards Jenkins

    finally I got a solution
     Identified a workaround to solve the issue using SharePoint designer.
    Step 1
    Create a lookup list Example department
    Columns
    Title (by default) – Single line of text
    Users – Person or Group
    Emails – Multiple lines of text
    hidden the Emails column (go to content type and set the column as hidden)
    Create a SharePoint designer Workflow
    Start Workflow automatically when an item is created
    Also Start Workflow automatically when an item is changed
    Workflow Stage 1
    Set Emails to current Item: Users
    The workflow will get all users email ids and add in the Emails column delimiter as semicolon.
    Step 2
    Create a custom list to get the email ids and send email
    Create a lookup column ex: analysis and refer department list, Allow multiple values
    Then Create a SharePoint designer workflow
    full details workflow steps please follow below
    URL
    http://jenkinsblogs.com/2015/04/30/how-to-send-emails-to-multiple-users-from-lookup-list-people-picker-field-using-sharepoint-designer-workflow/
    Thanks and Regards Jenkins

  • Send smartform to multiple users using std. smartform interface

    Hello All,
    Below is the requirement : -
    While doing an external send against the custom output type in transaction VF02, smartform is automatically send to the appropriate email address as pdf attachment. This email address can be sold to party/bill to party etc and it is controlled using configuration.
    Now the prb is, using such configuration we can send email to single email id only. I need to send the email to multiple users using the standard smartform interface ONLY i.e by using the parameter MAIL_RECEPIENT in the std. smartform interface.
    I have alredy evaluated the below workarounds for the above solution, but we need to implement the above functionality using standard smartform interface only.
    1) Convert the smartform OTF data to PDF format data and then send the PDF attachment via email to multiple recipients using the standard FM SO_NEW_DOCUMENT_ATT_SEND_API1.
    2) Loop at the recipients table and within the loop pass different recipient to the interface parameter MAIL_RECIPIENT of smartform. Hence in this case smartform will be called within the loop which can cause performance issues incase of multiple recipients. Also the mail will be sent individually to every recipient.
    3) I have already checked by passing the distribution list the parameter MAIL_RECEIPIENT but it does not work.
    Looking forward for your responses.
    Regards,
    R.Doshi

    Hi
    Check if SAP Note 1260015 - Sending mail to multiple recipients is useful for your requirements.
    Regards
    Eduardo

  • Send email to multiple user

    All experts:
        I want to send an email to multiple user, I use the FM:SO_NEW_DOCUMENT_SEND_API1,
    this FM can to mutiple user's email address ,but it can not re-set the email sender.
    another FM is: EFG_GEN_SEND_EMAIL, this FM can re-set the email sender and email receiver, but this only can send one email to one receiver.
    My question is, can anyone tell me how to send email to mutiple user,
    e.g.: sender: abc/at/abc.com
            receiver 1  cdg/at/abc.com
            receiver 2   dd/at/hotmail.com
    I want to send this email to both them at a time. and i can dynamic set the email sender.
    Thanks in advance.

    Hi,
    It is a good practice to write a function to send email and use this function as much as you want.
    Please create the following function exactly,
    it will help you:
    You see imports and exports of this function:
    TO1 through TO3 is the mail adresses you can pass. You can use just one of them or all of them.
    And  you can use the  BODY STRUCTURE  TLINE OPTIONAL
    as the contents of the email.
    Hope helps.
    FUNCTION Z_PA_SENDMAIL.
    *"*"Local interface:
    *"  IMPORTING
    *"     VALUE(TO1) LIKE  ADR6-SMTP_ADDR
    *"     VALUE(TO2) LIKE  ADR6-SMTP_ADDR OPTIONAL
    *"     VALUE(TO3) LIKE  ADR6-SMTP_ADDR OPTIONAL
    *"     VALUE(SUBJECT) LIKE  TZV51-XBRIEF
    *"     VALUE(ATT_TYPE) LIKE  SOOD-OBJTP OPTIONAL
    *"     VALUE(ATT_NAME) LIKE  SOOD-OBJNAM OPTIONAL
    *"     VALUE(ATT_DESC) LIKE  SOOD-OBJDES OPTIONAL
    *"     VALUE(NOTIF_DEL) LIKE  SOMLRECI1-NOTIF_DEL OPTIONAL
    *"     VALUE(NOTIF_READ) LIKE  SOMLRECI1-NOTIF_READ OPTIONAL
    *"     VALUE(NOTIF_NDEL) LIKE  SOMLRECI1-NOTIF_NDEL DEFAULT 'X'
    *"     VALUE(SEND_AS) LIKE  SOEXTRECI1-RECEIVER DEFAULT SPACE
    *"  EXPORTING
    *"     VALUE(SENT_FLAG) LIKE  SOPR-FLAG1
    *"  TABLES
    *"      BODY STRUCTURE  TLINE OPTIONAL
    *"      ATTCH STRUCTURE  SOLISTI1 OPTIONAL
    *"  EXCEPTIONS
    *"      TOO_MANY_RECEIVERS
    *"      DOCUMENT_NOT_SENT
    *"      OPERATION_NO_AUTHORIZATION
    data: doc_chng like sodocchgi1.
    data : objpack like sopcklsti1   occurs 10 with header line,
            objhead like solisti1     occurs 10 with header line,
            objbin  like solisti1     occurs 10 with header line,
            objtxt  like solisti1     occurs 10 with header line,
            reclist like somlreci1    occurs 10 with header line.
    data: tab_lines like sy-tabix.
    data: sent_to_all like sonv-flag.
    objtxt[] = body[].
    objbin[] = attch[].
    doc_chng-obj_name  = 'Mail'.
    doc_chng-obj_descr = subject.
    * Creation of the entry for the compressed document
    describe table objtxt lines tab_lines.
    clear objpack-transf_bin.
    objpack-head_start = 1.
    objpack-head_num = 0.
    objpack-body_start = 1.
    objpack-body_num = tab_lines.
    read table objtxt index tab_lines.
    objpack-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
    doc_chng-doc_size = doc_chng-doc_size + objpack-doc_size.
    objpack-doc_type = 'RAW'.
    objpack-obj_name  = 'Body'.
    objpack-obj_descr = subject.
    append objpack.
    describe table objbin lines tab_lines.
    if tab_lines > 0.
      objpack-transf_bin = 'X'.
      objpack-head_start = 1.
      objpack-head_num = 0.
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
      read table objbin index tab_lines.
      objpack-doc_size = ( tab_lines - 1 ) * 255 + strlen( objbin ).
      doc_chng-doc_size = doc_chng-doc_size + objpack-doc_size.
      objpack-doc_type = att_type.
      objpack-obj_name = att_name.
      objpack-obj_descr = att_desc.
      append objpack.
    endif.
    reclist-rec_type  = 'U'.
    reclist-notif_del = NOTIF_DEL.
    reclist-notif_read = NOTIF_READ.
    reclist-notif_ndel = NOTIF_NDEL.
    reclist-receiver  = to1.
    append reclist.
    if not to2 is initial.
      reclist-receiver  = to2.
      append reclist.
    endif.
    if not to3 is initial.
      reclist-receiver  = to3.
      append reclist.
    endif.
    delete reclist where receiver eq space.
      call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
           exporting
                document_data              = doc_chng
                put_in_outbox              = ' '
                commit_work                = 'X'
    *            SENDER_ADDRESS             = send_as
           importing
                sent_to_all                = sent_flag
           tables
                packing_list               = objpack
                object_header              = objhead
                contents_bin               = objbin
                contents_txt               = objtxt
                receivers                  = reclist
           exceptions
                too_many_receivers         = 1
                document_not_sent          = 2
                operation_no_authorization = 4
                others                     = 99.
      case sy-subrc.
       when 0.
    * SUCCESS
       when 1.
        raise TOO_MANY_RECEIVERS.
       when 2.
        raise DOCUMENT_NOT_SENT.
       when 4.
        raise OPERATION_NO_AUTHORIZATION.
       when others.
        raise OTHERS.
      endcase.
    ENDFUNCTION.

  • Unable to send email to the users from Project Server Workflow

    Hello all,
    I am facing issues in sending emails to the users from the workflow in SharePoint Designer 2013.
    I am trying to send emails to valid users in a Project server 2013 Workflow by Email action.
    I have set up the SMTP server successfully, I have configured SMTP server successfully in IIS manager 6.0
    I have configured the outgoing e-mail settings in Central Administration successfully,
    I have configured the SMTP email settings for my web app in IIS manager as well.
    I have configured and synced the User Profile App with the eMail addresses from Active Directory as well.
    I have configured the Alerts and Reminders in Operational Policies of PWA settings as well.
    I can send the emails to the users successfully through Powershell.
    But when I am trying to Start a Task Process with a user in the workflow, the task process starts but it never sent an email notification. So I tested by using the Action Email, that also the user is unable to receive any email. But the Workflow is not giving
    any error also. The email sending is successful, but the user is unable to receive it. The workflow succeeds to next phase without any errors.
    So to cross verify I tried 'Alert Me' option on a list, but that also is not sending(or might be sending but the user is not receiving) the mail.
    What else should I do to solve this issue.
    Please help me.
    Thanks,
    Shanky

    Hello Paul,
    I tried editing the PWA instance as you said, but that also didn't help :(
    I even restarted the Project Server Service, but nothing is changed. 
    I tried creating a new workflow for a List and used send email there, but that also is not sending the mail :(
    How do I check where the issue is from ? I mean, whether the workflow is sending the mail and the mail server is not receiving? or whether the workflow is not sending the mail itself? how do I check this? Is there any way to log these details?
    Please help me regarding this issue, I am totally clueless how to proceed.
    Thanks,
    shanky

  • Groupwise not send mails to external users

    Hello everyone.
    I did a clean install of SBE with eDirectory, iManager, and Groupwise. Just when the installation can send emails to a user outside the domain (external user), but after restarting the mail server does not come to any external users, but if I receive them.

    Originally Posted by amoron
    Hello everyone.
    I did a clean install of SBE with eDirectory, iManager, and Groupwise. Just when the installation can send emails to a user outside the domain (external user), but after restarting the mail server does not come to any external users, but if I receive them.
    Did you setup internet addressing? Currently you have to manually setup internet addressing in Console One when setting up groupwise8 (see the docs for a how-to, its very easy). Without internet addressing, you'll be able to send emails to internal users, but not to external users, which seems to be the problem you are having.
    Just FYI, this internet addressing problem is being addressed in the next patch, which is currently in testing.
    -Hart

  • Send Emails to Multiple Users ?

    Hi,
    I am working on the requirement where I need to create workflow in which I am sending email to multiple users. I have receiver list in a 'Z' Table. So I have to fetch those users from the 'Z' table on some conditions and send emails to them. I am send email to single user mentioned statically in Receipent box but I need to find the receivers dynamically and not able to send email to multiple users.
    Please help me in this.
    Thanks,
    Ketan

    Hi Ketan,
    First af all create one MULTILINE container in your workflow say LT_EMAIL. its type should be SOXNA-FULLNAME.
    Then thorugh some activity step, fill all the recepient's email addresses in workflow container LT_EMAIL. Then create one activity step type to send an email using SENDRASKDESCRIPTION method of business object SELFITEM. in the ADDRESSSTRING pass the multiple container LT_EMAIL and in TYPEID pass 'U'.
    refere below link for BO programming in sap workflow Useful SAP Business Object Type programming macros.
    Regards,
    Ibrahim

  • Send email to distribution list using OOP...

    Hello Experts,
    I currently have a requirement to send email(w/o attachment) to a distribution list or specific user. I have searched the forum and it doesnt suit my requirement as the examples gives only how to send email to specific user/s. Any inputs would be appreciated.
    Thank you guys and take care!

    Hi ,
    For sending mail with attachments in multiple sheets of an excel document please see the
    sample code below:
    REPORT  ZBC_ITAB_TO_EXCEL_NEW                   .
    CLASS: cl_abap_char_utilities DEFINITION LOAD.
    DATA: docdata LIKE sodocchgi1,
          objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
          objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
          objbin1 LIKE solisti1 OCCURS 10 WITH HEADER LINE,
          objbin2 LIKE solisti1 OCCURS 10 WITH HEADER LINE,
          objbin_final LIKE solisti1 OCCURS 10 WITH HEADER LINE,
          reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE,
          tab_lines TYPE sy-tabix.
    DATA: gd_sender_type LIKE soextreci1-adr_typ.
    DATA: c_tab TYPE c VALUE cl_abap_char_utilities=>horizontal_tab,
          c_ret TYPE c VALUE cl_abap_char_utilities=>cr_lf.
    DATA: c_dev TYPE sy-sysid.
    DATA: BEGIN OF i_data OCCURS 0,
          a(20),
          b(20),
          END OF i_data.
    DATA: BEGIN OF st,
          f1(2) TYPE c,
          f2(2) TYPE n,
          END OF st.
    DATA: itab1 LIKE TABLE OF st WITH HEADER LINE,
          itab2 LIKE TABLE OF st WITH HEADER LINE.
    DATA: n TYPE i.
    PARAMETER: p_email1 LIKE somlreci1-receiver
               p_sender LIKE somlreci1-receiver.
    START-OF-SELECTION.
      itab1-f1 = 'AA'. itab1-f2 = '01'. APPEND itab1.
      itab1-f1 = 'BB'. itab1-f2 = '02'. APPEND itab1.
      itab1-f1 = 'CC'. itab1-f2 = '03'. APPEND itab1.
      itab2-f1 = 'ZZ'. itab2-f2 = '26'. APPEND itab2.
      itab2-f1 = 'YY'. itab2-f2 = '25'. APPEND itab2.
      LOOP AT itab1.
        CONCATENATE itab1-f1 itab1-f2 INTO objbin1 separated BY c_tab.
        CONCATENATE c_ret objbin1 INTO objbin1.
        APPEND objbin1.
      ENDLOOP.
      LOOP AT itab2.
        CONCATENATE itab2-f1 itab2-f2 INTO objbin2 separated BY c_tab.
        CONCATENATE c_ret objbin2 INTO objbin2.
        APPEND objbin2.
      ENDLOOP.
      LOOP AT objbin1.
        MOVE objbin1-line TO objbin_final-line.
        APPEND objbin_final.
      ENDLOOP.
      LOOP AT objbin2.
        MOVE objbin2-line TO objbin_final-line.
        APPEND objbin_final.
      ENDLOOP.
      PERFORM process_email.
      c_dev = sy-sysid.
      IF sy-sysid = c_dev.
        wait up to 5 seconds.
        SUBMIT rsconn01 WITH mode = 'INT'
        WITH output = 'X'
        AND RETURN.
      ENDIF.
      IF sy-subrc = 0.
        WRITE: / 'Email succesfilly delivered'.
      ELSE.
        WRITE: / 'failure'.
      ENDIF.
    *&      Form  process_email
    *       text
    FORM process_email.
      IF p_sender EQ space.
        gd_sender_type = space.
      ELSE.
        gd_sender_type = 'INT'.
      ENDIF.
    *Body
      docdata-obj_name = 'Mail_Excel_File'.
      docdata-obj_descr = 'Excel file attachment'.
      objtxt = 'Attached is the sample Excel file'.
      APPEND objtxt.
      DESCRIBE TABLE objtxt LINES tab_lines.
      READ TABLE objtxt INDEX tab_lines.
      docdata-doc_size = ( tab_lines - 1 ) * 255 + strlen( objtxt ).
      CLEAR objpack-transf_bin.
      objpack-head_start = 1.
      objpack-head_num = 0.
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
      objpack-doc_type = 'RAW'.
      APPEND objpack.
    *Attachment
      n = 1.
      DESCRIBE TABLE objbin1 LINES tab_lines.
      objpack-doc_size = tab_lines * 255.
      objpack-transf_bin = 'X'.
      objpack-head_start = 1.
      objpack-head_num = 1.
      objpack-body_start = n.
      objpack-body_num = tab_lines.
      objpack-doc_type = 'XLS'.
      docdata-obj_name = 'Excel_File_Attachment1'.
      objpack-obj_descr = 'Excel File Attachment1'.
      APPEND objpack.
      n = n + tab_lines.
      DESCRIBE TABLE objbin2 LINES tab_lines.
      objpack-doc_size = tab_lines * 255.
      objpack-transf_bin = 'X'.
      objpack-head_start = 1.
      objpack-head_num = 1.
      objpack-body_start = n.
      objpack-body_num = tab_lines.
      objpack-doc_type = 'XLS'.
      docdata-obj_name = 'Excel_File_Attachment2'.
      objpack-obj_descr = 'Excel File Attachment2'.
      APPEND objpack.
    *Create the list of recipients
      reclist-receiver = p_email1.
      reclist-rec_type = 'U'.
      reclist-express = 'X'.
      APPEND reclist.                 "For sending mail to multiple ids append this internal table with your reqd ids
    *Send the e-mail
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = docdata
          put_in_outbox              = 'X'
          commit_work                = 'X'
        TABLES
          packing_list               = objpack
          contents_bin               = objbin_final
          contents_txt               = objtxt
          receivers                  = 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.
      COMMIT WORK.
    ENDFORM.                    "process_email
    Hope it helps,
    Regards
    Mansi
    Edited by: MANSI  ASNANI on Oct 13, 2009 7:56 AM

  • Send Email to ESs user

    hi Expert,
    How do we send email to ess User, so that when the user login to the ess he/she can see the email? And further more where exactly he/she will read the email? is there any specifi iview for that? I tried to send email via SAP Business workplace to ess user but when i login ess i just can't find the email. thanks
    Edited by: Hendri Salim on Jun 30, 2010 12:24 PM

    Hi,
    As per my understanding there are two option for sending email.
    1) Through Work Flow.
    2) Through Program.
    In program or function module please use sap standard function module to send e mails.
    You can use the FM SO_OBJECT_SEND.
    The mail can be read in outlook, lotus notes etc.
    Thanks & Regards,
    Sandip Biswas.

Maybe you are looking for

  • Expanding text fields to fit text

    I have a customer who would like to be able to put large amounts of text into a text field and have it all print. The amount of text can vary, so he would like to have a box where he can enter the text and have the box size adjust to the amount of te

  • Camera raw Workflow?

    1.) Can you edit raw format files in Photoshop CS5 or do you have to do this in Camera Raw? 2.) Which edits should be done in Camera Raw before bringing the file into PhotoShop? White balance, tonal range, contrast, color saturation, sharpening? What

  • Inconsistent type weight when printing pdf (acrobat X)?

    I am having trouble getting type type in my pdf document to appear consistent when printing to the office printer. - the file is originally a ID CS6 document - I export to press quality - the typeface in question is an open type font - the pdf looks

  • Urgent: Rebate Accrual VOB3

    Hi Gurus I have made final settlement for a rebate agreement but still some accrual is coming up in rebate agreement. I went to transaction VOB3 there i could see the difference in Settled Accruals and Accrued amount. What is this settled accrual mea

  • Whats wrong with my work flow

    Ok this is my work flow for color and I am having problem at the very last stage of retuning to fcp. I have tried with DVCPRO changed to apl pro res and still it crashes. but then it can surprise me and it works so I retest and it's crash next time.