cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to get direct print without preview of the Smart Form?

Former Member
0 Kudos

Hi,

I developed a custom report where line items are coming with a check-box in front of each item. User can select single/multiple line-items by checking those check-boxes. The report also has a PRINT button in application tool bar by clicking which a Smart Form will be printing for each item. Thats mean, for 10 selected line items, 10 forms will be printed.

But, after clicking the PRINT button, print preview of the form is coming and from there I can go for a print/printer. I do not need the print preview and want to have the direct print option while clicking the PRINT button. How can I have this functionality?

Thanks in Advance

Roy

Accepted Solutions (1)

Accepted Solutions (1)

Sandra_Rossi
Active Contributor
0 Kudos

Roy, when you call the smart form function module (or SSF_OPEN), SAP displays the printer dialog with print and print preview buttons by default. If you click Print, SAP prints automatically the smart form (into a spool). So, if you get a preview, it means that you again call the smart form function module or SSF_OPEN with components PREVIEW='X' and NO_DIALOG='X' of CONTROL_PARAMETERS parameter. Could you paste the essential parts of your program around these function modules and parameters.

Former Member
0 Kudos

Hi,

Initially I get the Form Name by calling FM: SSF_FUNCTION_MODULE_NAME and I store it in l_fm_name. now calling the FM: l_fm_name like below:

LOOP AT i_item INTO wa_item.

CALL FUNCTION l_fm_name

EXPORTING

wa_item = wa_item

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.

As I have multiple form need to print, I am calling the smartform in loop.

Sandra_Rossi
Active Contributor
0 Kudos

So, the print dialog is displayed at each loop, right?

Former Member
0 Kudos

Yes, Exactly.

Sandra_Rossi
Active Contributor
0 Kudos

In fact, we are far from the question now

You have the answers here: http://www.sdn.sap.com/irj/scn/advancedsearch?query=printsmartformdirectly#sdn_content_category_value_forums

Former Member
0 Kudos

Hello Sandra,

The provided link is a really helpful. But my purpose is not solve at all.

Now I can avoid the PRINT PREVIEW option but as I am calling the smart form in loop, so for 2 items I am getting 2 times print option. Hence continue printing is not coming. I have to operate PRINT DIALOG 2 times. But I want a single operation with PRINT DIALOG regardless of my loop size (line items). PLs suggest.

Thanks

Roy

Sandra_Rossi
Active Contributor
0 Kudos

This has been answered in many threads, why don't you search. As Rob Burbank said yesterday, "then search harder" 😄

After the first call, you may retrieve the print parameters entered by user in the printer dialog, from parameter JOB_OUTPUT_OPTIONS of the function module. So you just have to move them to parameter OUTPUT_OPTIONS and set CONTROL_PARAMETERS-NO_DIALOG = 'X' in the next calls.

Former Member
0 Kudos

Solved.

Thanks.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Keshav,

How to generate spool for the Smart Form programetically?

kesavadas_thekkillath
Active Contributor
0 Kudos

Hi,

generate a spool for the smartform, then use that spool no in fm RSPO_OUTPUT_SPOOL_REQUEST

Manohar2u
Active Contributor
0 Kudos

Set this flag to not show preview options "control_parameters-no_dialog = 'X"