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: 

Avoid two output displays in single report

Former Member
0 Kudos

Hi,

The requirement is that the report should have a check box called "Print Report" in the selection screen. If the box is not checked the report displays the output in ALV Grid format. If the checkbox is set, the output should be spooled to the printed and the output screen appears (ALV Grid).

How can i do the printing without the dialog box that appears using smart forms..??

Regards,

SenthilG.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

hi,

try doing this...

if c_print = 'X'.

NEW-PAGE PRINT ON IMMEDIATELY 'X' COVER TEXT TEXT-004

LAYOUT WK_SPOOL NO DIALOG.

(or FM GET_PRINT_PARAMETERS can be used)

---

---

NEW-PAGE PRINT OFF.

ENDIF.

regards,

priya.

Message was edited by:

Priya

4 REPLIES 4

former_member404244
Active Contributor
0 Kudos

Hi,

plz have a look at the below code...u can send the report o/p to the spool.

  • Declaration of local constants

CONSTANTS : lc_paart LIKE sy-paart VALUE 'X_65_132', " Paper Format

lc_locl TYPE sypdest VALUE 'LOCL'. " Destination

  • If print option is selected.

IF p_print IS NOT INITIAL.

MOVE c_x TO v_print.

ELSE.

CLEAR v_print.

ENDIF.

  • Setup the Print Parmaters

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

authority = space

immediately = v_print

new_list_id = c_x

no_dialog = c_x

user = sy-uname

IMPORTING

out_parameters = v_print_parms

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

IF sy-subrc NE 0.

CLEAR : v_print_parms.

ENDIF.

  • The printer destination has to be set up

IF v_print_parms-pdest = space.

v_print_parms-pdest = lc_locl.

ENDIF.

  • Explicitly set line width, and output format so that

  • the PDF conversion comes out OK

v_print_parms-linsz = c_linsz.

v_print_parms-paart = lc_paart.

Now use the command....

NEW-PAGE PRINT ON PARAMETERS v_print_parms NO DIALOG.

perform display_output.

NEW-PAGE PRINT OFF.

Regards,

Nagaraj

0 Kudos

Thanks Nagaraj and Priya.

There are some attributes that is passed to smart forms.. Is there any field attributes to be passed in order to switch of print previews and display of dialogs..?

If my program has "write <xxx>" statement in the code in the "perform display_output" that you mentioned, will I get that displayed as a separate screen or will the screen is skipped..??

I want the screen to be skipped...

0 Kudos

Hi,

You can pass these attributes to your smartform when you call the function.

data: control TYPE ssfctrlop.

control-no_dialog = 'X'

CALL FUNCTION fm_name

EXPORTING

control_parameters = control

....

Regards

Wayne

Former Member
0 Kudos

hi,

try doing this...

if c_print = 'X'.

NEW-PAGE PRINT ON IMMEDIATELY 'X' COVER TEXT TEXT-004

LAYOUT WK_SPOOL NO DIALOG.

(or FM GET_PRINT_PARAMETERS can be used)

---

---

NEW-PAGE PRINT OFF.

ENDIF.

regards,

priya.

Message was edited by:

Priya