Spool to PDF - Problems with downloading PDF file when converting with job

Hi all!
I've got a problem. I've got a program that writes a smartform into the spool. After that, I am using the function modules RSTS_GET_ATTRIBUTES and CONVERT_OTFSPOOLJOB_2_PDF to convert it into PDF. I retrieve a internal table with the binary content for the PDF file. Now i can download the file to the desktop by using the method cl_gui_frontend_services=>gui_download.
But there is a problem: when the spool excesses 99 pages, the function module CONVERT_OTFSPOOLJOB_2_PDF asks the user via popup if the PDF should be created in background. If the user commits, the internal tables that should contain the binary PDF data is emtpy. A background job writes the binary data into the spool. The user has got an empty file that will be generated by cl_gui_frontend_services=>gui_download.
So, is it possible to suppress the popup to create the PDF allways online? Or how can I write the PDF file if there will be create any spool id in background? You'll find my current code below.
* Prüfen ob es die übergebene Spoolnummer überhaupt gibt
  SELECT SINGLE * FROM tsp01 INTO ls_tsp01 WHERE rqident = id_spoolid.
  IF ( sy-subrc <> 0 ).
    cf_error = 'X'.
    EXIT.
  ENDIF.
* TemSe-Objekte speichern sequentielle Daten. Ein TemSe-Objekt kann aus
* mehreren Teilen bestehen. Dieser FB ermittelt die wichtigsten Attribute
* eines TemSe-Objekts. Falls das Objekt aus mehreren Teilen besteht, werden
* die Attribute entsprechend zusammengefaßt.
  CALL FUNCTION 'RSTS_GET_ATTRIBUTES'
    EXPORTING
      client        = ls_tsp01-rqclient
      name          = ls_tsp01-rqo1name
      part          = 1
    IMPORTING
      objtype       = ld_objtype
    EXCEPTIONS
      fb_error      = 1
      fb_rsts_other = 2
      no_object     = 3
      no_permission = 4
      OTHERS        = 5.
  IF ( sy-subrc <> 0 ).
    cf_error = 'X'.
    EXIT.
  ENDIF.
  IF ld_objtype(3) = 'OTF'.
    lf_is_otf = 'X'.
  ELSE.
    lf_is_otf = ' '.
  ENDIF.
  IF ( lf_is_otf = 'X' ).
*   Konvertiere OTF-Spoolauftrag nach PDF
    CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
      EXPORTING
        src_spoolid              = id_spoolid
        no_dialog                = ' '
*        pdf_destination          = 'T'
      IMPORTING
        pdf_bytecount            = ld_numbytes
        pdf_spoolid              = ld_pdfspoolid
        btc_jobname              = ld_jobname
        btc_jobcount             = ld_jobcount
      TABLES
        pdf                      = lt_pdf
      EXCEPTIONS
        err_no_otf_spooljob      = 1
        err_no_spooljob          = 2
        err_no_permission        = 3
        err_conv_not_possible    = 4
        err_bad_dstdevice        = 5
        user_cancelled           = 6
        err_spoolerror           = 7
        err_temseerror           = 8
        err_btcjob_open_failed   = 9
        err_btcjob_submit_failed = 10
        err_btcjob_close_failed  = 11.
    IF ( sy-subrc <> 0 ).
      cf_error = 'X'.
      EXIT.
    ENDIF.
  ELSE.
*   Konvertiere ABAP-Liste-Spoolauftrag nach PDF
    CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
      EXPORTING
        src_spoolid              = id_spoolid
        no_dialog                = ' '
      IMPORTING
        pdf_bytecount            = ld_numbytes
        pdf_spoolid              = ld_pdfspoolid
        btc_jobname              = ld_jobname
        btc_jobcount             = ld_jobcount
      TABLES
        pdf                      = lt_pdf
      EXCEPTIONS
        err_no_abap_spooljob     = 1
        err_no_spooljob          = 2
        err_no_permission        = 3
        err_conv_not_possible    = 4
        err_bad_destdevice       = 5
        user_cancelled           = 6
        err_spoolerror           = 7
        err_temseerror           = 8
        err_btcjob_open_failed   = 9
        err_btcjob_submit_failed = 10
        err_btcjob_close_failed  = 11.
    IF ( sy-subrc <> 0 ).
      cf_error = 'X'.
      EXIT.
    ENDIF.
  ENDIF.
  WHILE ( lf_file_ok = '' ).
