‎2008 Jul 10 4:05 AM
Hi,
I get a requirement that requires to print an ALV grid of width around 700 columns.
Through the printer setting, I am able to print all the columns on an A3 paper (format = X_65_768).
However, the font is simply too small.
Instead of fit to page width, I would like to ask if I can print the ALV grid spanning across several pages ...
just like when we are printing an excel with too many columns ...
ALV Grid Width.
0 ... 255 | 256 ... 511 | 512 ... 767
page 1 page 2 page 3
please advise. thanks.
‎2008 Nov 13 12:51 PM
Hi
On one of my previous posts () you mentioned you had a problem with a grid going on to several pages. I have not done that as the output I required was vertical (ie. 1 page horizontally but many pages).
Whether you can design a Smartform to print your ALV grid across several pages I do not know, but might be worth considering. This is how I managed to get the A3 and A4 printout layouts and then used a custom print button to trigger the print dialog with the correct Smartform. In turn this then prinited either A4 or A3.
Here is the sample code for what I used in the USER-COMMAND form:
*:--- When printing
when '&PRINT'.
clear fm_name .
*:--- If A4 (default) is selected use this.
if p_a4 = 'X'.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'SMARTFORM_A4'
importing
fm_name = fm_name
exceptions
no_form = 1
no_function_module = 2
others = 3 .
endif.
*:--- If A3 is selected use this.
if p_a3 = 'X'.
call function 'SSF_FUNCTION_MODULE_NAME'
exporting
formname = 'SMARTFORM_A3'
importing
fm_name = fm_name
exceptions
no_form = 1
no_function_module = 2
others = 3 .
endif.
if sy-subrc <> 0.
message id sy-msgid type sy-msgty number sy-msgno
with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
endif.
*:--- Call the SmartForm with the relevant parameters
call function fm_name
exporting
param1 = param1
param2 = param2
tables
table1 = table1
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.
You will notice the A3 and A4 selection options depict which Smartform is chosen when you click the Print icon (not the one on the menu). Remember it is a custom print button.
Regards
Nick