Skip to Content
avatar image
Former Member

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.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

4 Answers

  • Best Answer
    Nov 02, 2012 at 06:34 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Oct 30, 2012 at 04:56 AM

    Hi,

    You can do this by clearing the parameter SSFCOMPOP-TDNEWID.

    Check the structure SSFCOMPOP, you will find something,

    Regards

    Sachin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 01, 2012 at 05:45 PM

    please give me the solution...

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 06, 2012 at 07:20 AM

    Thank you very much Sir.......

    Add comment
    10|10000 characters needed characters exceeded