Regarding file attachment

Hi,this is program for sending attachment,i use the path in coding itself...its working properly
how i can get file path during the run time...[ex:Dialog box during runtime]
could anyone give a suggestion...regarding this problem???
Properties props= new Properties();
props.put("mail.transport.protocol","smtp");
props.put("mail.smtp.starttls.enable", "true");
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.host","smtp.gmail.com");
// pop3Props.setProperty("mail.pop3.port", "995");
Authenticator auth=new MyAuthenticator("[email protected]","xxxxxxx");
Session s=Session.getInstance(props, auth);
MimeMessage msg=new MimeMessage(s);
InternetAddress from=new InternetAddress("[email protected]","xxxxxxx");
msg.setFrom(from);
InternetAddress to =new InternetAddress("[email protected]");
msg.addRecipient(Message.RecipientType.TO,to);
msg.setSubject("Testing Attachment");
MimeBodyPart mbp1 = new MimeBodyPart();
mbp1.setText("Manikandan,Tesing Atachment");
MimeBodyPart mbp2 = new MimeBodyPart();
File temp= null;
temp= new File("D:/EML.txt");
// boolean ch=temp.createNewFile();
FileDataSource fds = new FileDataSource("D:/EML.java");
mbp2.setDataHandler(new DataHandler(fds));
mbp2.setFileName(fds.getName());
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp1);
mp.addBodyPart(mbp2);
msg.setContent(mp);
msg.saveChanges();
// Set the Date: header
msg.setSentDate(new java.util.Date());
// Send the message
Transport.send(msg);
Advance thanks...

yeah you are correct..but i dont want to upload from client server...
just i want to upload my file from my home pc...and i want to send it to another email ID through java MAIL
whether it is possible??if so, could you give me a clear suggestion regarding this...
Advance thanks.........

