Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

I need to print multiple document in smartforms in PDF

Hi experts,

I need to print multiple document in smartforms in PDF. User said that preview become in PDF form. Suppose document range are 230000001 to 230000005 then all preview are display in PDF same time and if wish to print then print also.

Please Help.

Former Member
replied

Hi Raghubansh,

you can use below code to print multiple documents in same spool request. With this method also preview will work.


To convert spool request to PDF you can check this links:

http://wiki.sdn.sap.com/wiki/display/Snippets/Convert+Spool+request+to+PDF+and+send+as+e-mail

http://scn.sap.com/thread/801116


Best Regards


Basar Ozgur


FORM print_label  TABLES   p_it_label TYPE typ_it_label.


  DATA: _it_label TYPE typ_it_label WITH HEADER LINE.

  DATA: _fm_name    TYPE rs38l_fnam,

             _count      TYPE i.

  DATA: _control TYPE ssfctrlop.

  CHECK p_it_label[] IS NOT INITIAL.


  CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'

    EXPORTING

      formname           = 'ZLABEL'

    IMPORTING

      fm_name            = _fm_name

    EXCEPTIONS

      no_form            = 1

      no_function_module = 2

      OTHERS             = 3.


*  _control-no_dialog = 'X'.

*  _control-preview   = 'X'.

  _control-no_open   = 'X'.

  _control-no_close  = 'X'.

  CALL FUNCTION 'SSF_OPEN'

    EXPORTING

*     ARCHIVE_PARAMETERS       =

*     USER_SETTINGS            = 'X'

*     MAIL_SENDER              =

*     MAIL_RECIPIENT           =

*     MAIL_APPL_OBJ            =

*     OUTPUT_OPTIONS           =

      control_parameters       = _control

*   IMPORTING

*     JOB_OUTPUT_OPTIONS       =

    EXCEPTIONS

      formatting_error         = 1

      internal_error           = 2

      send_error               = 3

      user_canceled            = 4

      OTHERS                   = 5.


  LOOP AT p_it_label INTO _it_label.

    APPEND _it_label.

    CALL FUNCTION _fm_name

      EXPORTING

        control_parameters = _control

      TABLES

        it_data            = _it_label

      EXCEPTIONS

        formatting_error   = 1

        internal_error     = 2

        send_error         = 3

        user_canceled      = 4

        OTHERS             = 5.

    REFRESH _it_label.

  ENDLOOP.

  CALL FUNCTION 'SSF_CLOSE'

    EXCEPTIONS

      formatting_error = 1

      internal_error   = 2

      send_error       = 3

      OTHERS           = 4.


ENDFORM.                    " PRINT_LABEL

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question