cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple Pages printing in Smartforms

Former Member
0 Kudos

Hello Abapers,

My requirement is , I have developed three different smartforms . In the first smartform , the main window appears from second page . In my second smartform , the main window appears from third page and in my third smartforms , the main window appears from the fourth page . I want to print the smartforms three copies . But looping and increasing the counter doesn't work in this case. please provide me a solution .

** answers will be rewarded **

Thanks & Warm Regards

Nagaraj S.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi ,

see the following example .

this is the sample code I am developing now to print multiple forms also I need to give number copies to be printed.

FORM call_smartform .

DATA: v_form_type(15) TYPE c.

DATA: wa_ssfctrl TYPE ssfctrlop.

DATA: v_lines TYPE i.

DATA:x_output_options TYPE ssfcompop.

x_output_options-tdimmed = space.

x_output_options-tdnewid = c_x.

x_output_options-tdreceiver = sy-uname.

x_output_options-tdcopies = p_copy. " No. of copies

x_output_options-tddest = p_prtr. " Printer name

DESCRIBE TABLE it_mdocm LINES v_lines.

LOOP AT it_mdocm INTO wa_mdocm.

*Below logic is to open and close the forms

IF sy-tabix EQ 1.

wa_ssfctrl-no_open = space.

wa_ssfctrl-no_close = c_x.

ELSEIF sy-tabix EQ v_lines.

wa_ssfctrl-no_open = c_x.

wa_ssfctrl-no_close = space.

ELSE.

wa_ssfctrl-no_open = c_x.

wa_ssfctrl-no_close = c_x.

ENDIF.

IF p_pv = c_x.

wa_ssfctrl-preview = c_x. " printpreview required

ENDIF.

wa_ssfctrl-device = 'PRINTER'. " Device

wa_ssfctrl-no_dialog = c_x. " Dialog

wa_ssfctrl-langu = sy-langu. " langauage

CLEAR: v_form_type.

CONCATENATE wa_mdocm-codgr '-' wa_mdocm-vlcod INTO v_form_type.

CASE v_form_type.

WHEN 'ICDC-LOOP'.

CALL FUNCTION '/1BCDWB/SF00000134'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = wa_ssfctrl

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

output_options = x_output_options

user_settings = space

mdocm = wa_mdocm-mdocm

point = wa_mdocm-point

  • 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.

WHEN 'IST-BTO'.

CALL FUNCTION '/1BCDWB/SF00000138'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

control_parameters = wa_ssfctrl

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

output_options = x_output_options

user_settings = space

mdocm = wa_mdocm-mdocm

point = wa_mdocm-point

  • 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.

ENDCASE.

ENDLOOP.

Reward if useful

Regards,

Nageswar

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Nagaraj,

Give ur email-id will send the logic for printing multiple forms..

Please Reward if Helpful.

Srujan.

Former Member
0 Kudos

nagaraj200481@gmail.com . Please send me the logic to this mail id ...

Former Member
0 Kudos

Have u tried setting number to copies to 3?

Former Member
0 Kudos

How to set number of copies to 3 pages please tell me ????