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: 

Smartform printing

Former Member
0 Kudos

Hi gurus!

I want to print many sales orders one after other but in one call to smartform.

That means one smartform should print many sales orders.

How to do that? Is there any piece of code need to write in driver program?

Can i get that code?

Thanks in advance.

5 REPLIES 5

Former Member
0 Kudos

hi

In your driver program

when u r calling the function module for smartform

call it in a loop.

the itab on which you loop should have all the sales order's data.

Hope it works.

Br

Mohii

amit_khare
Active Contributor
0 Kudos

Hi,

Try passing your data as a table to smartform and there call a loop on that table for diaplaying.

It will call the form one after anohther for differentt sales order.

Regards,

Amit

Former Member
0 Kudos

Yes! but it will again and again ask for printing dialog box to select printer.

that should be suppressd/

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

Use this piece of code.It will suppress dialog.

REPORT zzz_jaytest1 NO STANDARD PAGE HEADING MESSAGE-ID zhrt.

  • Variable Declaration

DATA : v_form_name TYPE rs38l_fnam,

itab TYPE STANDARD TABLE OF pa0001,

w_ctrlop TYPE ssfctrlop,

w_compop TYPE ssfcompop,

w_return TYPE ssfcrescl.

SELECT * FROM pa0001 INTO TABLE itab UP TO 5 ROWS.

SORT itab BY pernr.

DELETE ADJACENT DUPLICATES FROM itab COMPARING pernr.

DATA: control TYPE ssfctrlop,

control_parameters TYPE ssfctrlop,

output_options type SSFCOMPOP.

control-preview = 'X'.

control-no_open = 'X'.

control-no_close = 'X'.

control-no_dialog = 'X'.

control-device = 'PRINTER'.

output_options-tddest = 'LOCL'.

OUTPUT_OPTIONS-TDNOPRINT = 'X'.

OUTPUT_OPTIONS-BCS_LANGU = SY-LANGU.

CALL FUNCTION 'SSF_OPEN'

EXPORTING

USER_SETTINGS = ' '

OUTPUT_OPTIONS = output_options

CONTROL_PARAMETERS = control

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.

output_options-tddest = 'LOCL'.

OUTPUT_OPTIONS-TDNOPRINT = 'X'.

OUTPUT_OPTIONS-BCS_LANGU = SY-LANGU.

CALL FUNCTION '/1BCDWB/SF00000066'

EXPORTING

  • ARCHIVE_INDEX =

  • ARCHIVE_INDEX_TAB =

  • ARCHIVE_PARAMETERS =

CONTROL_PARAMETERS = control

  • MAIL_APPL_OBJ =

  • MAIL_RECIPIENT =

  • MAIL_SENDER =

OUTPUT_OPTIONS = output_options

USER_SETTINGS = ' '

  • IMPORTING

    • DOCUMENT_OUTPUT_INFO =

  • JOB_OUTPUT_INFO = w_return

    • JOB_OUTPUT_OPTIONS =

TABLES

itab = itab

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

0 Kudos

hello jayanthi,

as you said i can see the print preview for a range of documents without the dialog

box being pop up again n again,

but i am not able to take the print of the preview now

and also no spool request is generated

i am giving NEW SPOOL REQUEST option in the OUTPUT OPTIONS, but

still it is not coming in the spool SP01

also when i am tryin to directly print from the preview,

it is showing the error

Error in spool C call: spool overflow

the scenario is for a range of document printing i am looping the SMARTFORM function and for the printer request not to pop up many times i am using ur code.

everything is fine till the preview, but printing is the problem.

please help

i want a spool request to be generated