*   Die in der Tabelle lt_pdf enthaltenen Binärdaten werden nun in eine
*   Datei geschrieben. Da alle übergebenen Tickets in die gleiche Datei
*   geschrieben werden, kann der im Speicher gehaltente Protokolleintrag
*   gelesen werden
    CALL METHOD cl_gui_frontend_services=>gui_download
      EXPORTING
        bin_filesize              = ld_numbytes
        filename                  = cd_filename
        filetype                  = 'BIN'
*    append                    = SPACE
*    write_field_separator     = SPACE
*    header                    = '00'
*    trunc_trailing_blanks     = SPACE
*    write_lf                  = 'X'
*    col_select                = SPACE
*    col_select_mask           = SPACE
*    dat_mode                  = SPACE
      confirm_overwrite         = 'X'
*    no_auth_check             = SPACE
*    codepage                  = SPACE
*    ignore_cerr               = ABAP_TRUE
*    replacement               = '#'
*    write_bom                 = SPACE
*    trunc_trailing_blanks_eol = 'X'
*    wk1_n_format              = SPACE
*    wk1_n_size                = SPACE
*    wk1_t_format              = SPACE
*    wk1_t_size                = SPACE
*  IMPORTING
*    filelength                =
      CHANGING
        data_tab                  = lt_pdf
      EXCEPTIONS
        file_write_error          = 1
        no_batch                  = 2
        gui_refuse_filetransfer   = 3
        invalid_type              = 4
        no_authority              = 5
        unknown_error             = 6
        header_not_allowed        = 7
        separator_not_allowed     = 8
        filesize_not_allowed      = 9
        header_too_long           = 10
        dp_error_create           = 11
        dp_error_send             = 12
        dp_error_write            = 13
        unknown_dp_error          = 14
        access_denied             = 15
        dp_out_of_memory          = 16
        disk_full                 = 17
        dp_timeout                = 18
        file_not_found            = 19
        dataprovider_exception    = 20
        control_flush_error       = 21
        not_supported_by_gui      = 22
        error_no_gui              = 23
        OTHERS                    = 24.

Creating a PDF file with over 99 pages through SAP seems rather unreasonable to me. What are you printing - Encyclopedia Britannica? For cripes sake... Have you thought about creating more than one spool request or using something completely different? Why do you have to do this through spool? You can get Smartform output directly into PDF, there are a lot of example out there.
The only solution that comes to mind is rather brutal - create a copy of the function module and get rid of the popup. Although it just might time out after that...

