Skip to Content
avatar image
Former Member

SAP spool for smartform generating but printing immediately

Hi Guys,

I have program which generates SPOOL for printing but I do not want to print immediately. I tried setting control parameter and output paramets but nothing worked out. But when I unchecking Print output immediately in SU01 I am able to get desired SPOOL waiting to be printed. But I want this to happen without changes in SU01....Please Help

DATA :
fm_name TYPE rs38l_fnam,
it_vbak TYPE TABLE OF vbak.

*SELECT * FROM vbak into TABLE it_vbak
* WHERE vbeln GE '0100000004'
* AND vbeln LE '0100000010'.

DATA :
gs_control_parameters TYPE SSFCTRLOP,
gs_output_options TYPE SSFCOMPOP.


gs_output_options-TDIMMED = ' ' .

gs_control_parameters-no_dialog = 'X'.
gs_output_options-tdnewid = 'X'.

CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZCH_LABEL_ONE'

IMPORTING
FM_NAME = fm_name
EXCEPTIONS
NO_FORM = 1
NO_FUNCTION_MODULE = 2
OTHERS = 3.

CALL FUNCTION fm_name
EXPORTING
control_parameters = gs_control_parameters
output_options = gs_output_options
EXCEPTIONS
FORMATTING_ERROR = 1
INTERNAL_ERROR = 2
SEND_ERROR = 3
USER_CANCELED = 4
OTHERS = 5
.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    avatar image
    Former Member
    Sep 14, 2012 at 10:49 AM

    CALL FUNCTION fm_name
    EXPORTING
    control_parameters = gs_control_parameters
    output_options = gs_output_options
    EXCEPTIONS
    FORMATTING_ERROR = 1
    INTERNAL_ERROR = 2
    SEND_ERROR = 3
    USER_CANCELED = 4
    OTHERS = 5
    .

    While calling above FM, in exporting parameters, add user_settings = ' ' and try.

    Regards,

    SG

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 18, 2012 at 05:21 AM

    Hi All,

    I have been trying all your suggestions. Now a new problem has occured. SEND_ERROR = 3 is causing problem....

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 14, 2012 at 09:41 AM

    Hi,

    Rap this program with a dummy selection screen - that does nothing, then on the selection screen choose in menu program--->execute on back ground.

    Once you run this job in the background and under properties of the printing settings (the first dialog box that pops up after asking to run job in background) and double click the print immediately and chose print to sap spool for now.

    That should do the job,

    Best,

    Iftah

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 18, 2012 at 06:40 AM

    Hi All,

    Issue is resolved...

    Solution (1) setting user_setting = ' '.............

    Solution (2)Using BAPI_USER_CHANGE is also a good option......one can use it for other application also...

    Send_ERROR was due to spool overflow.....I deleted the old spool requests......i got the new spools

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Chetan,

      Yes, setting user_setting = ' ' will make the system to ignore the user default settings..as you are already making gs_output_options-TDIMMED = ' ' , it will not print immediately.

      I was just wondering all these days watching you thread for what you have been still waiting for 😊.

      Regards,

      SG.