Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to compress PDF file when sending email through SP01

yang_aiolos
Active Participant
0 Kudos

Hi expert,

i need your help.

when i use tcode SP01 and fetch the spool no which i want, then select the spool no, cilick menu Spool Request->Forward->Send using SAPOffice to send mail.

i can send the list as an attached file to external mailbox.

Now the problem is : the size of attached PDF file is too large, how to compress it? make it more smaller?

Thanks&Regards

Aiolos

Edited by: yang Aiolos on Nov 24, 2010 10:08 PM

4 REPLIES 4

Former Member
0 Kudos

hi,

Compress the files:


CALL METHOD cl_abap_gzip=>compress_binary
             EXPORTING
               raw_in   = <uncompressed binary string>
             IMPORTING
               gzip_out = <compressed binary string>.

And the send of files by mail continues the same.

I don´t use SP01 so i don´t know if there is any exit or badi you can use..

Search for ABAP Class to gip and gunzip

or go here..

LINK: Class to gip and gunzip

0 Kudos

hi J_Figueiredo ,

thanks for your reply, but i don't want to use the code to achieve this, i only want to know how to configurate this to compress the PDF file.

or can anyone let me know how to make the file smaller in spool, i think maybe that will be working also.

Thanks.

Former Member
0 Kudos

Hi Aiolos,

If your concern is with the size of the pdf file being sent in a mail, do refer to the below wiki.

[http://wiki.sdn.sap.com/wiki/display/ABAP/CL_ABAP_ZIPusage-ZippingABAPreportoutput]

Regards

Raj

Former Member
0 Kudos

Hi,

After Converting list to Pdf try the below code.

DATA : GD_BUFFER TYPE STRING.

LOOP AT IT_PDF_OUTPUT.

TRANSLATE IT_PDF_OUTPUT USING ' ~'.

CONCATENATE GD_BUFFER IT_PDF_OUTPUT INTO GD_BUFFER.

ENDLOOP.

TRANSLATE GD_BUFFER USING '~ '.

DO.

IT_MESS_ATT = GD_BUFFER.

APPEND IT_MESS_ATT.

SHIFT GD_BUFFER LEFT BY 255 PLACES.

IF GD_BUFFER IS INITIAL.

EXIT.

ENDIF.

ENDDO.

Then mail it. <removed by moderator>

Edited by: Thomas Zloch on Nov 25, 2010 10:21 AM - please do not ask for ...