Similar Messages

  • Problem with downloading PDFs

    I have just downloaded a new version of Adobe Reader X 10.1.2 but can't download PDFs such as my electricity bill and t.v. licence

    Thanks for your help.  I’ve now sorted it via help from the site where I was trying to download the PDF from.  The following action solved the problem:
    ·        Click on 'Tools' then 'Internet Option'
    ·        Click 'Advanced'
    ·        Scroll down to Security
    ·        Uncheck 'Do Not Save Encrypted Pages to Disk'
    ·        Click 'Apply'
    ·        Click 'OK'
    Re: problem with downloading PDFs
    created by MichaelKazlow <http://forums.adobe.com/people/MichaelKazlow>  in Adobe Reader - View the full discussion <http://forums.adobe.com/message/4228358#4228358

  • I can not do the update , what should I do to fix this error ? "There was a problem with downloading the file . For tips on troubleshooting , please go to Customer Support . ( Error code : 204 ) ." thanks

    I can not do the update , what should I do to fix this error ?
    "There was a problem with downloading the file . For tips on troubleshooting , please go to Customer Support . ( Error code : 204 ) ." thanks

    Hi,
    Please refer to the help document below:
    Error downloading, installing, or updating Creative Cloud applications
    Regards,
    Sheena

  • Pdf creator is creating corrupt file on Mac with Mountain Lion

    pdf creator is creating corrupt file on Mac with Mountain Lion, how to rectify?

    Please say what PDF creator you have including version
    and how you know they are corrupt

  • Need some help with downloading PDF's from the net.

    need some help with downloading PDF's from the net.  Each time I try to click on a link from a website, if it takes me to a new screen to view a pdf, it just comes up as a blank black screen?  any suggestions?

    Back up all data.
    Triple-click the line of text below to select it, the copy the selected text to the Clipboard (command-C):
    /Library/Internet Plug-ins
    In the Finder, select
    Go ▹ Go to Folder
    from the menu bar, or press the key combination shift-command-G. Paste into the text box that opens (command-V), then press return.
    From the folder that opens, remove any items that have the letters “PDF” in the name. You may be prompted for your login password. Then quit and relaunch Safari, and test.
    The "Silverlight" web plugin distributed by Microsoft can also interfere with PDF display in Safari, so you may need to remove it as well, if it's present.
    If you still have the issue, repeat with this line:
    ~/Library/Internet Plug-ins
    If you don’t like the results of this procedure, restore the items from the backup you made before you started. Relaunch Safari again.

  • Im facing problem while trying to update my iphone 4 from version 4.3.1 to iOS 5. While processing the downloaded 774mb file, it comes with the statement that the network connection timed out. why???

    im facing problem while trying to update my iphone 4 from version 4.3.1 to iOS 5. While processing the downloaded 774mb file, it comes with the statement that the network connection timed out. why???

    i have been dealing with this same issue, tried to  turn off firewall and even turn of antivirud but still it gave me the same error.

  • "Safari cannot download this file" when I tried dl a .mobileconfig file

    Hi,
    I have been asked to research deployment of configuration to Ipod touch to determine if our clients will be able to use these devices on our secure network. According to the Enterprise Deployment Guide I should be able to send the Ipod Touch a .mobileconfig file:(http://manuals.info.apple.com/enUS/Enterprise_DeploymentGuide.pdf)
    But I'm getting the message "Safari cannot download this file" when I try to download the .mobileconfig file from our internal http portal.
    Any advice you have would be much appreciated. Thank you,
    M

    Hi M,
    There may be an issue with the website or the file, try emailing the profile to an account setup on the iPod touch.
    If the issue persists, try resetting or restoring the iPod touch.
    You can reset the iPod by holding the Home and Sleep/Wake buttons until you see the Apple logo as described here: http://docs.info.apple.com/article.html?artnum=305743
    This article: http://support.apple.com/kb/HT1414 will walk you through the restore process.
    Message was edited by: Jason L

  • HT1711 I puchased 3 songs and was charged and never downloading their currently sitting there with download error and when i tap to retry it still wont download waht can i do as i have been charged?

    I puchased 3 songs and was charged and never downloading their currently sitting there with download error and when i tap to retry it still wont download waht can i do as i have been charged?

    Have you tried signing out of itunes and then signing back in

  • 15" MacbWhite screen with a blinking file folder icon with a question mark on it.

    15" Macbook. When i power on all I get is white screen with a blinking file folder icon with a question mark on it.N

    You may have a bad hard drive.  The flashing folder with the ? indicates that the system cannot find your hard drive.  Use the installation disc that came with your machine.  Insert it into the disc drive and restart the machine holding down the "C" key .  When the restart shows the Apple screen you can release the C keyWhen the installation screen appears, click on the utilities button.  Does the left side of the disc utilities screen show your HD?  If not, then your HD is bad or it could be a loose connection. ifixit.com has a good tutorial on how to replace the HF in the Macbook.  Follow the instructions to remove your HD.  Reinstall your HD and boot up your machine to see if it recognizes your HD.  If it does't, you probably will need to replace your HD>
    Is your machine still under warranty?  If so, take it to your nearest Apple Store for repairs as the repairs will be covered under your warranty.  If you bought AppleCare when you bought your computer your warranty is for three years.  If you didn't buy the Apple Care, then your warranty is only good for one year from the date of purchase.

  • Anyone having trouble with downloads showing up after purchasing with os 11?

    anyone having trouble with downloads showing up after purchasing with os 11?

    jcosmo wrote:
    anyone having trouble with downloads showing up after purchasing with os 11?
    Did you really mean "os 11"?  There is no such OS.
    There is iTunes 11, is that possibly what you are referring to?
    It's best to be specific about the issues that are occurring and in what version, as some versions fix issues that exist in other version.

  • Having trouble with Tiscali/TalkTalk site when accessed with 'FireFox', can't 'reply' to emails or report 'spam', other functions seem ok

    Having trouble with Tiscali/TalkTalk site when accessed with 'FireFox',
    can't 'reply' to emails or report 'spam', other functions seem ok
    == This happened ==
    Every time Firefox opened
    == On/Off few months now all time

    Try deleting cookies and cache:
    1. Tools| Clear recent history
    2. Time range to clear: Everything
    3. If it isn't already selected, select '''Cookies''' and '''Cache'''
    4. '''Clear now'''
    <u>Check cookie exceptions</u>
    1. Tools | Options | Privacy Panel
    2. Set '''Firefox will: Use custom settings for history''' Insure Accept cookies for sites and accept third-party cookies is selected
    3. Click '''Exceptions'''. If the misbehaving site is in that list, select it and click '''Remove site'''
    Also see [[Updating Firefox]]

  • Quicktime Player with the magic mouse, when used with a bug -

    On 10.7 Lion, Quicktime Player with the magic mouse, when used with a bug …
    Quicktime Player will not respond, but use the USB mouse with no problem

    Message was edited by: b j t

  • Problems with downloading PDF copies of Statements

    Is anyone experiencing problems downloading PDF copies of billing statements? When I attempt to do so, every file I download is categorized by Adobe Acrobat as an invalid file/format. Thanks.

    Are you using the newer My Verizon web site? I know it allows you to download the bills in multiple formats.
    If you have not been switched yet, and you do switch, it will not allow you to switch back to the older MyVerizon format. I am not sure if everyone has switched over.
    http://www22.verizon.com/foryourhome/myaccount/ngen/upr/nlogin.aspx
    If you login and select Bill & Payment from the left side bar, the page should display the current bill.
    At the top of that page you will see a pull down menu that will allow the display of other months.
    To the right of the pull down, there is an icon that says "Get My Bill (Up to 24 months)" click on that icon, and it will start with the Current Bill.
    You can ask for paper bill select PDF or select other formats, click on Download My Bill, then it will say "Your PDF file of your bill is ready for download. " you musk click a second time. For the download to come up in the menu.
    This works for me, and I am only using the Latest Reader and not the Pro Version, But have Pro at work and have had no issues.
    It seems like a more complicated procedure as compared to the previous one, but it does provide multiple download formats, with more options that others have requested.

  • Problem opening downloaded PDF files

    When I click on a PDF link in Safari, I would normally expect the document to open with Acrobat 7.0.
    What is happening now, is that the screen changes to 'browse' option asking me to identify which application will open the PDF. When I click on Acrobat 7.0, the screen goes blank.
    So, basically, I can't open downloaded PDFs from Safari, (though it's Ok with Opera, Firefox etc)
    In the Acrobat prefs, in the internet settings, 'Display PDF in browser using: Adobe Acrobat 7.0 Professional (7.0.0)' is checked.
    Mac Power PC, 2G RAM, OSX 10.4.11; Safari 3.2.1, Acrobat 7.0.0

    Do you have more that one version of Acrobat or reader loaded?
    Only one is certified to work at a time.

  • Problem with Downloading a file

    Hi All,
    I am trying to download pdf from remote machine. My problem is that my remote machine is not server. I do not have any idea how to construct the URL of the pdf ? I am able to download from local machine but not remote machine. I do not want to use FTP and I can not use Http.
    Can I do it without using any protocol?
    Please guide me for the same.
    Thanks

    Thanks for your replies. I am explaining my problem once more, so that it will more clear.
    I am using java.io and java.net for downloading the files.
    My requirement is basic downloading of files..Like after clicking the button user should be able to browse and locate the dir where he want to store the file.
    If the file is somewhere say in C:// on my local machine and I want to download it and store it to other location say D:// then I can do that but if the file is on remote machine and that machine is not the server, I am not able to perform the action...
    File not found exception occurs.
    Do I need to share the folder so that it will be accessible in that case??

Maybe you are looking for

  • Hard Disk Self Test Failed

    Dear Sir, I have an Hp Pavilion DV6-2113AX notebook, and since yesterday i am not able to access my Hard Drive. Since i am working as an assistant manager, its really important for me to back up all the data. It is very crucial for me to atleast back

  • CS6 Beta Modifies CS4 & CS5 Bridge File Associations (W7 Pro 64Bit SP1)

    Symptoms: After installing CS6 including bridge CS6 onto a W7 pro 64Bit Machine with SP1. The File associations in the existing copies of CS4 and CS5 bridge are updated to make the CS6 Beta the default programme for opening the majority of file types

  • Trouble Opening Photoshop CC on MacBook

    Hi, I recently purchased a used MacBook Pro and just put my Photoshop CC on it today.  Now when I try to open it, I'm getting this error message: "To open "Adobe Photoshop CC," you need to install a Java runtime, but you are not connected to the Inte

  • My 24" iMac won't boot, what am I doing wrong?

    It starts and goes to a small window in multiple languages that says I must restart my computer. Tried to start in safe mode by holding down the shift key but wouldn't come up in safe mode. Second tried taking memory stick out and putting back in but

  • Silent Install for Adobe Presenter 10

    I am getting an error (A valid installer cold not be found) when trying to create a package using AAMEE. I have used this in the past to package Presenter. I have targeted the path to setup.exe and set-up.exe.