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

after executing the code im getting a spool no

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

GauthamV
Active Contributor
0 Kudos

Tcode : SP01.

2 REPLIES 2

GauthamV
Active Contributor
0 Kudos

Tcode : SP01.

Former Member
0 Kudos

Hi gautham,

thanks for u r reply just another query if we write perform statement in some other program and want to pass parameters everything is same the data just the data differs