Similar Messages

  • Help regarding file attachment

    Hello All,
    I am developing a form where the user will add details about a person.At the end there would be a button called "Add Photo" when the user clicks the button the add files dialogue will open. The user can browse through the photo and can add the Photo.The max size limited should be 700 KB.After the user has added the photo the photo would be shown as a thumb nail view. Also the user can change the photo later on .I am also thinking about : If the user clicks on the photo it would be displayed in its original size and one close button will appear on the bigger photo on the top right hand side corner.If the user clicks it then the photo will become thumb nail view once again. Is it possible to design in LiveCycle Designer 8.2 or am being too optimistic ?
    Thanks.
    Bibhu.

    Hi Bibhu,
    Here is an example:
    https://acrobat.com/#d=jTxbDqy4gH9r2oALyXQQhQ
    Check out the script in the layout_ready event of the larger image.
    Good luck,
    Niall

  • TS1506 Regarding the attachment file

    Why the email application on the iPhone is not equipped with a file attachment feature, they say the iPhone is a smart phone, but why stupid?. And I reliazed Blackberry was superior and better for the business office application software

    We all know how you feel about the mail app now, but do you have a question or something that you need help with?
    If you have a suggestion to make to Apple regarding the iPad, do it here.
    http://www.apple.com/feedback/ipad.html

  • DMS - File attached for FI posted document

    Hi All,
    I am new for DMS .
    My requirement is - we have web application in .net  . Vendor update entry in web application , attached some file with that page and go to submit .
    It comes in SAP through proxy and posting in FI has been done .
    But the file attached in .net application is stored in .net application server .
    So now requirement is when we open posted document in SAP we need that file attached with posted document (available in GOS for that t-Code) .
    My question is -
    1 - how we create entry in DMS dynamically ( we got posting confirmation in SAP through proxy and we got that file in SAP application server through file transfer ) . But how to entry maintain in DMS (we have multiple document for single posted document ). Even I know how to create document type for DMS n basic thing of DMS .But I need algo . 
    2-  How that entry link maintain to that FI T-Code . 
    Thanks to all .
    Regards,
    Alter

    Hi Ravi,
    you need to customize in OAC3 the Documenttyp link to FI Object.
    e.g
    ObjectType      Doc.type   Status Cont. Rep. Link  Doc.class      Ret.per.
    BKPF               #ZXYDOC#      X      C1    TOA01      PDF              180
    From your Server you need to call am FM (something like ALINK_CREATE_ASYNCHRON_META" on your SAP System via RFC to save the File after you created the Object.
    regards
    Kim

  • File attachment not available on CALL TRANSACTION

    Hello guys,
    I am using Generic Object System (GOS) for file attachment in a custom transaction. If I access the transaction directly, it is working fine. But if I use CALL TRANSACTION 'ZTRAN', the file attachment in the application toolbar is not appearing. I debugged in both way, I don't find any difference. But finally through call transaction, GOS is not appearing. please throw some lights on this.Below is my code.
    In transaction:
    DATA: gcl_manager  TYPE REF TO cl_gos_manager.
      IF NOT zmm_spa_header-rmsno IS INITIAL.
    *   Set object Key
        gv_object-objtype = gc_spah.
        gv_object-objkey  = zmm_spa_header-rmsno.
    *   GOS toolbar
        CREATE OBJECT gcl_manager
          EXPORTING
            is_object    = gv_object
            ip_no_commit = 'R'
            ip_mode      = 'E'
          EXCEPTIONS
            OTHERS       = 1.
      ENDIF.
    In report:
    CALL TRANSACTION 'ZMMD_SPA'.

    Hi,
    1,  make SY-BINPT = 'X'. then call transaction. Hope it will display.
    if not try BDC as mentioned below record only first screen.
    data: ctu_params type ctu_params.
    ctu_params-UPDMODE = 'A' . " Asyconrous mode.
    ctu_params-DISMODE = 'A' " all screens
    ctu_params-NOBINPT = 'X'.
    CALL TRANSACTION 'ZMMD_SPA' using bdcdata options ctu_params.
    Hope it helps.
    Regards,
    shanmugavel chandrasekaran

  • Problem in file attachment functionality in ERP.

    Problem in file attachment functionality in ERP in Invoice Workbench and PO documents. The error is Page Not Found.
    Regards
    Sridhar

    Please post the details of the application release, database version and OS.
    user11996389 wrote:
    Problem in file attachment functionality in ERP in Invoice Workbench and PO documents. The error is Page Not Found.Please post the steps you follow to reproduce the issue.
    Was this working before? If yes, any changes been done recently?
    Can you find any errors in Apache/Workflow/Database log files?
    Thanks,
    Hussein

  • To Send HTML Format and excel file attachment  in same mail

    Dear All,
            Have requerment ,to send a mail options HTML table format and same data in excel file attachement.have capable to do the html format using methods BCS .but how to send excel format attachment in same  mail.
    Please guide me how to do it.
    Regards ,
    Santhu
    Edited by: santosh jajur on Apr 9, 2010 1:54 PM

    Santhosh,
    please check the code:
    report bcs_example_7.
    This report provides an example for sending an Excel
    attachment in Unicode Systems
    constants:
      gc_tab  type c value cl_bcs_convert=>gc_tab,
      gc_crlf type c value cl_bcs_convert=>gc_crlf.
    parameters:
      mailto type ad_smtpadr
       default 'ur mail id'.                    "#EC *
    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 main_text      type bcsy_text.
    data binary_content type solix_tab.
    data size           type so_obj_len.
    data sent_to_all    type os_boolean.
    start-of-selection.
      perform create_content.
      perform send.
    form send.
      try.
          send_request = cl_bcs=>create_persistent( ).
        create document object from internal table with text
          append 'Hello world!' to main_text.                   "#EC NOTEXT
          document = cl_document_bcs=>create_document(
            i_type    = 'RAW'
            i_text    = main_text
            i_subject = 'Test Created By BCS_EXAMPLE_7' ).      "#EC NOTEXT
        add the spread sheet as attachment to document object
          document->add_attachment(
            i_attachment_type    = 'xls'                        "#EC NOTEXT
            i_attachment_subject = 'ExampleSpreadSheet'         "#EC NOTEXT
            i_attachment_size    = size
            i_att_content_hex    = binary_content ).
        add document object to send request
          send_request->set_document( document ).
        --------- 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 ).
        ---------- 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.
      endtry.
    endform.                    "send
    form create_content.
      data lv_string type string.
      data ls_t100 type t100.
    columns are separated by TAB and each line ends with CRLF
      concatenate 'This Is Just Example Text!'                  "#EC NOTEXT
                  gc_crlf gc_crlf
                  into lv_string.
    header line
      concatenate lv_string
                  'MSGID'    gc_tab
                  'MSGNO'    gc_tab
                  'Language' gc_tab                             "#EC NOTEXT
                  'Text'     gc_crlf                            "#EC NOTEXT
                  into lv_string.
    data lines
      select * from t100 into ls_t100
        where arbgb = 'SO' and msgnr = '182'.
        concatenate lv_string
                    ls_t100-arbgb gc_tab
                    ls_t100-msgnr gc_tab
                    ls_t100-sprsl gc_tab
                    ls_t100-text  gc_crlf
                    into lv_string.
      endselect.
      select * from t100 into ls_t100
        where arbgb = 'SO' and msgnr = '316'.
        concatenate lv_string
                    ls_t100-arbgb gc_tab
                    ls_t100-msgnr gc_tab
                    ls_t100-sprsl gc_tab
                    ls_t100-text  gc_crlf
                    into lv_string.
      endselect.
      try.
          cl_bcs_convert=>string_to_solix(
            exporting
              iv_string   = lv_string
              iv_codepage = '4103'  "suitable for MS Excel, leave empty
              iv_add_bom  = 'X'     "for other doc types
            importing
              et_solix  = binary_content
              ev_size   = size ).
        catch cx_bcs.
          message e445(so).
      endtry.
    endform.                    "create_content
    Thanks.

  • File attachment in yahoo mail does not appeare in Firefox 4, but IE & other web browsers show correctly.

    Before I install Firefox 4, I have been use Firefox 3.6 and when I was checking my yahoo mail, there was not any problem to view or download file attachment.
    After installing Firefox 4, when I receive a new mail with file attachment, like as video, or document, I can not see the attachment to download it. but with other web browsers like IE, I can see the attachment of the email.

    Hi!
    People using a Trend Micro virus scanner should disable some webmail function. You can find the solution [http://en.kioskea.net/forum/affich-33677-can-t-download-attachments-on-my-yahoo-email here]
    I do not use Trend Micro, but have the same issues. I just found my "AdBlock Plus" add-on was stopping the attachment download. What you should do to see if this is your problem too: disable AdBlock Plus, restart firefox and see if your problem is solved. Now enable AdBlock Plus again and restart Firefox.
    To fix this problem: In Firefox, click on Add-ons, go to AdBlock Plus, go to Options, click on Filters--> reset statistics. Go to your attachment, click on the attachment (it will fail to download of course). Go back to AdBlock Plus and sort the statistics for "Hits". Now you can see which filter is blocking your attachment download. Disable this filter and you problem is solved!
    Regards!

  • Mail Adapter: How to send data as a simple text file attachment?

    Hi All
    I have a proxy to file scenario, where i write data to a text file.
    Now, i need to have a second receiver. I have to send an email, with the above file as an attachment, to this receiver.
    How can i do this?
    How can i send the data as a text file attachment to the receiver?
    Many Thanks
    Chandra

    Hi,
    To send the message to the second receiver you need to have:
    1) Necessary mail message format (can download from service marketplace)
    2) Receiver mail communication channel.
    3) Create the necessary Configuration Objects .... Receiver Determination, Interface Determination, Receiver Agreement.
    3) You can do a XSLT mapping (if required)....if no complex logic is needed then you can do a simple Message mapping.
    4) In the receiver CC make sure that you check the Adapter Specific Message Attribute checkbox.
    For more info you can refer my answer in this thread:
    Re: xml in mail
    Also refer the blog:
    /people/michal.krawczyk2/blog/2005/11/23/xi-html-e-mails-from-the-receiver-mail-adapter
    Regards,
    Abhishek.

  • How to email a .zip file attachment from PC

    Hi,
    Please, let me know how to email a .zip file attachment from Presentation Server.
    Thanks,
    Madhuri.

    Hi,
    try fm SO_DOCUMENT_SEND_API1
    it's well documented (look with SE37)
    and look here:
    /people/thomas.jung3/blog/2004/09/08/sending-e-mail-from-abap--version-610-and-higher--bcs-interface
    regards Andreas

  • ZIP file attachment in DMS

    Hello All
    How to attach a ZIP file in DMS while creating document from CV01N transaction.
    I have tried this in CV01n & ZIP file is attached but after creating Document when I am go in CV02N transaction & tries to open the ZIP file attachement system is giving the error "File can not be opened...File format is not correct"
    Is there any seeting I need to do for data carrier type & Application type.
    Your reply is appreciated.
    Thanks
    Pravink.

    Hi Pravin,
    Have you maintained in DC30 "work station application" following entries
    for eg:
    TZP   *.zip
    For the required DMS document type.
    If yes, let us know the error message you get.
    Regards,
    Deepak Kori

  • Zip file attachment

    Hello,
    we are searching for an answer to the following problem...
    We are trying to send an email with an attached file via the email adapter. We are using the mail package format for sending the email. The content of the mail package is converted into an file attachment in the mail adapter. Because we have to define the attachment name we use the MessageTransformationBean to change it.
    Now we want to zip the attached file... Can anyone give me a hint, how to realize it? Have we write a module, which we have to call inside the mail adapter? If so, where must we place this module in the EJB sequence?
    Thank you for your replies...
    Best regards,
    Lars

    Hi Palaniraja,
    thank you for your answer...
    My question to your suggestion is, can we use it in our case? Because we generate the attached file with the email adapter. I don't know exactly if the file is already send, if we place the module behind the mail adapter EJB. Or must we place it before this EJB. Which step will be the best time to place the new module? Before or after the mail adapter EJB?
    It would be great to get the code from your site... Could you please send the code to my EMail address from my Business Card?
    Thanks a lot...
    Regards,
    Lars

  • Creating an e-mail with excel file attachment

    Morning,
    Does anyone know how to create an e-mail with a spreadsheet attachment (in foreground and background). I can create an e-mail (in foreground and background) with a text (tab delimited) file attachment with a suffix of .xls. I have created the file by writing text to a string and then putting it into a text format using the function module SCMS_STRING_TO_FTEXT.
    Thanks and regards
    John.

    See the following simple ex:
    DATA: P_EMAIL TYPE SOMLRECI1-RECEIVER.
    DATA: T_PACKING_LIST LIKE SOPCKLSTI1 OCCURS 0 WITH HEADER LINE,
    T_CONTENTS LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    T_RECEIVERS LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE,
    T_ATTACHMENT LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    T_OBJECT_HEADER LIKE SOLISTI1 OCCURS 0 WITH HEADER LINE,
    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.
    DATA: IT_ATTACH TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
    WITH HEADER LINE.
    DATA: IT_MESSAGE TYPE STANDARD TABLE OF SOLISTI1 INITIAL SIZE 0
    WITH HEADER LINE.
    ***Sending mail to the receipients
      if not it_final[] is initial.
        PERFORM SUB_GET_MAIL_ADDR.
    Populate table with detaisl to be entered into .xls file
        PERFORM BUILD_XLS_DATA_TABLE.
        PERFORM POPULATE_EMAIL_MESSAGE_BODY.
    Send file by email as .xls speadsheet
        PERFORM SEND_FILE_AS_EMAIL_ATTACHMENT
        TABLES IT_MESSAGE
        IT_ATTACH
        USING P_EMAIL
        'Sales Register Report - Set Top Box / Accessories'
        'XLS'
        'SSTB'
        CHANGING GD_ERROR
        GD_RECIEVER.
    Instructs mail send program for SAPCONNECT to send email(rsconn01)
        PERFORM INITIATE_MAIL_EXECUTE_PROGRAM.
      endif.
    *&      Form  BUILD_XLS_DATA_TABLE
          text
    -->  p1        text
    <--  p2        text
    FORM BUILD_XLS_DATA_TABLE .
      data: wa_itab like it_final.
      CONSTANTS:
      CON_TAB TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB,
      CON_CRET TYPE C VALUE CL_ABAP_CHAR_UTILITIES=>CR_LF.
      CONCATENATE 'Business Place' 'Region Code' 'Region' 'Branch Code'
                  'Branch' 'Material Desc' 'Area off Code'
                  'Area Name' 'Zone code' 'Zone Name' 'Cust No' 'Cust Name'
                  'Bill Doc No' 'Bill Date' 'Base Val' 'Total Val' 'Quantity'
      INTO IT_ATTACH SEPARATED BY CON_TAB.
      CONCATENATE CON_CRET IT_ATTACH INTO IT_ATTACH.
      APPEND IT_ATTACH.
      LOOP AT IT_FINAL INTO WA_ITAB.
        CONCATENATE   WA_ITAB-BUSINESS_PLACE
                  WA_ITAB-KVGR1
                  WA_ITAB-REGION
                  WA_ITAB-VKBUR
                  WA_ITAB-SALES_OFF
                  WA_ITAB-ARKTX
                  WA_ITAB-vkgrp
                  WA_ITAB-sales_grp
                  WA_ITAB-bzirk
                  WA_ITAB-zone
                  WA_ITAB-kunnr
                  WA_ITAB-name
                  WA_ITAB-vbeln
                  WA_ITAB-fkdat
                  WA_ITAB-base_value
                  WA_ITAB-total_value
                  WA_ITAB-fkimg
        INTO IT_ATTACH SEPARATED BY CON_TAB.
        CONCATENATE CON_CRET IT_ATTACH INTO IT_ATTACH.
        APPEND IT_ATTACH.
      ENDLOOP.
    ENDFORM.                    " BUILD_XLS_DATA_TABLE
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
          text
    -->  p1        text
    <--  p2        text
    FORM POPULATE_EMAIL_MESSAGE_BODY .
      REFRESH IT_MESSAGE.
      CONCATENATE SY-DATUM6(2) '/' SY-DATUM4(2) '/' SY-DATUM+0(4) INTO G_DATE.
      IT_MESSAGE = 'Please find attached excel sheet.'.
      APPEND IT_MESSAGE.
      IT_MESSAGE = 'Report'.
      APPEND IT_MESSAGE.
      Concatenate 'Report generated date' ':' G_Date '.' into IT_MESSAGE.
      APPEND IT_MESSAGE.
      clear it_message.
      append it_message.
      IT_MESSAGE = 'This is an autogenerated mail, please do not reply'.
      APPEND IT_MESSAGE.
    ENDFORM.                    " POPULATE_EMAIL_MESSAGE_BODY
    *& Form SEND_FILE_AS_EMAIL_ATTACHMENT
    Send email
    FORM SEND_FILE_AS_EMAIL_ATTACHMENT TABLES PIT_MESSAGE
    PIT_ATTACH
    USING P_EMAIL
    P_MTITLE
    P_FORMAT
    P_FILENAME
    P_ATTDESCRIPTION
    P_SENDER_ADDRESS
    P_SENDER_ADDRES_TYPE
    CHANGING P_ERROR
    P_RECIEVER.
      DATA: LD_ERROR TYPE SY-SUBRC,
      LD_RECIEVER TYPE SY-SUBRC,
      LD_MTITLE LIKE SODOCCHGI1-OBJ_DESCR,
      LD_EMAIL LIKE SOMLRECI1-RECEIVER,
      LD_FORMAT TYPE SO_OBJ_TP ,
      LD_ATTDESCRIPTION TYPE SO_OBJ_NAM ,
      LD_ATTFILENAME TYPE SO_OBJ_DES ,
      LD_SENDER_ADDRESS LIKE SOEXTRECI1-RECEIVER,
      LD_SENDER_ADDRESS_TYPE LIKE SOEXTRECI1-ADR_TYP,
      LD_RECEIVER LIKE SY-SUBRC.
      LD_EMAIL = P_EMAIL.
      LD_MTITLE = P_MTITLE.
      LD_FORMAT = P_FORMAT.
      LD_ATTDESCRIPTION = P_ATTDESCRIPTION.
      LD_ATTFILENAME = P_FILENAME.
      LD_SENDER_ADDRESS = P_SENDER_ADDRESS.
      LD_SENDER_ADDRESS_TYPE = P_SENDER_ADDRES_TYPE.
    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 = LD_MTITLE .
      W_DOC_DATA-SENSITIVTY = 'F'.
    Fill the document data and get size of attachment
      CLEAR W_DOC_DATA.
      READ TABLE IT_ATTACH INDEX W_CNT.
      W_DOC_DATA-DOC_SIZE =
      ( W_CNT - 1 ) * 255 + STRLEN( IT_ATTACH ).
      W_DOC_DATA-OBJ_LANGU = SY-LANGU.
      W_DOC_DATA-OBJ_NAME = 'SAPRPT'.
      W_DOC_DATA-OBJ_DESCR = LD_MTITLE.
      W_DOC_DATA-SENSITIVTY = 'F'.
      CLEAR T_ATTACHMENT.
      REFRESH T_ATTACHMENT.
      T_ATTACHMENT[] = PIT_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.
      T_PACKING_LIST-OBJ_NAME = 'stb'.
      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 = LD_FORMAT.
      T_PACKING_LIST-DOC_TYPE = 'XLS'.
    T_PACKING_LIST-OBJ_DESCR = LD_ATTDESCRIPTION.
      T_PACKING_LIST-OBJ_DESCR = 'Sales_STB'.
    T_PACKING_LIST-OBJ_NAME = LD_ATTFILENAME.
      T_PACKING_LIST-OBJ_NAME = 'stb'.
      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_RECV.
        T_RECEIVERS-RECEIVER = IT_RECV-EMAIL.
        T_RECEIVERS-REC_TYPE = 'U'.
       T_RECEIVERS-COM_TYPE = 'INT'.
    T_RECEIVERS-COPY = 'X'.
       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             = LD_SENDER_ADDRESS
          SENDER_ADDRESS_TYPE        = LD_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.
    Populate zerror return code
      LD_ERROR = SY-SUBRC.
    Populate zreceiver return code
      LOOP AT T_RECEIVERS.
        LD_RECEIVER = T_RECEIVERS-RETRN_CODE.
      ENDLOOP.
    ENDFORM.                    "SEND_FILE_AS_EMAIL_ATTACHMENT
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          text
    -->  p1        text
    <--  p2        text
    FORM INITIATE_MAIL_EXECUTE_PROGRAM .
      WAIT UP TO 2 SECONDS.
      SUBMIT RSCONN01 WITH MODE = 'INT'
      WITH OUTPUT = ''
      AND RETURN.
    ENDFORM.                    " INITIATE_MAIL_EXECUTE_PROGRAM

  • Regarding email attachement while running a background job

    Dear Experts,
    When i am running a background job for any ALV report (standard or custom report) <b>automatically</b> the output is going to an e-mail address as a HTML file attachment. I want to change it to EXCEL file attachment.
    Please help me on this issue..
    Kind Regards,
    Tom

    Hi Prasanna,
    Thank you for your reply.  I am not using any code for sending the mail to the recipient E-mail address, system is taking care automatically.
    Few settings were done in SCOT transaction from basis, but no where they mentioned file type is .HTM.
    From my end i have done the following steps.
    1. go to SM36, give a job name.
    2. press on step push button , give the ABAP program name ( any ALV program, i mean standard report or Z report), give the variant and save.
    3. Come back . press on Spool list recipient push button give the e-mail address, press copy button on the  pop up window.
    4. press on start condition button , press on Immediate option and save.
    5. again press on Save button in the screen.
    now here job will be scheduled immediately, go to SM37 check your job status, if it is completed, automatically system is sending an e-mail with the ".HTM" attachment file output to the recipient e-mail address.
    i am not doing any coding part here.
    my concern is system should send the e-mail with ".XLS" file output attachment.
    please advise on this.
    Regards,
    Tom.

  • Email with Text File Attachement as Source

    Hi All,
           One of my interfaces needs to listen to incoming mails with an text file attachements.I wish to know how we can convert the text file contents into XML to further process it on the reciever side.

    Hi,
    To perform content conversion of a flat file, check these blogs,
    /people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30
    /people/venkat.donela/blog/2005/03/03/introduction-to-simple-file-xi-filescenario-and-complete-walk-through-for-starterspart2
    Also, to understand file content conversion better, you can check this link on SAP Help,
    http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm
    Regards,
    Bhavesh

Maybe you are looking for