‎2010 Jul 17 10:01 PM
Hi all,
We have made SAP Query (The majority and 'was written in ABAP code), a report using ALV grid (function 'REUSE_ALV_GRID_DISPLAY'). There is a 'Print' button on the grid. If the user presses this button the system will send a screen where the user can choose print parameters (name of printer, printing, direct or not, etc..) If the user presses 'Continue' a spool request is then created.
But the users do not want to see the screen parameters.
After pressing the button 'Print' on the grid, the spool request should be immediately created using the parameters seted in the ABAP program, the same program that creates ALV.
Any idea how to do this?
Thanks in advance
‎2010 Jul 20 6:37 AM
Hi,
You can set the line size to the value that your require. Maximum is 1023 characters.
Regards,
Aparna Alashe.
‎2010 Jul 18 3:46 AM
‎2010 Jul 19 7:26 AM
Hi,
Instead of using the standard 'Print' button on the ALV toolbar, create your own button on the ALV toolbar and when the user selects this button, write your code to display the ALV in spool.
This can be done by writing the FM for ALV within the NEW-PAGE PRINT ON (NO DIALOG) and NEW-PAGE PRINT OFF statements. This will also require use of FM GET_PRINT_PARAMETERS.
Regards,
Aparna Alashe.
‎2010 Jul 19 8:46 AM
‎2010 Jul 19 9:46 AM
Hi,
Please refer to the link to add button in the ALV tool bar:
[http://www.sapalv.net/2009/07/sap-alv-tutorial-4-%E2%80%93-add-button-to-toolbar/]
For creating spool on click of this pushbutton you can use the following:
* Set the Spool Parameters
DATA: lwa_params TYPE pri_params,
lv_valid TYPE c.
CLEAR: lwa_params, lv_valid.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
in_parameters = lwa_params
layout = 'X_65_132'
line_count = 65
line_size = 132
no_dialog = 'X'
IMPORTING
out_parameters = lwa_params
valid = lv_valid
EXCEPTIONS
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
OTHERS = 4.
IF sy-subrc EQ 0.
NEW-PAGE PRINT ON PARAMETERS lwa_params NO DIALOG.
* Write code for displaying the ALV here......
NEW-PAGE PRINT OFF.
ENDIF.Regards,
Aparna Alashe.
‎2010 Jul 19 10:27 AM
Thank you.
One more question;). In cases where the format 'X_65_132' does not exist, should be created? How? Perhaps with T. SPAD?
‎2010 Jul 20 6:37 AM
Hi,
You can set the line size to the value that your require. Maximum is 1023 characters.
Regards,
Aparna Alashe.
‎2010 Jul 20 7:23 AM
Hi,
Use FM GET_PRINT_PARAMETERS and pass 'X' for NO_DIALOG parameter.
BR,
Vishal.
‎2010 Jul 21 6:39 AM
‎2011 Sep 16 12:50 PM
hi serenaaa,
Can you please send me the code to supress the dialog box with printer parameter.
Regards
Pankaj Mittal