Use Table and atthacment and sending mail

Hi ,
With help from this forum i success in sending mail with internal and other program that send mail with attachment,
now the last thihng is to combin of the both,
i try do do it like this way (below) and i get 2 diifrent mail ,
Now i now that i give the mail adress twice and i write all thing twice and i not had to ,
but when i do it once it send just the : send_request , document, recipient...not with IO_....
i write it twice for the help.
i new In Abap OO how can i solve this ?
Regards
TRY.
    send_request = cl_bcs=>create_persistent( ).
    lo_send_request = cl_bcs=>create_persistent( ).
    lo_document = cl_document_bcs=>create_document( i_type = 'HTM'
                                                    i_text = lt_html[]
                                                    i_subject = 'Table' ).
    document = cl_document_bcs=>create_document( i_type    = 'RAW'
                                                 i_text    = lt_text
                                                 i_subject = 'Check this' ).
    APPEND 'Test Message' TO lt_text.
    document->add_attachment( EXPORTING i_attachment_type    =  'BIN'
                                        i_attachment_subject = mail_type
                                        i_att_content_hex    = lt_attach ).
    lo_send_request->set_document( lo_document ).
    send_request->set_document( document ).
    recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
    lo_recipient = cl_cam_address_bcs=>create_internet_address( mailto ).
    send_request->add_recipient( i_recipient = recipient  i_express   = 'X' ).
    lo_send_request->add_recipient( i_recipient = lo_recipient  i_express = 'X' ).
    send_request->set_send_immediately( 'X' ).
    sent_to_all = send_request->send( i_with_error_screen = 'X' ).
    lo_send_request->add_recipient( EXPORTING i_recipient = lo_recipient
    i_express = 'X' ).
    lo_send_request->set_send_immediately( 'X' ).
    lv_sent_to_all = lo_send_request->send( 'X' ).
    COMMIT WORK.
  CATCH cx_bcs INTO bcs_exception.
    lv_error_txt = bcs_exception->get_text( ).
    WRITE:`Error : ` , lv_error_txt.
    EXIT.
ENDTRY
Regards

I close it,
i sorry but somehow i dont see this post after i send it for 20 minute

