on 03-03-2014 8:12 AM
I have crystal report view enabled for ALV reports using CR add-on for BS Apps, it is working fine, and getting good looking print-outs. Now I am trying to print it without displaying it as we can do with normal ALV report. My code snippet for printing is given below. While executing it shows the report instead of printing it without any user interaction. I also experience a strange behavior If I execute without activating the report it shows the print dialog without showing the report and printing the ALV list not the crystal report, and If I execute the activated version it shows crystal report view and not printing automatically. Please help.
ECC 6 EHP 5
SAP BASIS: 70210
GUI: 730
Notes Applied: 1805676
REPORT zsha_test.
TYPES: BEGIN OF lty,
bukrs TYPE t001-bukrs,
butxt TYPE t001-butxt,
END OF lty.
DATA lt_data TYPE STANDARD TABLE OF lty.
SELECT bukrs butxt FROM t001 INTO TABLE lt_data.
DATA go_s TYPE REF TO cl_salv_table.
DATA go_p TYPE REF TO cl_salv_print.
DATA go_pc TYPE alv_s_pctl .
DATA gv_valid TYPE c.
DATA gs_pparams TYPE pri_params.
data ls_key TYPE salv_s_layout_key.
cl_salv_table=>factory(
IMPORTING
r_salv_table = go_s
CHANGING
t_table = lt_data
).
go_p = go_s->get_print( ).
go_pc = go_p->get_print_control( ).
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
no_dialog = 'X'
IMPORTING
valid = gv_valid
out_parameters = gs_pparams
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
go_pc-pri_params = gs_pparams.
go_p->set_print_control( go_pc ).
go_s->get_functions( )->set_all( abap_true ).
ls_key-report = sy-repid.
go_s->get_layout( )->set_key( ls_key ).
go_s->get_layout( )->set_save_restriction( cl_salv_layout=>restrict_none ).
go_s->get_layout( )->set_default( abap_true ).
go_s->get_functions( )->set_view_crystal( abap_true ).
go_p->set_print_only( if_salv_c_bool_sap=>true ).
go_s->display( ).
Regards,
Shajahan
I cannot read ABAP code
can you include a screen shot of the print issue?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I am able to generate crystal report view from a custom report program with ALV output. It can display the output on screen as shown in the attachment. My requirement is to print the same thing in printer without showing the report on screen. I tried to set some print specific properties for ALV, Still it showing in screen, not printing.
User | Count |
---|---|
89 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.