Skip to Content
0
Former Member
Feb 25, 2009 at 06:42 AM

after executing the code im getting a spool no

32 Views

hi to all experts,

im very new to printing in sap after generating the spool no where to give this spool no ..

my code

DATA : fm_name TYPE rs38l_fnam,
         control_parameters TYPE ssfctrlop,
         wa_job_output_info TYPE ssfcrescl,
         ssfcompin TYPE ssfcompin.

  ssfcompin-dialog = 'X'.

  CALL FUNCTION 'SSF_OPEN'
   EXPORTING
*     ARCHIVE_PARAMETERS       =
*     USER_SETTINGS            = 'X'
*     MAIL_SENDER              =
*     MAIL_RECIPIENT           =
*     MAIL_APPL_OBJ            =
*     OUTPUT_OPTIONS           =
      control_parameters       = control_parameters
*   IMPORTING
*     JOB_OUTPUT_OPTIONS       =
   EXCEPTIONS
     formatting_error         = 1
     internal_error           = 2
     send_error               = 3
     user_canceled            = 4
     OTHERS                   = 5
            .
  IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
            WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.

  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
      formname           = 'ZMM_IM_002'
      variant            = ' '
      direct_call        = ' '
    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.

  control_parameters-no_open = 'X'.
  control_parameters-no_close = 'X'.


  LOOP AT it_smart INTO wa_smart.

    CALL FUNCTION fm_name
      EXPORTING
       control_parameters         = control_parameters

*   USER_SETTINGS              = 'X'
        wa_display                 = wa_smart
* IMPORTING
*   DOCUMENT_OUTPUT_INFO       =
*   JOB_OUTPUT_INFO            =
*   JOB_OUTPUT_OPTIONS         =
     EXCEPTIONS
       formatting_error           = 1
       internal_error             = 2
       send_error                 = 3
       user_canceled              = 4
       OTHERS                     = 5
              .
    IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.



  ENDLOOP.

  CALL FUNCTION 'SSF_CLOSE'
    IMPORTING
      job_output_info  = wa_job_output_info
    EXCEPTIONS
      formatting_error = 1
      internal_error   = 2
      send_error       = 3
      OTHERS           = 4.
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.


ENDFORM.

" print_smartform2x4