11-29-2012 7:21 PM
Hi
I have a requirement where i need to convert the list output( Generated through WRITE ) to Spool.
The requirement is that whenever the user is trying to exit the list using BACK button the report output should be sent to the spool / printer.
Please let me know how this can be achieved.
Thanks
Abdul Hakim
11-30-2012 4:39 AM
You can write down the below code against the "BACK" button in this way -
DATA: print_parameters TYPE pri_params,
archi_parameters TYPE arc_params,
valid_flag(1) TYPE c.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
archive_mode = '3'
IMPORTING
out_parameters = print_parameters
out_archive_parameters = archi_parameters
valid = valid_flag
EXCEPTIONS
invalid_print_params = 2
OTHERS = 4.
IF valid_flag = 'X' AND sy-subrc = 0.
SUBMIT <submitable> TO SAP-SPOOL
SPOOL PARAMETERS print_parameters
ARCHIVE PARAMETERS archi_parameters
WITHOUT SPOOL DYNPRO.
ENDIF.
11-30-2012 4:45 AM
Hello Abdul,
You can use SUBMIT PROGRAM to send your output to spool as suggested above.
Regards,
Deepti
11-30-2012 7:29 AM
Take a look at FMs of function SLST.
spoiler (select to display): start with a SAVE_LIST with sy-lsind to get the abaplist, then GET_PRINT_PARAMETERS and WRITE_LIST
Regards,
Raymond
09-03-2013 7:24 PM
Generally incase of reports - if the report is run in background the output list can be seen in spool (It is tested in can of re-use alv but not sure for WRITE ALV)