Spool issue -Smartforms

Hi,
Everytime I run my Print program in Background.
Output pages are being appended to the existing spool number.
How do I deactivate this? I need a new Spool each time I run the program.
Here is my code.
CALL FUNCTION fm_name
        EXPORTING
         archive_index        = toa_dara
         archive_index_tab    = arc_ind_tab
         archive_parameters   = arc_params
         control_parameters   = ls_control_param
         mail_appl_obj        = ls_recipient
         mail_recipient       = ls_recipient
         mail_sender          = ls_sender
         output_options       = ls_composer_param
         user_settings        = SPACE
         TDNEWID              = space
         wa_itab              = wa_header
        IMPORTING
         document_output_info     = document_output_info
         job_output_info          = job_output_info
         job_output_options       = job_output_options
        TABLES
          wa_dep              = item_itab
        EXCEPTIONS
          formatting_error = 1
          internal_error   = 2
          send_error       = 3
          user_canceled    = 4.
Regards
Vara
Message was edited by: Vara K

There is a parameter called TDNEWID in the CONTROL_PARAMETERS / OUTPUT_OPTIONS (I am not sure which one), set that to X and it triggers a new spool every time.
Regards,
Ravi
NOte :Please mark the helpful answers

Similar Messages

  • Creating Spool from Smartform??

    Hi
    Can anybody tell how to get the spool from smartform?
    Thanks in Advance
    Davinder Singh

    Hi Davinder,
    After the execution of smartform function module the import parameter JOB_OUTPUT_INFO is populated with data. This is of type SSFCRESCL.
    The component SPOOLIDS of JOB_OUTPUT_INFO contains list of spool id generated for smartform..
    This spool id can be used to read spool request generated using any standard func module like RSPO_RETURN_ABAP_SPOOLJOB.
    Hope this helps you....
    Enjoy SAP.
    Pankaj Singh.

  • Smartform Spool issue - Not pulling all pages

    Hi,
    I am expecting aorund 2000 pages of spool file with a smartform driver program.
    My spooljob is limiting me to only 33 pages and job is still active  when i check using SM37.
    Anything related to spooling is wrong in my code?
    SORT T_ITEM BY FKDAT.
      CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
        EXPORTING
          FORMNAME           = P_FORM
        IMPORTING
          FM_NAME            = FM_NAME
        EXCEPTIONS
          NO_FORM            = 1
          NO_FUNCTION_MODULE = 2
          OTHERS             = 3.
      IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      LS_COMPOSER_PARAM-TDNEWID = 'X'.
      LS_CONTROL_PARAM-PREVIEW = ''.
      SORT T_HEADER BY NAME1 KUNNR.
      DATA: V_PREV_CUR LIKE BSID-WAERS.
      LOOP AT T_HEADER INTO WA_HEADER.
        REFRESH: ITEM_ITAB, ITEM_ITAB_TMP.
        CLEAR: V_PREV_CUR.
        LOOP AT T_ITEM WHERE KUNRG = WA_HEADER-KUNNR.
          MOVE-CORRESPONDING T_ITEM TO ITEM_ITAB.
          APPEND ITEM_ITAB.
        ENDLOOP.
        SORT ITEM_ITAB BY WAERS.
        LOOP AT ITEM_ITAB.
          IF SY-TABIX <> 1.
            IF V_PREV_CUR <> ITEM_ITAB-WAERS.
              SORT ITEM_ITAB_TMP BY FKDAT.
              CALL FUNCTION FM_NAME
                EXPORTING
                  ARCHIVE_INDEX        = TOA_DARA
                  ARCHIVE_INDEX_TAB    = ARC_IND_TAB
                  ARCHIVE_PARAMETERS   = ARC_PARAMS
                  CONTROL_PARAMETERS   = LS_CONTROL_PARAM
                  MAIL_APPL_OBJ        = LS_RECIPIENT
                  MAIL_RECIPIENT       = LS_RECIPIENT
                  MAIL_SENDER          = LS_SENDER
                  OUTPUT_OPTIONS       = LS_COMPOSER_PARAM
                  USER_SETTINGS        = SPACE
                  WA_ITAB              = WA_HEADER
                IMPORTING
                  DOCUMENT_OUTPUT_INFO = DOCUMENT_OUTPUT_INFO
                  JOB_OUTPUT_INFO      = JOB_OUTPUT_INFO
                  JOB_OUTPUT_OPTIONS   = JOB_OUTPUT_OPTIONS
                TABLES
                  WA_DEP               = ITEM_ITAB_TMP
                EXCEPTIONS
                  FORMATTING_ERROR     = 1
                  INTERNAL_ERROR       = 2
                  SEND_ERROR           = 3
                  USER_CANCELED        = 4.
              IF SY-SUBRC <> 0.
                WRITE: / 'ERROR in passing variables to the smartforms '.
              ENDIF.
              LS_COMPOSER_PARAM-TDNEWID = SPACE.
              LS_CONTROL_PARAM-NO_DIALOG = 'X'.
              LS_CONTROL_PARAM-PREVIEW = ''.
              REFRESH ITEM_ITAB_TMP.
              MOVE-CORRESPONDING ITEM_ITAB TO ITEM_ITAB_TMP.
              APPEND ITEM_ITAB_TMP.
            ELSE.
              MOVE-CORRESPONDING ITEM_ITAB TO ITEM_ITAB_TMP.
              APPEND ITEM_ITAB_TMP.
            ENDIF.
          ELSE.
            REFRESH ITEM_ITAB_TMP.
            MOVE-CORRESPONDING ITEM_ITAB TO ITEM_ITAB_TMP.
            APPEND ITEM_ITAB_TMP.
          ENDIF.
          AT LAST.
            CALL FUNCTION FM_NAME
              EXPORTING
                ARCHIVE_INDEX        = TOA_DARA
                ARCHIVE_INDEX_TAB    = ARC_IND_TAB
                ARCHIVE_PARAMETERS   = ARC_PARAMS
                CONTROL_PARAMETERS   = LS_CONTROL_PARAM
                MAIL_APPL_OBJ        = LS_RECIPIENT
                MAIL_RECIPIENT       = LS_RECIPIENT
                MAIL_SENDER          = LS_SENDER
                OUTPUT_OPTIONS       = LS_COMPOSER_PARAM
                USER_SETTINGS        = SPACE
                WA_ITAB              = WA_HEADER
              IMPORTING
                DOCUMENT_OUTPUT_INFO = DOCUMENT_OUTPUT_INFO
                JOB_OUTPUT_INFO      = JOB_OUTPUT_INFO
                JOB_OUTPUT_OPTIONS   = JOB_OUTPUT_OPTIONS
              TABLES
                WA_DEP               = ITEM_ITAB_TMP
              EXCEPTIONS
                FORMATTING_ERROR     = 1
                INTERNAL_ERROR       = 2
                SEND_ERROR           = 3
                USER_CANCELED        = 4.
            IF SY-SUBRC <> 0.
              WRITE: / 'ERROR in passing vars to the smartforms '.
            ENDIF.
            LS_COMPOSER_PARAM-TDNEWID = SPACE.
            LS_CONTROL_PARAM-NO_DIALOG = 'X'.
            LS_CONTROL_PARAM-PREVIEW = ''.
          ENDAT.
          V_PREV_CUR = ITEM_ITAB-WAERS.
        ENDLOOP.
      ENDLOOP.

    Hi Vara,
    By default there will be a value set by the administrator for the number of pages you can view in the spool. So to me it looks like this value is set to 33 in yoru case. You can go to setting from the same screen and change thsi setting to display all pages. But beware that this may take a long time some times and also give you a dump at times.
    -Guru

  • How to print multiple pages in single spool in smartforms

    Hi all,
      I have a issue on to print multiple pages in single spool,i can able to print multiple pages in multiple spool .I am doing Check Print smartforms in that i need to print Multiple pages in single spool.Currently i am using the below code please help to solve this issue.
    IF gv_tabix = 1.
    lwa_outp_option-tdnewid = 'X'.
    ELSE.
    lwa_outp_option-tdnewid = ' '.
    ENDIF.
    Thanks,
    Deesanth

    Hi
    TABLES: spfli.
    DATA:
      t_spfli type STANDARD TABLE OF spfli.
    DATA:
      fs_spfli TYPE spfli.
    DATA:
      w_form TYPE tdsfname,
      w_flag TYPE i,
      f_nam TYPE rs38l_fnam,
      w_input TYPE ssfcompin,
      w_control TYPE ssfctrlop.
    SELECTION-SCREEN BEGIN OF BLOCK blk WITH FRAME.
    SELECT-OPTIONS s_carrid FOR spfli-carrid.
    SELECTION-SCREEN END OF BLOCK blk .
    SELECTION-SCREEN BEGIN OF BLOCK block1 WITH FRAME.
    PARAMETERS:
      p_single RADIOBUTTON GROUP rad1,
      p_ind RADIOBUTTON GROUP rad1.
    SELECTION-SCREEN END OF BLOCK block1.
    START-OF-SELECTION.
    PERFORM display_data.
    PERFORM ssf_function_module_name.
    PERFORM spool_request.
    *& Form display_data
    * text
    * --> p1 text
    * <-- p2 text
    FORM display_data .
    SELECT * FROM spfli INTO TABLE t_spfli WHERE carrid IN s_carrid.
    ENDFORM. " display_data
    *& Form ssf_function_module_name
    * text
    * --> p1 text
    * <-- p2 text
    FORM ssf_function_module_name .
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING formname = ' '
    IMPORTING fm_name = f_nam
    EXCEPTIONS no_form = 1
    no_function_module = 2.
    * IF sy-subrc NE 0.
    * MESSAGE 'Form cannot be displayed' TYPE 'E' .
    * ENDIF. " IF sy-subrc eq 0
    ENDFORM. " ssf_function_module_name
    *& Form spool_request
    * text
    * --> p1 text
    * <-- p2 text
    FORM spool_request .
    w_input-dialog = 'X'.
    CALL FUNCTION 'SSFCOMP_OPEN'
    EXPORTING input = w_input
    EXCEPTIONS error = 1.
    *" LOOP AT t_spfli .....................................................
    LOOP AT t_spfli INTO fs_spfli.
    w_control-no_open = ' '.
    w_control-no_close = ' '.
    *"Single spool request..................................................
    IF p_single EQ 'X'.
    w_control-no_open = 'X'.
    w_control-no_close = 'X'.
    ELSE.
    *"Individual spool request.............................................
    IF w_flag NE '1'.
    w_control-no_open = 'X'.
    w_control-no_close = ' '.
    w_flag = 1.
    CALL FUNCTION ' '
    EXPORTING control_parameters = w_control
    fs_spfli = fs_spfli
    EXCEPTIONS formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4.
    endif. " IF w_flag ne '1'
    ENDIF. " IF p_single eq 'X'.
    CALL FUNCTION ' '
    EXPORTING
    control_parameters = w_control
    fs_spfli = fs_spfli
    EXCEPTIONS formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4.
    ENDLOOP. " LOOP at t_spfli into ...
    *&This function module close the spool request *
    CALL FUNCTION 'SSFCOMP_CLOSE'
    EXCEPTIONS error = 1.
    ENDFORM. " spool_request
    Regards,
    Sravanthi

  • SPOOL FOR SMARTFORMS

    Hi all,
      I m getting 2 spool requests for a smartform instead of 1. I hav developed my smartform in user exit of Standard program.In spool it is generating one for my smartform and another for std one.
    Please let me know what should i do so that only single spool comes.
    Regards
    Taranam

    The standard program issues a Smartform too?
    Try to force the non-generation for the spool order that you don't want.
    I supouse that you don't want the spool order generating by the std program. So, if this spool order comes after yours, try to force the parameters for the std funcion call...
    SSFCTRLOP-NO_OPEN = 'X'
    SSFCTRLOP-NO_CLOSE
    SSFCOMPOP-TDNEWID = ' '
    Hope this will help you.
    Regards,
    Andrés Sarcevic.

  • Spool Requst smartforms

    Hi all,
    I want to suppress the dialog box in smrtform i.e.printpreview.
    i want to create spool requst only and not smartform layout.
    so,can u help me in this.
    regareds.
    Priya.

    Hi Supriya.
    I would like to suggest a few references, as it is quite similar to your issue,
    [SDN - Reference to Supress page in print preview   |Need to supress page in print preview;
    [SDN - Reference for Creating Spool request in SMARTFORMS|Spool - restrict multiple sap script  layouts into a single spool;
    [SDN - Reference for Several smartform outputs are included in an output request|Several smartform outputs are included in an output request;
    [SDN - Reference for Single Spool Request for Script & SmartForms|Single Spool Request for Script & SmartForms;
    Hope that's usefull.
    Good Luck & Regards.
    Harsh Dave

  • Report - Spool Issue

    Hi Experts,
    I am working on a Report. When I run Report  at background,Once the Job gets over two spool lists are generated.
    Its like one pool is original and other is like Duplicate one, but the Output remains the same except the one wich has date inthe HEADER of the spool list and other without that date in the other spool list.
    Please help me on this issue.
    Regards,
    Vishwa

    Harish,
    Actually some restriction are made in the Basic level, so that I cant change the Batch system field at foreground and test in Dialog process.
    Regards,
    Vishwa

  • Printer spool issue with HP LaserJet 1018

    I seem to be having a recurring problem with the HP LaserJet 1018 that I am hoping someone has also had and can help me resolve.  When I go to print I get a message that I need to set up a printer (it does not recognize the printer is there).  When I click on set up a new printer, I receive a message that the local print spooler service is not running.  Nothing I do seems to solve the problem. 
    This happened to me with my previous 1018 printer.  The exact same thing.  I had a second 1018 available to me that I connected and it worked just fine for about two months and now is doing the same thing as the first.  
    I have an HP Pavilion Entertainment PC with Windows 7 (64 bit) operating system.  I previously had a Dell with Windows XP that the first printer worked on for a long time (maybe 2+ years).  I got this new computer within the past six months and both these printers stopped working while on this computer.
    Any help or ideas would be appreciated. 

    Welcome to the HP Forums  fastndfury,
    I see by your post that you are only getting the error on the Windows 8 computer, "The scanner is currently in use. Please wait until your previous task is completed and then try scanning again." I can help you with this issue.
    I have provided a document to go through the steps to see if it will help resolve this issue.
    'Another program has control of the scanner' Message Displays on the Computer When Scanning.
    If you need further assistance, let me know.
    Have a nice day!
    Thank You.
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" on the right to say “Thanks” for helping!
    Gemini02
    I work on behalf of HP

  • Goods receipt and goods issue smartform

    Hi :
       Is there any standard smartform for Goods receipt / Goods issue slip ?
    How to create a customizing form using smartforms when a material document is created and saved .
    Thx.
    Raghu

    Hi,
    Convert the SAP SCript to Smartform by using the migration option in Smartform
    select the appropriate script for your requirement
    for example 
    for GI
    WASCHEIN
    WA_LB_VERS1
    WA_LB_VERS2
    for GR
    WESCHEINVERS1
    WESCHEINVERS2
    migrate the same from  script to form
    then use these
    /SMB40/MMGI1_A              Goods Issue slip version 1
    /SMB40/MMGI1_L              Goods Issue slip version 1
    /SMB40/MMGI2_A              Goods Issue slip version 2
    /SMB40/MMGI2_L              Goods Issue slip version 2
    /SMB40/MMGI3_A              Goods Issue Slip version 3
    /SMB40/MMGI3_L              Goods Issue Slip version 3
    /SMB40/MMGR1_A               Goods receipt slip version 1
    /SMB40/MMGR1_L               Goods receipt slip version 1
    /SMB40/MMGR2_A               Goods receipt slip version 2
    /SMB40/MMGR2_L               Goods receipt slip version 2
    /SMB40/MMGR3_A               Goods receipt slip version 3
    /SMB40/MMGR3_L               Goods receipt slip version 3
    Hope this helps
    regards
    Shiva

  • Plz help production issue(smartform)

    hi experts plz help its a production issue
    i have a box in my smartform in which in one line i can only show 50 characters .and i have a text of 70 characters but i only have to show 50 characters from 70 characters .
    now wat i did i stored 70 characters variable into 50 char variable abd displaying it .
    but the issue is
    if i want to print .
    hi this is sdn and here u can get all the information about sap .
    now lets say
    i of information is the 46th character of my line
    now what is happening it is coming like
    hi this is sdn and here u can get all the
    infor
    its showing 50 character only but if word is not completed it is printing it in next line.
    it should print like
    hi this is sdn and here u can get all the infor
    plz help how to do it
    thanx in advance .

    code i am using is ::::::::::::::::::::::::::::::::::::::::::::::::
    data : TEXT_3I56(50) type c .
    move is_bil_invoice-hd_gen-bil_number TO textname.
    CALL FUNCTION 'READ_TEXT'
    EXPORTING
    CLIENT                         = SY-MANDT
    id                            = '0002'
    language                      = is_nast-spras
    name                          = textname
    object                        = 'VBBK'
      ARCHIVE_HANDLE                = 0
      LOCAL_CAT                     = ' '
    IMPORTING
      HEADER                        =
    tables
    lines                         = t_lines_3156
    EXCEPTIONS
    ID                            = 1
    LANGUAGE                      = 2
    NAME                          = 3
    NOT_FOUND                     = 4
    OBJECT                        = 5
    REFERENCE_CHECK               = 6
    WRONG_ACCESS_TO_ARCHIVE       = 7
    OTHERS                        = 8.
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *describe table t_lines lines n.
    *if not n is initial.
    *bank_note = 'X'.
    *endif.
    READ TABLE T_LINES_3156 INDEX 1 .
    IF SY-SUBRC = 0 .
    TEXT_3I56 = T_LINES_3156-TDLINE .
    ENDIF.

  • Delete Spool in Smartform

    Hi Gurus
    I am using RSPO_R_RDELETE_SPOOLREQ to delete the spool after converting the spool from pdf and to email.
    I am having a dump at
    CALL 'RSPOARNS' ID 'ID' FIELD spoolid
                      ID 'FORCE' FIELD 'X'
                      ID 'RC'  FIELD rc.
    code of the FM. It say POSTING_ILLEGAL_STATEMENT, I have authorizations to delete the spool but, I am not finding a solution to delete the spool.
    Do we have any other option to delete the spool?
    Thanks
    J@Y..

    Yes char10
    DATA: delete_id TYPE tsp01_sp0r-rqid_char.
              CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
                EXPORTING
                  spoolid = delete_id.
    I am getting the spool id from Smartform Interface job_output_info-spoolids[]
    CALL FUNCTION 'RSPO_RETURN_SPOOLJOB'  for OTF
      CALL FUNCTION 'SX_OBJECT_CONVERT_OTF_PDF'  OTF to PDF
    after sending the email
              CALL FUNCTION 'RSPO_R_RDELETE_SPOOLREQ'
    Edited by: J@Y on Oct 13, 2009 10:16 AM

  • Local printer management --Spooler Issues--

    Trouble: of the 3 production printers on a local machine 1 to many of the printers may have a Job get stuck in printing for some unknown issue. Clicking cancel job / Delete fails to remove the Job from the List. At this point i am forced to Kill the Print
    Spooler and restart it.
    Want to have From Wscript.Shell or VBS: for each printer with a Que Count >1 Find the First JobId with a bad status delete this and Copy the remainder of the PrintQue content to a Local "Temp" location use a CancelAllJobs() method, then Replace
    all the Content back into the printer Spooler for re-issue.
    Thoughts?
    Thanks

    I would investigate the root cause of why certain print jobs cause a problem.
    Bill

  • Paging in SPOOL Issue!

    Hi,
    I don't want to make any paging in the spool file but I am always getting a new page after ~65 lines, below my setting:
    set verify off
    set linesize 3000
    set pagesize 6000000
    set trimspool on
    spool /m/home/omc/aa.txt
    select * from KPI order by PST;
    spool off
    It's under HP-UNIX with Oracle 9i, is there any idea about this issue?
    Notice that I did the same under my machine (Windows + Oracle 10g) and everything goes fine (no paging was in the output spool file)!
    Thanks in advance

    OK, I am entering invalid "pagesize" number. But is there a way that I could disable paging in the output spool file; cause the output of the spool file might be more than 50000 row. I tried to set the "pagesize" to zero, OK it will disable the paging but it's also disable the column heading.
    Is there a workaround solution?
    Thanks...

  • Print Spooler Issue

    I recently became unable to print.  My printer is installed and drivers updated, but I get an error when I try to print that tells me my Print Spooler Service is not running, and I cannot start it.
    Windows 7 Home Edition 64bit
    HP Touchsmart 310PC
    Error Popup:
    +++++++++++++++++++++++
    Windows could not start the Print Spooler service on local computer.
    Error 1053: This service did not respond to the start or control request in a timely fashion.
    +++++++++++++++++++++++
    Running diagnostics/troubleshooting does not resolve this issue.
    When trying to print from some applications I get an error that says "No Default Printer Found.  Please choose a printer a try again".  I cannot choose another printer because of the spooler error.
    Any suggestions?

    rjscheper1,
    This should fix it, look here
    I am a volunteer. I am not an HP employee.
    To say THANK YOU, press the "thumbs up symbol" to render a KUDO. Please click Accept as Solution, if your problem is solved. You can render both Solution and KUDO.
    The Law of Effect states that positive reinforcement increases the probability of a behavior being repeated. (B.F.Skinner). You toss me KUDO and/or Solution, and I perform better.
    (2) HP DV7t i7 3160QM 2.3Ghz 8GB
    HP m9200t E8400,Win7 Pro 32 bit. 4GB RAM, ASUS 550Ti 2GB, Rosewill 630W. 1T HD SATA 3Gb/s
    Custom Asus P8P67, I7-2600k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX660 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Custom Asus P8Z77, I7-3770k, 16GB RAM, WIN7 Pro 64bit, EVGA GTX670 2GB, 750W OCZ, 1T HD SATA 6Gb/s
    Both Customs use Rosewill Blackhawk case.
    Printer -- HP OfficeJet Pro 8600 Plus

  • Regarding Spool issue while running in background

    Hi All ,
    i am getting some issue i am executing one report in background so the report output of the spool format is disturbed but while i am executing same report in foreground everything is printing perfectly.
    So please suggest me where i missed the scenarios.
    Thanks,
    Venkata Pradeep.

    Have you tried to set the format properties?
    Execute in Background->Properties Button->Format.
    Regards.

Maybe you are looking for