Similar Messages

  • I have a scenario. Import IDOC into PI and PI transform IDOC to Excel. Using mail adapter attach that Excel using pi and send to customer. Can you please help me on the same?

    HI Experts,
    I have a scenario. Import IDOC into PI and PI transform IDOC to Excel. Using mail adapter attach that Excel using pi and send to vendor. Can you please help me on the same?
    Thanks
    SaiSreevastav

    Hi Sai,
    you can use XSLT or java mapping or adapter module to convert IDOC xml to XLS. Please refer the below blog
    Convert incoming XML to Excel or Excel XML – Part 1 - XSLT Way
    Convert incoming XML to Excel Sheet Part 2 – Adapter Module way
    Convert incoming XML to Excel Sheet
    then after converting to Excel, you can use the payloadswap bean in mail adapter
    XI: Sender mail adapter - PayloadSwapBean - Step by step
    regards,
    Harish

  • How to setup and send mails using utl_mail on Oracle E-Biz R12

    Dear All
    There is a new requirement from client to setup and send mails using utl_mail utility on Oracle EBS R12.1.1
    What is utl_mail utility ? what is the difference between Workflow Notification Mailer and this utility/tool?
    What are etiquette's to pursue mail functionality in apps / db?
    - Chetan

    What is utl_mail utility
    http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_mail.htm
    How to Use the UTL_MAIL Package [ID 269375.1]
    FAQ and Known Issues While Using UTL_SMTP and UTL_MAIL [ID 730746.1]
    Master Note For PL/SQL UTL_SMTP and UTL_MAIL Packages [ID 1137673.1]
    Workflow Notification Mailer:
    you can send email using workflow notification email procedures,These ar built into the system and only need some minor configuration. check Workflow Administrator's Guide, Chapter 2, Section: Setting Up Notification Mailers for more detail.

  • Mine is Yahoo where POP is used .TB is IMAP . i can receive and send mails , but when making action on TB (Del or send) no reflection on main server

    Hello there,
    My e-mail is Yahoo, and Yahoo by default is POP user .
    I understood from your help file that synchronization is compatible only with IMAP mail provider
    I can receive and send mails from TB , but when making action on TB (Del or send) no reflection on main server, same when make the action on the main server (Del or send), no change on TB
    from yahoo help I managed to find configuration for IMAP , but could not apply them on TB , as TB have already Yahoo as POP in the configuration list
    please your help on this
    best regards
    Mohamad

    You cannot convert an existing account, but you can set up your Yahoo account as IMAP in parallel to the existing POP account. See
    http://kb.mozillazine.org/Convert_a_POP_account_to_a_IMAP_account

  • Convertion of Smart form to pdf and sending mail to vendor for PO

    Hello all,
    I have modified a standard PO Smartform and running it through ME23N.
    In this i have to convert it to a pdf file and then send it through mail to the vendor.
    I have found out FMs'CONVERT_OTF'and
    'SO_NEW_DOCUMENT_ATT_SEND_API1'
    to convert it and send mail. But can u tell me how to go about using it.
    As i am using a standard program do i have to copy this prog to zprog and then call the fm out there. I am not sure.
    Thanks
    Salil

    Hi,
    Here is the sample code.If you find this as useful,kindly reward points by clicking the star on the left of reply.
    Internal Table declarations
    DATA: i_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
          i_tline TYPE TABLE OF tline WITH HEADER LINE,
          i_receivers TYPE TABLE OF somlreci1 WITH HEADER LINE,
          i_record LIKE solisti1 OCCURS 0 WITH HEADER LINE,
    Objects to send mail.
          i_objpack LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
          i_objtxt LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          i_objbin LIKE solisti1 OCCURS 0 WITH HEADER LINE,
          i_reclist LIKE somlreci1 OCCURS 0 WITH HEADER LINE,
    Work Area declarations
          w_objhead TYPE soli_tab,
          w_ctrlop TYPE ssfctrlop,
          w_compop TYPE ssfcompop,
          w_return TYPE ssfcrescl,
          w_doc_chng typE sodocchgi1,
          w_data TYPE sodocchgi1,
          w_buffer TYPE string,"To convert from 132 to 255
    Variables declarations
          v_form_name TYPE rs38l_fnam,
          v_len_in LIKE sood-objlen,
          v_len_out LIKE sood-objlen,
          v_len_outn TYPE i,
          v_lines_txt TYPE i,
          v_lines_bin TYPE i.
    call function 'SSF_FUNCTION_MODULE_NAME'
         exporting
              formname           = 'ZZZ_TEST2'
         importing
              fm_name            = v_form_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.
    w_ctrlop-getotf = 'X'.
    w_ctrlop-no_dialog = 'X'.
    w_compop-tdnoprev = 'X'.
    CALL FUNCTION v_form_name
         EXPORTING
              control_parameters = w_ctrlop
              output_options     = w_compop
              user_settings      = 'X'
         IMPORTING
              job_output_info    = w_return
         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.
    i_otf[] = w_return-otfdata[].
    CALL FUNCTION 'CONVERT_OTF'
         EXPORTING
              format                = 'PDF'
              max_linewidth         = 132
         IMPORTING
              bin_filesize          = v_len_in
         TABLES
              otf                   = i_otf
              lines                 = i_tline
         EXCEPTIONS
              err_max_linewidth     = 1
              err_format            = 2
              err_conv_not_possible = 3
              OTHERS                = 4.
    IF sy-subrc <> 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
      WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Convert PDF from 132 to 255.
    LOOP AT i_tline.
    Replacing space by ~
      TRANSLATE i_tline USING ' ~'.
      CONCATENATE w_buffer i_tline INTO w_buffer.
    ENDLOOP.
    Replacing ~ by space
    TRANSLATE w_buffer USING '~ '.
    DO.
      i_record = w_buffer.
    Appending 255 characters as a record
      APPEND i_record.
      SHIFT w_buffer LEFT BY 255 PLACES.
      IF w_buffer IS INITIAL.
        EXIT.
      ENDIF.
    ENDDO.
    Refresh: i_reclist,
             i_objtxt,
             i_objbin,
             i_objpack.
    clear    w_objhead.
    Object with PDF.
    i_objbin[] = i_record[].
    DESCRIBE TABLE i_objbin LINES v_lines_bin.
    Object with main text of the mail.
    i_objtxt = 'Find attached the output of the smart form.'.
    APPEND i_objtxt.
    i_objtxt = 'Regards,'.
    APPEND i_objtxt.
    i_objtxt = 'J.Jayanthi'.
    APPEND i_objtxt.
    DESCRIBE TABLE i_objtxt LINES v_lines_txt.
    Document information.
    w_doc_chng-obj_name = 'Smartform'.
    w_doc_chng-expiry_dat = sy-datum + 10.
    w_doc_chng-obj_descr = 'Smart form output'.
    w_doc_chng-sensitivty = 'F'. "Functional object
    w_doc_chng-doc_size = v_lines_txt * 255.
    Pack to main body as RAW.
    Obj. to be transported not in binary form
    CLEAR i_objpack-transf_bin.
    Start line of object header in transport packet
    i_objpack-head_start = 1.
    Number of lines of an object header in object packet
    i_objpack-head_num = 0.
    Start line of object contents in an object packet
    i_objpack-body_start = 1.
    Number of lines of the object contents in an object packet
    i_objpack-body_num = v_lines_txt.
    Code for document class
    i_objpack-doc_type = 'RAW'.
    APPEND i_objpack.
    Packing as PDF.
    i_objpack-transf_bin = 'X'.
    i_objpack-head_start = 1.
    i_objpack-head_num = 1.
    i_objpack-body_start = 1.
    i_objpack-body_num = v_lines_bin.
    i_objpack-doc_type = 'PDF'.
    i_objpack-obj_name = 'Smartform'.
    CONCATENATE 'Smartform_output' '.pdf'
    INTO i_objpack-obj_descr.
    i_objpack-doc_size = v_lines_bin * 255.
    APPEND i_objpack.
    Document information.
    CLEAR i_reclist.
    e-mail receivers.
    i_reclist-receiver = '[email protected]'.
    i_reclist-express = 'X'.
    i_reclist-rec_type = 'U'. "Internet address
    APPEND i_reclist.
    Sending mail.
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
         EXPORTING
              document_data              = w_doc_chng
              put_in_outbox              = 'X'
         TABLES
              packing_list               = i_objpack
              object_header              = w_objhead
              contents_hex               = i_objbin
              contents_txt               = i_objtxt
              receivers                  = i_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.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.

  • Oracle Zip and Send Mail

    Hi,
    I was just wondering if there is a pl/sql code that would do the following:
    1. Zip a file (originally generated from DB query written to Unix OS using UTL_FILE package).
    2. Place a password on the file.
    3. Send the file as an attachment in mail.
    Thanks in advance.

    For compression, you can use UTL_COMPRESS package.
    [oracle@db11ghost ~]$ cat compress_data.txt
    aaaaaaaaaaaaaaaaaaaaaaaaaaaa
    bbbbbbbbbbbbbbbbbbbbbbbbbbbb
    cccccccccccccccccccccccccccc
    [oracle@db11ghost ~]$
    Below is example how to load file to table as compressed blob. Later you can save this blob to file (pls, search google there are many examples how to do it) and send mail as attach.
    SQL> create directory MYDIR as '/home/oracle/';
    Directory created.
    declare
      ablob blob;
      abfile bfile := bfilename('MYDIR', 'compress_data.txt');
      amount integer;
      asize integer;
      a_compressed_blob blob;
      q integer := 1; ---- The level of compression from 1-9
      cursor blob_cur is select * from myt1;
    begin
      insert into myt1 values (1, empty_blob());
      select y into ablob from myt1 where x = 1;
      dbms_lob.fileopen(abfile);
      asize := dbms_lob.getlength(abfile);
      dbms_output.put_line('Size of input file: ' || asize);
      -- load the file (txt file) into the blob column and look at the size
      dbms_lob.loadfromfile(ablob, abfile, asize);
      asize := dbms_lob.getlength(ablob);
      dbms_output.put_line('Size of blob after loading fromfile: ' || asize);
      -- compress the blob
      a_compressed_blob := utl_compress.lz_compress(ablob, q);
      -- insert the compressed blob into the table in another row
      insert into myt1 values (2, a_compressed_blob);
      -- compare the sizes of the blob contents that are in the table now
      dbms_output.put_line('Sizes are -->');
      for c1_rec in blob_cur
        loop
        asize := dbms_lob.getlength(c1_rec.y);
        dbms_output.put_line(asize);
      end loop;
    end;
    Size of input file: 87
    Size of blob after loading fromfile: 87
    Sizes are -->
    87
    32
    PL/SQL procedure successfully completed.For sending you can use UTL_MAIL (http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/u_mail.htm#i1001258)

  • How to count records in table and send email only if count 0

    I thought this would be fairly simple, but apparently not.  I'm trying to count the number of records I have in my staging table, and send an email if count > 0  . . . .  and . . . . I want to put the count in the body of the email. 
    I'm running into a problem with the concatenation part of it.
    SET NOCOUNT ON
    SELECT * FROM [dbo].[Staging]
    SELECT @@rowcount as Row_Count
    SET NOCOUNT OFF
    IF @@rowcount > 0
    BEGIN
    exec msdb.dbo.sp_send_dbmail @profile_name = 'MailTest',
    @recipients = '[email protected]',
    @subject = 'Successfully Loaded Production',
    @body = 'Successfully Loaded Production ' + @@rowcount + ' records loaded',
    @body_format = 'text'
    END
    The problem comes from the '+' character not being recognized.  Maybe it's out of scope, not sure.
    Knowledge is the only thing that I can give you, and still retain, and we are both better off for it.

    Try this
    SET NOCOUNT ON
    IF EXISTS (SELECT TOP 1 1 FROM [dbo].[Staging])
    BEGIN
    exec msdb.dbo.sp_send_dbmail @profile_name = 'MailTest',
    @recipients = '[email protected]',
    @subject = 'Successfully Loaded Production',
    @body = 'Successfully Loaded Production ' + @@rowcount + ' records loaded',
    @body_format = 'text'
    END
    Thanks
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • How to read email IDs from DB and send mails

    Hi,
    i m trying to read a set of e-mail IDs from the DB and sending mails to all those email ids.
    i am getting "null pointer exception". kindly suggest how can i able to send mails to mails to those users
    registered in the db.
    I am reading the e-mail from the db like this :
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@10.2.0.100:1521:eprocure", "uid",
    "pwd");     
    I am using oracle9iAS.
    Error i m getting :
    java.lang.NullPointerException7/16/04 2:25 PM:
         at javax.mail.internet.InternetAddress.parse(InternetAddress.java:534)
         at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:61)
         at com.ep.util.MailUtility.sendMail(MailUtility.java:163)
         at login.SendMsg._jspService(_SendMsg.java:121)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.compileAndServe(JspPageTable.java:508)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:255)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:407)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:330)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:336)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:684)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:269)7/
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:735)
         at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:151)
         at com.evermind.util.ThreadPoolThread.run(ThreadPoolThread.java:64)
    pls advise.
    keep smiling....
    Debasis

    Based on your stack trace I would say you have a line of code like... = new InternetAddress(something)...and that something is null.
    PC&#178;

  • Thunderbird can download and send mail with Cox POP Mail, Mail cannot?

    I have Thunderbird and Mail installed.
    I can download and send mail with Thunderbird.
    I can't even set-up an account with Mail because it cannot find the POP Mail server.
    I have Firewall on with ports 25, 110 and 587 open.
    This really seems strange that I can use Thunderbird to set up and use POP Mail access to Cox, but not Mail.
    My servers are:
    pop.central.cox.net
    smtp.central.cox.net
    I've followed the steps on Cox's support web site, no success.
    I've already called Cox, they're clueless.
    Thoughts or suggestions are greatly appreciated.
    Thanks,
    --Todd
    Mini   Mac OS X (10.4.6)  

    Hi Todd,
    Well since Tbird works, we can rule out lots of things.
    Mail cannot find the POP server
    You are using the Welcome to Mail assistant to do this, and when you type in your incoming mail server info it spins the gear a bit, gives an error, and says that if you continue Mail may not work -- yes? What does the error say specifically?
    No disrespect at all, but the most likely problem is a typo somewhere / mis-specified username. Please go 'round once more.
    Good luck,
    John

  • I updated to yosemite and now if someone is using imessage and sends a text message to my phone it doesn't show up on my phone but does on my computer.  I don't want messages on my computer!  How do I get this to go away and work like it used to?

    I updated to yosemite and now if someone is using imessage and sends a text message to my phone it doesn't show up on my phone but does on my computer.  I don't want messages on my computer!  How do I get this to go away and work like it used to?

    Follow the instructions under the heading "How to unlink a phone number" on this page.

  • I prepare chronologies in word, and i am trying to do the same in pages using tables and cells. But somtimes i need a cell to wrap onto the next page but I can't work out how to do it - any suggestions would be greatly appreciated

    I prepare chronologies in word, and I am trying to do the same in pages using tables and cells. But sometimes I need a cell to wrap onto the next page because the contents are bigger than the page or the space left on the page,  but I can't work out how to do it - any suggestions would be greatly appreciated

    brendanfromsydney wrote:
    What are the different opinions on why pages should not achieve this?
    As far as I know, Apple is free to choose to offer this or that feature.
    They never said that they want to clone Word or even compete with it.
    Differences between tables in both worlds are numerous.
    In Pages (or Numbers)
    - we can't sort a single column
    - we can't sort by row
    - we can't insert or remove a single cell
    - a cell can't cross pages boundaries
    If I understand well these design choices match :
    ++-+-+-+-+-+-+-+-++
    Apple Human Interface Guidelines:
    Apply the 80 Percent Solution
    During the design process, if you discover problems with your product design, you might consider applying the 80 percent solution‚ that is, designing your software to meet the needs of at least 80 percent of your users. This type of design typically favors simpler, more elegant approaches to problems.
    If you try to design for the 20 percent of your target audience who are power users, your design may not be usable by the other 80 percent of users. Even though that smaller group of power users is likely to have good ideas for features, the majority of your user base may not think in the same way. Involving a broad range of users in your design process can help you find the 80 percent solution.
    +-+-+-+-+-+-+-+-+-++
    Yvan KOENIG (VALLAURIS, France) jeudi 9 juin 2011 16:03:52
    iMac 21”5, i7, 2.8 GHz, 4 Gbytes, 1 Tbytes, mac OS X 10.6.7
    Please : Search for questions similar to your own before submitting them to the community
    To be the AW6 successor, iWork MUST integrate a TRUE DB, not a list organizer !

  • Need to choose fields from alv grid output and send mail

    Hi,
    I need to choose few orders from alv grid output and send mail as PDF for chosen orders.
    Suggest if possible and how.

    Moderator message - Please do not post your requirements and ask the forum to do your work for you - post locked
    Rob

  • How to create job to run daily based on form values entered and send mail.

    Hi,
    In DB we have 3 columns: creation_date, name, approved_or_not. Default for approved_or_not is 'No'.
    In the application form page suppose I fill in sysdate for creation_date and leave default for approved_or_not and click [create] button.
    Now a job should run everyday and check for where (approved_or_not='No' & creation_date = 'sysdate - 1') and send mail to the person in 'name' field mentioning: 'Approval pending. click on link <some_link> for details on approval'.
    Could anyone give me pointers to example on such job? (Working on APEX 3.0)
    Thanks,
    Priyanka

    create a DBMS JOB
    check out this forum link.
    dbms_job

  • HT1338 Why I cannot open Mai and send mail via yahoo?

    I now cannot open my mail and send mail. I try sending photos and It says yahoo server is not available
    There shows as well MF Message Error Domain error 1032.
    No idea please help.
    Thanks

    If the app doesn't work, try removing and then re adding your mail info. Sometimes Yahoo gets their wires crossed and starting over is usually the only way to fix it.

  • Earlier i had no problem to att files up to more tan 20Mb. Now it has been impossible to att files dreater than about 3,5 Mb. I use Thunderbird and G-mail , W7 64 bit premium. What is wrong ? Please help me so I can fwd my photos again. Cheers /

    Earlier i had no problem to att files up to more tan 20Mb. Now it has been impossible to att files dreater than about 3,5 Mb. I use Thunderbird and G-mail , W7 64 bit premium. What is wrong ?

    Hello Ashraf,
    Sorry you didn't get any help on this post. In the future, please contact Adobe Support for 1-1 assistance on issues like this: Contact Customer Care
    Thanks,
    Kevin

  • HT4993 Hi I got 32 gb iphone 5 sprint line from America but using Turkey and send sms problem

    Hi
    I got 32 gb iphone 5 sprint line from America but using Turkey and send sms problem

    Did you request that Sprint unlock the phone?
    If so, did they?  Did you follow the process to complete the unlock by restoring as new?
    Did you get the message indicating the iPhone is unlocked?

Maybe you are looking for