Conversion to PDF problem

Spool to PDF is failing....when line size is greater than 255 character..
only 255 chararcters are coming up in the PDF
I have to convert the spool (Abaplist) to PDF and send as a mail attachment.
Any help is highly appreicated.

First generate a spool request by executing ur print program and selecting the option"New spool request" and then click on print previw and then Text->print
it will give u the Spool request number on the status bar..
now execute report RSTXPDFT4 ( DOWNLOAD SAPSCRIPT TO PDF FILE ON LOCAL PC)..
now write the following code to send this PDF as attachment -
*& Report ZGILL_SENDMAIL_PDF *
REPORT ZGILL_SENDMAIL_PDF .
INCLUDE ZGILL_INCMAIL. "SEE BELOW FOR INCLUDE PROGRAM CODE.
DATA
DATA : itab LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : file_name TYPE string.
data : path like PCFILE-PATH.
data : extension(5) type c.
data : name(100) type c.
SELECTION SCREEN
PARAMETERS : receiver TYPE somlreci1-receiver lower case DEFAULT '[email protected]'.
PARAMETERS : p_file LIKE rlgrap-filename
OBLIGATORY DEFAULT 'C:\TEMP\SALARY_SLIP1.PDF'.
AT SELECTION SCREEN
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CLEAR p_file.
CALL FUNCTION 'F4_FILENAME'
IMPORTING
file_name = p_file.
START-OF-SELECTION
START-OF-SELECTION.
PERFORM ml_customize USING 'Tst' 'Testing'.
PERFORM ml_addrecp USING receiver 'U'.
PERFORM upl.
PERFORM doconv TABLES itab objbin.
PERFORM ml_prepare USING 'X' extension name.
PERFORM ml_dosend.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
FORM
FORM upl.
file_name = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = file_name
filetype = 'BIN'
TABLES
data_tab = itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
path = file_name.
CALL FUNCTION 'PC_SPLIT_COMPLETE_FILENAME'
EXPORTING
complete_filename = path
CHECK_DOS_FORMAT =
IMPORTING
DRIVE =
EXTENSION = extension
NAME = name
NAME_WITH_EXT =
PATH =
EXCEPTIONS
INVALID_DRIVE = 1
INVALID_EXTENSION = 2
INVALID_NAME = 3
INVALID_PATH = 4
OTHERS = 5
ENDFORM. "upl
*********************iNCLUDE pROGRAM********************************************
*& Include ZGILL_INCMAIL *
Data
DATA: docdata LIKE sodocchgi1,
objpack LIKE sopcklsti1 OCCURS 1 WITH HEADER LINE,
objhead LIKE solisti1 OCCURS 1 WITH HEADER LINE,
objtxt LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objbin LIKE solisti1 OCCURS 10 WITH HEADER LINE,
objhex LIKE solix OCCURS 10 WITH HEADER LINE,
reclist LIKE somlreci1 OCCURS 1 WITH HEADER LINE.
DATA: tab_lines TYPE i,
doc_size TYPE i,
att_type LIKE soodk-objtp.
DATA: listobject LIKE abaplist OCCURS 1 WITH HEADER LINE.
FORM
FORM ml_customize USING objname objdesc.
Clear Variables
CLEAR docdata.
REFRESH objpack.
CLEAR objpack.
REFRESH objhead.
REFRESH objtxt.
CLEAR objtxt.
REFRESH objbin.
CLEAR objbin.
REFRESH objhex.
CLEAR objhex.
REFRESH reclist.
CLEAR reclist.
REFRESH listobject.
CLEAR listobject.
CLEAR tab_lines.
CLEAR doc_size.
CLEAR att_type.
Set Variables
docdata-obj_name = objname.
docdata-obj_descr = objdesc.
ENDFORM. "ml_customize
FORM
FORM ml_addrecp USING preceiver prec_type.
CLEAR reclist.
reclist-receiver = preceiver.
reclist-rec_type = prec_type.
APPEND reclist.
ENDFORM. "ml_customize
FORM
FORM ml_addtxt USING ptxt.
CLEAR objtxt.
objtxt = ptxt.
APPEND objtxt.
ENDFORM. "ml_customize
FORM
FORM ml_prepare USING bypassmemory whatatt_type whatname.
IF bypassmemory = ''.
Fetch List From Memory
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = listobject
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'LIST_FROM_MEMORY'.
ENDIF.
CALL FUNCTION 'TABLE_COMPRESS'
IMPORTING
COMPRESSED_SIZE =
TABLES
in = listobject
out = objbin
EXCEPTIONS
OTHERS = 1
IF sy-subrc <> 0.
MESSAGE ID '61' TYPE 'E' NUMBER '731'
WITH 'TABLE_COMPRESS'.
ENDIF.
ENDIF.
Header Data
Already Done Thru FM
Main Text
Already Done Thru FM
Packing Info For Text Data
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 = 'TXT'.
APPEND objpack.
Packing Info Attachment
att_type = whatatt_type..
DESCRIBE TABLE objbin LINES tab_lines.
READ TABLE objbin INDEX tab_lines.
objpack-doc_size = ( tab_lines - 1 ) * 255 + STRLEN( objbin ).
objpack-transf_bin = 'X'.
objpack-head_start = 1.
objpack-head_num = 0.
objpack-body_start = 1.
objpack-body_num = tab_lines.
objpack-doc_type = att_type.
objpack-obj_name = 'ATTACHMENT'.
objpack-obj_descr = whatname.
APPEND objpack.
Receiver List
Already done thru fm
ENDFORM. "ml_prepare
FORM
FORM ml_dosend.
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = docdata
put_in_outbox = 'X'
commit_work = 'X' "used from rel. 6.10
IMPORTING
SENT_TO_ALL =
NEW_OBJECT_ID =
TABLES
packing_list = objpack
object_header = objhead
contents_bin = objbin
contents_txt = objtxt
CONTENTS_HEX = objhex
OBJECT_PARA =
object_parb =
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
IF sy-subrc <> 0.
MESSAGE ID 'SO' TYPE 'S' NUMBER '023'
WITH docdata-obj_name.
ENDIF.
ENDFORM. "ml_customize
FORM
FORM ml_spooltopdf USING whatspoolid.
DATA : pdf LIKE tline OCCURS 0 WITH HEADER LINE.
Call Function
CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = whatspoolid
TABLES
pdf = pdf
EXCEPTIONS
err_no_otf_spooljob = 1
OTHERS = 12.
Convert
PERFORM doconv TABLES pdf objbin.
ENDFORM. "ml_spooltopdf
FORM
FORM doconv TABLES
mypdf STRUCTURE tline
outbin STRUCTURE solisti1.
Data
DATA : pos TYPE i.
DATA : len TYPE i.
Loop And Put Data
LOOP AT mypdf.
pos = 255 - len.
IF pos > 134. "length of pdf_table
pos = 134.
ENDIF.
outbin+len = mypdf(pos).
len = len + pos.
IF len = 255. "length of out (contents_bin)
APPEND outbin.
CLEAR: outbin, len.
IF pos < 134.
outbin = mypdf+pos.
len = 134 - pos.
ENDIF.
ENDIF.
ENDLOOP.
IF len > 0.
APPEND outbin.
ENDIF.
ENDFORM. "doconv
**********************INCLUDE END********************************
Reward points if helps.

