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: 

CL_SALV_PRINT to send to spool

jlsim
Explorer
0 Kudos

Hi all,

I am trying to send the content of a cl_salv_table to the spool. But the print dialog kept appearing, event though i set it as no dialog. Am i missing anything?

Here is my code...

lo_print = gt_table->GET_PRINT( ).

*/ get print parameters

CALL FUNCTION 'GET_PRINT_PARAMETERS'

EXPORTING

no_dialog = 'X'

IMPORTING

valid = gw_valid

out_parameters = gw_pparams

EXCEPTIONS

archive_info_not_found = 1

invalid_print_params = 2

invalid_archive_params = 3

OTHERS = 4.

CONCATENATE 'test' sy-datum sy-uzeit INTO gw_pparams-prtxt SEPARATED BY space.

lw_print_ctrl = lo_print->get_print_control( ).

lw_print_ctrl-PRI_PARAMS = gw_pparams.

lo_print->set_print_control( lw_print_ctrl ).

*

lo_print->set_print_only( if_salv_c_bool_sap=>true ).

  • display the table

gt_table->display( ).

1 REPLY 1

Former Member
0 Kudos

Hi,

I have the same issue. It doesn't work correctly no matter what I do.

According to demo program BCALV_TEST_NPPON_1, the value of set_print_only could be the following:

'space = Online, no %_print, &prnt-Fcode'.

'N=Immed. print, incl. %_print, w/o print dialog'.

'X=Immed. print, no %_print, with print dialog'.

'P=prog.,Online, incl. %_print, &prnt-Fcode'.

It is a little confusing, just a quick translation from German, which may not be totally correct. Using the value "N" you can get rid of the dialog screen. But even doing so, it is not creating a spool request for me.

According to SAP Press book ABAP Objects, the set_print_control method will work only at a later release with a certain patch level, which could be an explanation. However we have the very latest release and it still doesn't work.