Application Development and Automation 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: 
Read only

ALV on SPOOL

Former Member
0 Likes
511

Hi gurus.

I've a FM that shows an ALV; but I need to print this ALV on SPOOL.

Using 'is_print' parameters on REUSE_ALV_LIST_DISPLAY function; I can do this; but a window with print params appears. I need to write the list on SPOOL directly, without any windows params.

Could yo send me some help?

Thanks in advance.

Hi gurus.

I've a FM that shows an ALV; but I need to print this ALV on SPOOL.

Using 'is_print' parameters on REUSE_ALV_LIST_DISPLAY function; I can do this; but a window with print params appears. I need to write the list on SPOOL directly, without any windows params.

Could yo send me some help?

Thanks in advance.

2 REPLIES 2
Read only

Former Member
0 Likes
482

Hi,

In the FM 'SET_PRINT_PARAMETERS' ...pass the flag for NO_DIALOG and set the print parameters desired in the program itself

regards,

sampath

Read only

Former Member
0 Likes
482

Hi,

u have to use the FM 'GET_PRINT_PARAMETERS' like this...

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.

THen u need to write 

NEW-PAGE PRINT ON PARAMETERS V_PRINT_PARMS NO DIALOG.
perform display_output.
NEW-PAGE PRINT OFF.

Thanks

Vikranth