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.
Showing results for 
Search instead for 
Did you mean: 

CONVERT_OTFSPOOLJOB_2_PDF Only retrieves 1st of multiple copies.

0 Kudos

Anyone found a way around this?

If I define a smartform to print say 5 copies, OUTPUT_OPTIONS-TDCOPIES = 5, which are sent to spool the function CONVERT_OTFSPOOLJOB_2_PDF only retrieves the 1st copy and the following 4 are ignored. Same occurs if RSTXPDFT4 is used.

Any ideas ?


0 Kudos

Most likely this means that the print process commands the printer to repeat the sequence of pages five times instead of adding the sequence of pages to the spool five times.

This makes sense, it avoids sending redundant data to the printer.

If you need five copies of all pages of the smartform in the resulting PDF file, there is the option to open a print job and add documents to it several times before closing the job. All pages would then be in the spool and so all would be converted to a PDF document.

I've never done this. I suspect the fields "NO_OPEN" and "NO_CLOSE" in structure SSFCTRLOP in the smartform function module interface are the relevant controls to do this.

0 Kudos

Dear Mario,

Please refer to the following KBA to retrieve all of multiple copies.

2666490 - SmartForm with several copies generates only one PDF

Best regards,

0 Kudos

Hi guys,

Thanks for your responses and apologies for the delay.

The print job idea is not an option for me but thanks.

The issue with using FUNCTION 'CONVERT_OTF', and believe me I've tried, is that I want to read the print data from the spool as I have the spool ID. And that is the real crux of the matter because the function to retrieve the job from the spool only gets the 1st copy.

        src_spoolid              = i_spoolid......

if the function fetched all 5 copies then FUNCTION 'CONVERT_OTF' would probably let me pick the individual copy.

It surprises me that SAP have not provided an option in FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF' to choose which copy to retrieve. In my case the 5 copies are all slightly different.

As I say, the same behaviour is displayed when using RSTXPDFT4. It only gets the 1st copy for download but all 5 copies can clearly be viewed in the spool txn SP01. It's a deficiency in the SAP standard function in my opinion.

In the end I resolved my issue by calling the smartform again for each individual copy that I required. This works but it is not really very efficient when all 5 copies are already sat there on the spool.

Perhaps SAP are listening and might apply a fix ?