Skip to Content
author's profile photo Former Member
Former Member

Does CONVERT_ABAPSPOOLJOB_2_PDF work in the background

Hi all,

Am having a major problem with FM CONVERT_ABAPSPOOLJOB_2_PDF. I want the FM to run in the background converting a spool job to a pdf binary prior to sending via email as an attachment.

Problem is that the FM works fine in the foreground and correctly converts the spool to a PDF (7-8K approx). When it runs in the background the FM always creates a 1K file which converts to PDF OK. When this sent as an attachment Acrobat reader opens but states that the file contains no data.

Anyone encountered this problem, and if so do you have any solutions or workarounds.

Thanks

Bala Duvvuri

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on May 09, 2011 at 09:33 AM

    Hello Bala,

    Does CONVERT_ABAPSPOOLJOB_2_PDF work in the background?

    Of course, it does work 😊

    Can you provide a snapshot of the call to the FM in your program & also check if the spool no. passed to the FM is correct.

    BR,

    Suhas

    Add a comment
    10|10000 characters needed characters exceeded

    • Your code needs to check whether or not a background job was spawned from the process. Checking for a max spool ID is not a good approach. What you need to do is use the other parameters of the function. Get the job count and job name, then poll for the completion of the job that converts the data using BP_JOB_STATUS_GET in a loop. This can take some time if you're talking about a large spool. Get the spool number using BP_JOB_READ and op code 36, then use RSPO_RETURN_SPOOLJOB to return the RAW data, then convert the data to the appropriate width as normal.

      You should do this for both the OTF and ALI functions and wrap the entire process in a function or class method. You can also force the conversion in the foreground using other conversion fucntions but it's better to allow the background processes to be used.

  • author's profile photo Former Member
    Former Member
    Posted on May 09, 2011 at 09:38 AM

    Hi Bala,

    Please check the below link.. Might be useful.

    CONVERT_ABAPSPOOLJOB_2_PDF gives a diff result depending how it is run

    Regards,

    Nagaraj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 09, 2011 at 10:54 AM

    Hi,

    Check the sending file before E-mailing to respective receipient . If data contains in the file send that file using FM: so_new_document_ap11 otherwise fill the file with data accordingly means write all records in between loop and endloop

    Ram.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.