2008 Jun 18 3:22 PM
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.
2008 Jun 18 7:33 PM
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
2008 Jun 18 7:39 PM
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