09-04-2008 4:58 PM
Hi,
i am using FM Get_print_parameters for printing some data on the Printer, but in this time i want to print the header and page number on every new page.
i am creating a FM and passing some data to the FM, depending on that data i am doing some calculations & i am printing data.
here i cant use Events TOP OF PAGE END OF PAGE since inside FM i am using GET_PRINT_PARAMETERS.
how it can be achieved.
thanks in advance
Vinayaka
09-04-2008 5:04 PM
Hi, Check if this can help u
REPORT Z_TEST_PRINT.
DATA: L_PARAMS TYPE PRI_PARAMS,
L_VALID TYPE C.
START-OF-SELECTION.
"get the data etc here
END-OF-SELECTION.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
IMMEDIATELY = 'X'
LINE_SIZE = 220
RELEASE = 'X'
MODE = 'CURRENT'
NO_DIALOG = ' '
IMPORTING
OUT_PARAMETERS = L_PARAMS
VALID = L_VALID
EXCEPTIONS
ARCHIVE_INFO_NOT_FOUND = 1
INVALID_PRINT_PARAMS = 2
INVALID_ARCHIVE_PARAMS = 3
OTHERS = 4.
NEW-PAGE PRINT ON PARAMETERS L_PARAMS NO DIALOG.
PERFORM DISPLAY_REPORT.
NEW-PAGE PRINT OFF.
ENDCASE.
FORM DISPLAY_REPORT .
" here you call the alv display function
ENDFORM.
Thanks,
Kartavya