Similar Messages

  • Word 2007 Arabic conversion to PDF - problems - help?

    I have a Word 2007 document with Arial font that contains English and Arabic (Saudi Arabia) languages. When I "Create PDF" from the Acrobat toolbar in Word, the PDF that results is mostly white space because only the English text is converted. All of the Arabic text is missing. I haven't experienced this in the past, but I'm not sure if that's due to using an older version of Word or an older version of Acrobat, or perhaps both. I'm currently using Acrobat 9 Pro. Any help or suggestions would be much appreciated. Thank you.

    You can save any Office file as a .pdf. No additional software needed.
    Ceate the document then start the print process (command + P). The bottom of the print dialog box gives you a button that gives a drop-down with the optionto save the document as PDF.

  • Weird Print problems and conversion to PDF problems...

    I edited a logo in Illustrator for a hat using spot colors. 3 colors total. I saved as illustrator and then placed in InDesign for sizing. I printed it and some of the color didnt show up. So I figured it was the spot colors screwing with our printer. I printed again, but this time, in the ink manager of the print dialogue, I converted all spots to process. That substantially changed the colors in the image. I saved to PDF and then opened in Photoshop, and I get missing color plus changed color. Whats up? Looks great on screen when in Illustrator, and placed in InDesign.. but when It prints or is converted to PDF and opened in Photoshop, it goes to hell.
    All Creative Suite 2 files on a Mac

    Yep.. it's an overprint issue. When I open the PDF, the overprint version is all screwed up... and over print preview OFF looks fine.
    Why is overprint doing anything? I dont intentionally do anything with overprint..I dont really know what overprint is, let alone want anything to do with overprint. I want whats on screen to print...
    Chris

  • Converting Word 2007 to PDF problem

    I have Word 2007 and Adobe Acrobat 9. When I try to save my word file to PDF the PDF font looks distorted throuhout the document. I'm using standard fonts and I have done this many times before without a problem. This just started today.

    Try printing to the Adobe PDF printer and see what you get. If that works, then let's go from there.
    I think you used the MS conversion to PDF, not the Acrobat conversion and if that is the case, it is a MS issue.

  • How can I perform the conversion of pdf files in Cyrillic script to Word files in Cyrillic script. The pdf file is too small for me to read right now. Julyan Watts

    How can I perform the conversion of .pdf files in Cyrillic script to Word files in Cyrillic script. The .pdf file is too small for me to read without a magnifying glass, and the document is more than one thousand pages.

    This answer was not helpful. First of all, I could not find "tech specs"
    anywhere on the Acrobat 11 homepage. And secondly I purchased this software
    for the specific purpose of converting .pdf files to Word. It was only
    after I had completed the purchase that I learnt that Acrobat does not
    permit the conversion of .pdf files in Cyrillic to Word files  in Cyrillic.
    I feel that Acrobat should have provided this crucial information before I
    allowed my credit card to be debited. That is why I  am now asking for my
    money back. But thanks for your attempt to solve my problem, even if it was
    not successful.
    Julyan Watts

  • Please Help! Converted word to pdf problems

    When I convert a 2 page word document into a pdf, the pdf turns into 4 pages. The whole document expands. Please help me fix this problem.
    Thank you so much!!!!

    Hello Deanna Tat
    Simply use 'Cute PDF writer 2.6' Freeware that comes along with Ghostscript Convertor. Download it from website.
    I am using it for past 5 years without any errors or problems, no matter how many text files are printed for conversions into PDF.
    I have used in all computers with no problems.
    It is easy, no adjustments required, and is hence user friendly.
    It is absolutely free stuff.
    Dinkar
    [email protected]

  • PDF problems in Acrobat 9 Pro

    PDF problems in Acrobat 9 Pro
    I'm using windows 7, 64 bit version
    What can be the cause of dots, where underground otherwise white appearance with small black dots.
    They do not come with the pressure. but is rather confusing.
    Mox
    PDF problems in Acrobat 9 Pro
    here's an example of the dots, and yes I have updated acrobat

    You're asking a lot of ancient Acrobat to work with an Office that never existed when it was made. "Just updated my office suite" is a massive change, and Window 8 didn't exist at that time either...

  • PDF problem part 2...

    I guess a lot of people are having pdf problems.
    When I export a pdf of a Travel Journal doc and view with adobe reader 7.0, the borders on the photos are not there.
    What is the word on this?
    As you can see I don't have Tiger /PDF-X.
    Thanks

    Not certain if this is quite the same thing, but.......
    I have found problems when exporting to pdf, not when I open in Preview but when the person I am emailing the file to opens it in Acrobat, as all drop shadows are then lost, this makes professional printing difficult.
    Resolved it for the moment by:
    1. exporting to pdf as normal
    2. using Graphic Converter which comes bundled with OSX to create a PSD file and sending that electronically. Slight problem was that the size of the file increased from 3mb to about 27mb, so had to download a free copy of Cyberduck ftp programme too. In fact saving it to jpeg was just about as good.
    3. you do have to do one page at a time but it works.

  • I purchased the Adobe pdf Pack to combine 50 PDF files to one and when I select them from my folder it claims "the files are not in a format not supported for conversion to PDF".  They already are pdfs, what am I doing wrong?".

    I purchased the Adobe pdf Pack to combine 50 PDF files to one and when I select them from my folder it claims "the files are not in a format supported for conversion to PDF".  They already are pdfs, what am I doing wrong?

    Moved to Adobe PDF Pack (read only)

  • Batch Conversion of PDF to Postscript

    I've been trying write a script for Batch conversion of PDF to PS files, using "silent" printing. I'm apparently missing something, because acrobat keeps crashing after executing the script (and the .ps files are not being created). Its also still prompting me for a filename. Not really sure of the syntax for keeping the same filename? I'm new to java script, so I'm sure its something I have wrong. My code is below, if anyone can help me out. I'm using Acrobat 7.0.9
    this.print ({bUI: false,bSilent: true,bShrinktoFit: true,});
    var pp = this.getPrintParams();
    pp.interactive = pp.constants.interactionLevel.automatic;
    pp.printername = "Xerox Docuprint 92C NPS PS2 C1";
    pp.filename = "c:\temp\$filename$.ps";
    this.print(pp);
    Thanks

    Why are you calling the print method twice?
    Your syntax in the first call to print is in error. You have a comma after bShrinkToFit: true which is telling the JS interpreter to expect another argument.
    Use this for filename (not the capital N in filename ... use proper case for property names):
    pp.fileName = "/c/temp/" + this.documentFileName + ".ps";
    Also, when printing to PostScript you shouldn't specify a printer name. Use this (again, note the proper case for properties):
    pp.printerName = "";
    It says exactly this in the documentation for the fileName property of the PrintParams object. I suggest you read the documentation relating to the methods you're trying to use ... always a good place to find answers.
    > When printerName is an empty string and fileName is specified, the current document is saved as a PostScript file.
    Although it may not consider C:\temp a "safe path" (I can't remember off the top of my head). You'll want to read the documentation regarding JavaScript "safe paths". If it is still prompting you for a filename it is most likely ignoring your path due to security restrictions.

  • Conversion from .pdf to .docx: I have converted a text in Slovenian in .pdf, but all the accents are missing in the converted .docx. version

    Conversion from .pdf to .docx:
    I have converted a text in Slovenian in .pdf, but all the accents are missing in the converted .docx. version.
    Does Adobe have a converter for texts with European-language accents, or shall I cancel my subscription?

    Subscription for what: ExportPDF or Acrobat?
    [topic moved to Acrobat.com Services forum]

  • Conversion for pdf to word in something I can read?

    Conversion from pdf to Word and not in machine language>

    I decided to put it away last night and start fresh this morning with a fresh mind, as I had logged in, loaded into the cloud, etc. as I was prompted to do at every new screen.  This morning I took a new direction and  I logged in at Adobe.com, found my account management info (which I couldn't figure out how to access last night).  It appears that you don't have any services associated with my account at all, and that the version I was using was a free service?  However I have a record of paying Adobe $29.95 on December 9th.  What exactly did I pay for if I do not have any services in my account?  Below is the transaction from my visa.  Can you look into this for me, or should I go through the account management help service?
    Dec 09 Dec 11 ADOBE SYSTEMS, INC. 800-833-6687 WA
    27.46 USD @ 1.090677349**
    Foreign Currency Transactions 29.95

  • Download Conversion of PDF to JPEG...

    23 December 2012
    My Computer doesn't have a conversion from PDF to JPEG. How can I have it for free?
    Best wishes and God bless!
    Earl

    Hi Baby look,
    Please follow the instructions below to convert pdf to jpeg :
    Open the PDF document you want to convert in Adobe Acrobat Reader, a free PDF viewer.
    Click the "Snapshot" icon in the tools bar. The icon resembles a small camera. If the icon is not visible, right click the tool bar and select "Snapshot" from the bottom of the "More Tools" list.
      Move the Snapshot cursor, which is displayed as a small cross, to the beginning of the section in the PDF document you want to copy.
    Click and hold your mouse button. Drag the cursor to the end of the section you want to copy.
    Release the mouse button. The section you outlined is automatically copied to your clipboard as a JPEG image and highlighted in Adobe Reader to indicate the copy is complete.
    Open an image editing program such as IrfanView or MS Paint. Press "Ctrl+V" on your keyboard to paste the copied image.
    Press "Ctrl+S" to save the copied image as a JPEG file.

  • Serverside conversion of PDF to Image (JPEG, GIF, PNG)

    Hello JDCers.....
    I am currently looking for a serverside component (or some info on how to build one).... that will allow on the fly conversion of pdf to an image format on my web server...
    Any help would be greatly appreciated....
    Thanks
    Fahim

    here is some code that does the trick...
    import java.awt.Graphics2D;
    import java.awt.RenderingHints;
    import java.awt.image.BufferedImage;
    import java.awt.image.RenderedImage;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.File;
    import java.util.Vector;
    import javax.imageio.ImageIO;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletResponse;
    import com.sun.media.jai.codec.ImageCodec;
    import com.sun.media.jai.codec.ImageDecoder;
    import com.sun.media.jai.codec.ImageEncoder;
    import com.sun.media.jai.codec.PNGEncodeParam;
    import com.sun.media.jai.codec.SeekableStream;
    import com.sun.media.jai.codec.TIFFDecodeParam;
    import com.sun.media.jai.codec.TIFFDirectory;
    import multivalent.Behavior;
    import multivalent.Context;
    import multivalent.Document;
    import multivalent.Node;
    import multivalent.std.adaptor.pdf.PDF;
    public class PDFToPNG extends HttpServlet {
         private static final long serialVersionUID = 1L;
         public byte[] ConvertToPngImage(byte[] tiffRawData, HttpServletResponse res)
                   throws Exception {
              Vector pngs = new Vector();
              // set stream to the tiff url
              SeekableStream tiffStream = SeekableStream.wrapInputStream(
                        new ByteArrayInputStream(tiffRawData), true);
              // how many pages in one tiff
              int pageNumber = TIFFDirectory.getNumDirectories(tiffStream);
              TIFFDecodeParam decodeParam = new TIFFDecodeParam();
              decodeParam.setDecodePaletteAsShorts(true);
              ImageDecoder tiffDecoder = ImageCodec.createImageDecoder("tiff",
                        tiffStream, decodeParam);
              // for (int p = 0; p < pageNumber; p ++) {
              // render the current page
              RenderedImage tiffPage = tiffDecoder.decodeAsRenderedImage();
              PNGEncodeParam png = PNGEncodeParam.getDefaultEncodeParam(tiffPage);
              // The png stream is outputted to a file. Change the directory
              // accordingly.
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
              // Gets a PNG encoder.
              ImageEncoder pngEncoder = ImageCodec.createImageEncoder("PNG", baos,png);
              // Encodes the RenderedImage object.
              pngEncoder.encode(tiffPage);
              byte[] content = baos.toByteArray();
              baos.close();
              return content;
         public static void main(String args[]) {
              File outfile = new File("c:\\file.png");
              try {
                   PDF pdf = (PDF) Behavior.getInstance("AdobePDF", "AdobePDF", null,
                             null, null);
                   File file = new File("c:\\somepdf.pdf");
                   pdf.setInput(file);
                   Document doc = new Document("doc", null, null);
                   pdf.parse(doc);
                   doc.clear();
                   doc.putAttr(Document.ATTR_PAGE, Integer.toString(1));
                   pdf.parse(doc);
                   Node top = doc.childAt(0);
                   doc.formatBeforeAfter(200, 200, null);
                   int w = top.bbox.width;
                   int h = top.bbox.height;
                   BufferedImage img = new BufferedImage(w, h,
                             BufferedImage.TYPE_INT_RGB);
                   Graphics2D g = img.createGraphics();
                   g.setClip(0, 0, w, h);
                   g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
                             RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
                   g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
                             RenderingHints.VALUE_ANTIALIAS_ON);
                   g.setRenderingHint(RenderingHints.KEY_RENDERING,
                             RenderingHints.VALUE_RENDER_QUALITY);
                   Context cx = doc.getStyleSheet().getContext(g, null);
                   top.paintBeforeAfter(g.getClipBounds(), cx);
                   ImageIO.write(img, "png", outfile);
                   doc.removeAllChildren();
                   cx.reset();
                   g.dispose();
                   pdf.getReader().close();
                   outfile = null;
                   doc = null;
              } catch (Exception e) {
    }

  • Adobe export pdf problem

    conversion from pdf to excel not putting values in separate colums

    In XI.
    I can’t just export to word as I have done in the past in one simple click.  
    Convert to button is greyed out.
    Now I have to save the pdf file on c drive when I am in outlook…then goto export pdf file…then find file then export to word.
    I bought new computer with windows 8 (which is awful) and then bought pdf export again…
    Any thoughts on how I can get back to one simple click again when I open a pdf file from an email in outlook?
    Thank you,
    Mike

Maybe you are looking for

  • Thumbnail view for ical?

    i love the mimum window for itunes (it shows only what's playing and a couple buttons for control by clicking the green window control button in titlebar)... is there a way to shrink ical down to do the same kind of thing? it would be ideal to show e

  • Macbook Late 2011 and Dell UltraSharp 29"

    Hi! I have a Macbook 13" Late 2011 and i'm about to buy a Dell UltraSharp 29" (http://www.pcmag.com/article2/0,2817,2414974,00.asp). I would like to know if my Macbook will be able to support the maximum resolution 2560x1080. Anyone knows if the Mini

  • Returns in sap crm

    hi this is vinaykumar iam new to this Group., i had one query regarding Returns process in SAP CRM., how we will configure in CRM if any one had relevant info plz post it as soon as possible <b>it is a humble request</b>

  • Error compiling MS HTML Help from RH7

    I have today installed Robohelp 7 and converted an existing RH X5 project. This seemed to work fine. However, on attempting to compile single source Microsoft HTML Help, I immediately get an error dialog - 'Cannot find the HTML Help browser installed

  • In repository what is the use of communication channel templates

    Hi People                  what is the use of communication channel templates in integration repository? and  when we are using that please tell me the ASAP Thanks & Regards shekar