Skip to Content

Smartforms creating a single spool but getting multiple archives

My print program is calling a Smartform multiple times and is using the CONTROL_PARAMETERS NO_OPEN and NO_CLOSE to successfully get a single spool entry. My problem is that I am getting an archive document every time I call the Smartform. I have also adjusted the TDNEWID from 'X' to space, but with no success.

Are there certain settings in ARCHIVE_INDEX and/or ARCHIVE_PARAMETERS which ensure that all pages of my Smartform are combined into a single archive document just like they get combined in the spool? Is there some other way to do this? Help!

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • Best Answer
    author's profile photo
    Former Member
    Posted on Sep 19, 2007 at 06:42 AM


    The output types that you are using to get the spool must have been configured to storage mode "print and archive" in transaction nace. So everytime you give a printout, it will sure create an archive.

    As for the archiving of the single spool, you will have to write a new program -

    Take the spool in an internal table in OTF format and convert it to PDF. Use the archive function modules to push the file to storage after OTF has been converted to PDF.

    The best option would be, write a separate program for combining the smartforms into spool, using archive parameters only in the last iteration.

    This shall solve the problem.

    <b>Reward if useful.</b>



    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 19, 2007 at 12:54 PM

    I suppose a separate program to create a PDF from my spool entry is an option, but it seems a bit drastic.

    The real question remains: If I only get one spool entry, why do I continue to get many archive entries? I have looked at the spool in RAW format, and all pages are combined into a single SAP document with simple page breaks "EP" in between. One would hope that a single spool would result in a single PDF.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 28, 2007 at 08:57 PM

    As it turned out, Pritha's suggestion was a good one. I finally got it to work. Here are more details.

    I allow the print program to call the Smartform many times for each page, and using the NO_OPEN and NO_CLOSE as needed so that all pages for each document are combined into the document. In my case, I get one huge output spool which contains all the documents.

    I save all the data passed to each Smartform call into an internal table.

    Once the printing phase is done, I perform another phase to create the archives as follows.

    Loop thru the internal table and re-adjust the NO_OPEN and NO_CLOSE to indicate which pages I want to be combined into each archive document. In my case, I want all the pages for each document combined into an archive (one archive per document). Loop yet again thru the internal table and call the Smartform for each entry in the table. Be sure the GETOTF flag is set to "X". This is very important. The form will not be printed this time, however the OTF data for the form will get returned to the print program in the SSFCRESC1-OTFDATA structure.

    Everytime I encounter a NO_CLOSE value of Space in my loop, I perform OTF_ARCHIVE in program SAPLSTXBC to create an archive document from the OTF data in the structure.

    In this way, I can create archives that contain whatever amount of documents that I want.

    Add comment
    10|10000 characters needed characters exceeded