How to ZIP, PDF file attachment

Hi,
I have an ABAP report requirement to send an email to a user. This program will send an email with PDF attachement. However, the PDF attachment is quite big (9MB) and our email server couldn't handle it (5MB only). Is there any way to ZIP this PDF file attachment?
I am using a SAP release ECC 6.0with OS WinNT. And the ABAP program should be able to run in Foreground/Background.
Thanks for your help in advance...

Hi,
Try this code:
data ca_attach_zip(22)     TYPE c VALUE 'Attch.',
OPEN DATASET va_filename_zip  FOR INPUT  IN BINARY MODE.
   DO.
     READ DATASET va_filename_zip INTO objbin.
     IF sy-subrc NE 0. EXIT. ENDIF.
     APPEND objbin.
   ENDDO.
    APPEND objbin.
  DESCRIBE TABLE objbin LINES tab_lines.
   CLOSE  DATASET va_filename_zip.
    DELETE DATASET va_filename.
    DELETE DATASET va_filename_zip.
    DESCRIBE TABLE objbin LINES tab_lines.
    objhead = ca_attach_zip.
    APPEND objhead.
***Creation of 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 = ca_zip.
   objpack-obj_name  = ca_attach_zip.
  objpack-obj_descr = ca_attach_zip.
   objpack-doc_size = tab_lines * ca_255.
    APPEND objpack.
*** Completing the recipient list
    reclist-receiver = va_mail_address.
    reclist-express  = 'X'.
    reclist-rec_type = 'U'.
    APPEND reclist.
*** Sending the document
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
      EXPORTING
       document_data              = doc_chng
       put_in_outbox              = ca_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
        document_type_not_exist    = 3
       operation_no_authorization = 4
        parameter_error            = 5
        x_error                    = 6
        enqueue_error              = 7
        OTHERS                     = 8.
You have to load your file in the contents_bin table of FM.
You can load the file by OPEN DATASET and the READ DATASET command.
In the object_header you can put some description.
For your info:
1. Zip the data and send as an email attachment
2. How to Zip the data in an internal table
3. Re: How to ZIP a PDF file email attachment
May it helps you.
Regards.
Deepak Sharma.

