Application Development 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: 

Convert List to Spool

abdul_hakim
Active Contributor
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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.

Former Member
0 Kudos

Hello Abdul,

You can use SUBMIT PROGRAM to send your output to spool as suggested above.

Regards,

Deepti

raymond_giuseppi
Active Contributor
0 Kudos

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

sakshi_sawhney
Participant
0 Kudos

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)