Similar Messages

  • How to read PDF files on your iphone in book format

    Hey everyone, I just posted a tutorial on how to read pdf files like ebooks on Stanza. Let me know if you have any questions
    http://budurl.com/u4tz
    That used to drive me crazy until I figured it out. Enjoy

    an easier way would be to wait until iOS 4 and then download the free iBooks app... you can import via the file sharing feature in iTunes (same that the iPad uses), or open the file from an email using the "open in" feature currently found on the iPad...
    http://www.apple.com/iphone/features/mail.html
    ^ scroll down to the iphone with the subheading underneath saying "See what’s attached."

  • How to link pdf file in flash by xml ??

    how to link pdf file in flash by xml ??

    try to give <a href="your address">My Pdf</a>
    and your textfield should be html enabled
    mytextField.html=true
    mytextField.htmlText=your xml text

  • How to process pdf file in clower ETL

    Hi,
    I want process pdf document in clower ETL dataintegartor. I have created sample project and created ETL garph universal data reader, data i have imported pdf file, while openning the metta data information it's show encoding data format and invalid delimiter and while running error in the console
    Please assist me how to process pdf file with unstructured data format.
    I am getting below the error,
    ERROR [WatchDog] - Graph execution finished with error
    ERROR [WatchDog] - Node DATA_READER0 finished with status: ERROR caused by: Parsing error: Unexpected record delimiter, probably record has too few fields. in field # 1 of record # 2, value: '<Raw record data is not available, please turn on verbose mode.>'
    ERROR [WatchDog] - Node DATA_READER0 error details:
    org.jetel.exception.BadDataFormatException: Parsing error: Unexpected record delimiter, probably record has too few fields. in field # 1 of record # 2, value: '<Raw record data is not available, please turn on verbose mode.>'
         at org.jetel.data.parser.DataParser.parsingErrorFound(DataParser.java:527)
         at org.jetel.data.parser.DataParser.parseNext(DataParser.java:437)
         at org.jetel.data.parser.DataParser.getNext(DataParser.java:168)
         at org.jetel.util.MultiFileReader.getNext(MultiFileReader.java:415)
         at org.jetel.component.DataReader.execute(DataReader.java:261)
         at org.jetel.graph.Node.run(Node.java:425)
         at java.lang.Thread.run(Thread.java:619)
    please can any one help me.
    Thanks
    Rajini C
    Edited by: 954486 on Sep 19, 2012 11:19 PM

    There is a separate forum for the BI/Information Discovery application of Endeca software: Endeca Information Discovery You should post your message there.
    Thanks.
    Sean

  • How to save pdf file in database

    Dear All,
    my application is forms 6i and database is 8i,requirement is that how to save pdf file in database and users can view through forms

    I'll apologize up front for the length of this post. I have a few database procedures I created that write a file to a BLOB column in a table as well as retrieve the BLOB from the column after it stored there. I have successfully stored many different types of binary file to the database using these procedures - including PDF files. I have not used these procedures in a Form so I can confirm that they will work, but theoretically they should work. I'm including the code for each procedure in this posting - hence the apology for the long post! :-)
    Also, since these procedures reside on the database you will need to use Forms TEXT_IO built-in package to write your file to the server before you can use these procedures to store and retrieve the file from the database.
    These procedures reads and writes a binary file to a table called "LOB_TABLE." You will need to modify the procedure to write to your table.
    -- Author :  Craig J. Butts (CJB)
    -- Name   :  load_file_to_blob.sql
    --        :  This procedure uses an Oracle Directory called "IN_FILE_LOC".  If you
    --           already have a directory defined in the database or would prefer to use
    --           a different Directory name, make sure you modify line 21 to reflect the
    --           new Directory name.
    -- ==================================================================================
    -- History
    -- DATE        WHO         DESCRIPTION
    -- 12/11/07    CJB         Created.
    CREATE OR REPLACE PROCEDURE load_file_to_blob (p_filename IN VARCHAR2) IS
       out_blob    BLOB;
       in_file     BFILE;
       blob_length INTEGER;
       vErrMsg     VARCHAR2(2000);
    BEGIN
       -- set the in_file
       in_file := BFILENAME('IN_FILE_LOC',p_filename);
       -- Get the size of the file
       dbms_lob.fileopen(in_file, dbms_lob.file_readonly);
       blob_length := dbms_lob.getlength(in_file);
       dbms_lob.fileclose(in_file);
       -- Insert a new Record into the tabel containing the
       -- filename specified in P_FILENAME and a LOB_LOCATOR.
       -- Return the LOB_LOCATOR and assign it to out_blob.
       INSERT INTO lob_table (filename, blobdata)
          VALUES (p_filename, EMPTY_BLOB())
          RETURNING blobdata INTO out_blob;
       -- Load the file into the database as a blob.
       dbms_lob.open(in_file, dbms_lob.lob_readonly);
       dbms_lob.open(out_blob, dbms_lob.lob_readwrite);
       dbms_lob.loadfromfile(out_blob, in_file, blob_length);
       -- Close handles to blob and file
       dbms_lob.close(out_blob);
       dbms_lob.close(in_file);
       commit;
       -- Confirm insert by querying the database
       -- for Lob Length information and output results
       blob_length := 0;
       BEGIN
          SELECT dbms_lob.getlength(blobdata) into blob_length
            FROM lob_table
           WHERE filename = p_filename;
       EXCEPTION WHEN OTHERS THEN
          vErrMsg := 'No data Found';
       END;
       vErrMsg := 'Successfully inserted BLOB '''||p_filename||''' of size '||blob_length||' bytes.';
       dbms_output.put_line(vErrMsg);
    END;
    -- Author   :  Craig J. Butts (CJB)
    -- Name     :  write_blob_to_file.sql
    -- Descrip  :  This procedure takes a BLOB object from a database table and writes it
    --             to the file system
    -- ==================================================================================
    -- History
    -- DATE        WHO         DESCRIPTION
    -- 12/11/07    CJB         Created.
    CREATE OR REPLACE PROCEDURE write_blob_to_file ( p_filename IN VARCHAR2 ) IS
       v_blob      BLOB;
       blob_length INTEGER;
       out_file    UTL_FILE.FILE_TYPE;
       v_buffer    RAW(32767);
       chunk_size  BINARY_INTEGER := 32767;
       blob_position INTEGER := 1;
       vErrMsg     VARCHAR2(2000);
    BEGIN
       -- Retrieve the BLOB for reading
       BEGIN
          SELECT blobdata
            INTO v_blob
            FROM lob_table
           WHERE filename = p_filename;
       EXCEPTION WHEN OTHERS THEN
          vErrMsg := 'No data found';
       END;
       -- Retrieve the SIZE of the BLOB
       blob_length := DBMS_LOB.GETLENGTH(v_blob);
       -- Open a handle to the location where you are going to write the blob
       -- Note:  The 'WB' parameter means "Write in Byte Mode" and is only
       --          available in the UTL_FILE pkg with Oracle 10g or later.
       --        USE 'W' instead for pre Oracle 10q databases.
       out_file := UTL_FILE.FOPEN('OUT_FILE_LOC',p_filename, 'wb', chunk_size);
       -- Write the BLOB to the file in chunks
       WHILE blob_position <= blob_length LOOP
          IF ( ( blob_position + chunk_size - 1 ) > blob_length ) THEN
             chunk_size := blob_length - blob_position + 1;
          END IF;
          dbms_lob.read(v_blob, chunk_size, blob_position, v_buffer );
          UTL_FILE.put_raw ( out_file, v_buffer, TRUE);
          blob_position := blob_position + chunk_size;     
       END LOOP;  
    END;Hope this helps.
    Craig...
    -- If my response or the response of another is helpful or answers your question please mark the response accordingly. Thanks!

  • How to view pdf file in java/jsp?

    Hello Everybody,
    Any one help me how to view pdf file in jsp using java application.
    I have pdf file c:\app.pdf.
    How can i display the pdf file.
    Please help me.................
    Thanks

    Hello,
    You can use the below code, but i am not sure how far is this a startard way of doing it.
    # <%
    # ServletOutputStream servletOutputStream = response.getOutputStream();
    # File reportFile = new File("C:\\Tomcat 5.0\\webapps\\TestApp\\myfile.pdf");
    # FileInputStream fis = new FileInputStream(reportFile);
    # byte[] bytes= new byte[128000];
    # int count=fis.read(bytes);
    # try
    # response.setContentType("application/pdf");
    # response.setContentLength(bytes.length);
    # servletOutputStream.write(bytes, 0, bytes.length);
    # servletOutputStream.flush();
    # servletOutputStream.close();
    # }catch(Exception e){}

  • How to display Pdf file in iPad site

    Hi
    How to display Pdf file in web page which can able to view in iPad safari?
    Thanks,
    Arun

    You can't really.
    You need to use DHTML in the swf-wrapper HTML file, usually a
    division wrapped iFrame, and load the PDF into the iFrame as an
    overlay to the Flash.

  • How to upload pdf file in iphone and how to view

    how to upload and how to view pdf file in iphone 5s

    Hey saif.antri,
    You can view PDFs and more using iBooks on your iPhone:
    iBooks: Viewing, syncing, saving, and printing PDFs on iPhone, iPad, and iPod touch
    http://support.apple.com/kb/HT4227
    Have a great day,
    Delgadoh

  • HOW TO CONVERT PDF FILE IN TO XML FILE?

    HOW TO CONVERT PDF FILE IN TO XML FILE

    No Office programs can open a pdf and edit the contents so you will have to get a different app to convert teh pdf into xls format. There are plenty to be found on the web.
    Rod Gill
    The one and only Project VBA Book
    Rod Gill Project Management

  • How to upload pdf file in a canvas in flex web application?

    how to upload pdf file in a canvas in flex web application?

    Hey saif.antri,
    You can view PDFs and more using iBooks on your iPhone:
    iBooks: Viewing, syncing, saving, and printing PDFs on iPhone, iPad, and iPod touch
    http://support.apple.com/kb/HT4227
    Have a great day,
    Delgadoh

  • How to call PDF file in Web Dynpro Appl?

    How to call PDF file in Web Dynpro Appl?

    Hi Gobinath,
    1. Create a value attribute of type byte called pdfSource.
    2. Insert an UI element called Interactive Form in your layout
    3. Set the source property of this Interactive From UI element to the context pdfSource.
    4. Insert a button which would open your pdf file.
    public void onActionsubmit(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionsubmit(ServerEvent)
       IPrivate<viewname>.IContextElement contextElement = wdContext.currentContextElement();
             byte[] bytes = contextElement.getPdfSource();
             try
                   File file = new File("C:
    temp
    example.pdf");
                   FileOutputStream os = new FileOutputStream(file);
                   os.write(bytes);
                   os.close();
                catch (IOException e)
                   // do something
                   e.printStackTrace();
        //@@end
    Warm Regards,
    Murtuza

  • How to display pdf file in windows phone 8 silver light application?

    Hi,
    I am developing windows phone 8 silver light application . For my app I want to display pdf files . Is there any default controls to display pdf files ?
    I don't want to display using launchers , I want to display with in the app.
    any help,
    Thanks..
    Suresh.M

    Probably this should give you a fair idea : How to view PDF file inside an Windows Phone application?
    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

  • Can't open a pdf file attachement to e-mail

    I canot open an e-mail pdf file attachment..I get a message
    You have chosen to open Invoice---pdf
    which is: Firefox HTML Document (479kB)
    What should Thunderbird do with this file?
    Open with Firefox (default)
    I do all of the above but nothing happens and I keep getting the same message over andf over again??
    Please advise what I should do
    Thanksd

    Thanks. I disabled Protected Mode, and I was able to open the pdf attachment. Just to make sure, I enabled it and then disabled it again, and when I tried to open the attachment, it did as before – Adobe Reader (Not Responding) and Internal Error message. Tried it several more times, (enable and then disable Protected Mode) and each time, Adobe Reader wouldn’t launch (Not Responding, Internal Error).
    Morris Davidson

  • How to open *.pdf files in BOXI r2 inbox

    I am scheduling as  *.pdf file for deski report.After scheduling i am getting *.pdf in my inbox.if the report is deski or webi we can use FC_REPORT_ENGINE or WI_REPORT_ENGINE to open the report's using java code.In same way how to open *.PDF file in Inbox?
    Edited by: ramkishore kishore on Nov 7, 2008 8:31 AM
    Edited by: ramkishore kishore on Nov 7, 2008 8:31 AM

    Hi Ram,
    Following information might help you to resolve the issue.
    After logging into Desktop Intelligence, you may be presented with a message stating:
    u201CYou have received 1 document from users"
    Examining the Inbox from within the Desktop Intelligence client shows no objects visible in your Inbox.
    The object in your Inbox is in a format other than Desktop Intelligence format such as, PDF, XLS or other format. Therefore the object is not recognized by the Desktop Intelligence client inbox browser.
    Log in to Info View or the Central Management Console, browse to your Inbox and verify the file name and format that has been sent to your Inbox. The object may be saved, copied, moved or deleted as necessary.
    Regards,
    Sarbhjeet Kaur

  • How to create pdf files in UNIX directory from oracle reports

    I would like to know how to create pdf files in UNIX directory from oracle reports.
    Thanks,

    Please make your question more clear . Also mention the reports version.
    1) If you are runnning reports in Unix, you can give
    .... destype=file desformat=pdf desname=<filename>
    in command line
    Please refer docs below.
    2) If by your question you mean
    "My reports server is running in Windows but I want to ftp my files to Unix after creating it"
    then the answer is that you can use pluggable destination "ftp"
    .... destype=ftp desformat=pdf desname=<ftp url>
    Pluggable destinations download
    http://otn.oracle.com/products/reports/pluginxchange/index.html
    Thanks
    Ratheesh
    [    All Docs     ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf

Maybe you are looking for

  • How  can i do to reappear the hd icon on the disk utility

    In this day my computer erase all the program,files, and the operating sistem. i need to format my computer but when i go to install the operatting system again the hd icon dont appear. What can i do?

  • IWeb - cant adjust hyperlinks to open page in new window

    Anyone know of a work around to this obvious shortcoming? ...other then hacking the html code? the website is: www.apexjiujitsu.com My Links page is the one that I'd like to set parent=_ or whatever the value is for new window instead of same window

  • IDoc SHP_OBDLV_CHANGE01 / BAPI_OUTB_DELIVERY_CHANGE

    I want to make a batch split on an outbound delivery. I can't find documentation on IDoc SHP_OBDLV_CHANGE01 or BAPI_OUTB_DELIVERY_CHANGE on which fields to fill. I have a delivery with 1 item - posnr 10. On this item I wan't to update the quantity an

  • Refering to a structure field by it's number

    Hi, I think i've seen it somewhere, but can't find it now Is it possible to refer to a structure component by it's number rather then by it's name? For example if structure ZSTRUCT consists of fields: ZFIELD1, ZFIELD2 and ZFIELD3 Can I refer to ZSTRU

  • Started Today! Ebay descriptions loading in html only / font is tiny

    On the sell an item page of Ebay, my description will only load in html. It worked fine last night, but today I cannot get it to work right in Firefox. It looks perfectly normal in IE. Please help, I rather use Fire if I can. The other problem is tha