cancel
Showing results for 
Search instead for 
Did you mean: 

Convert abapspool list into OTF

Former Member
0 Kudos

Hi gurus!

I have an enhancement that we need to merge 6 reports into one spool, but 2 reports was made as report write and the rest are smartforms (OTF).

We need to convert the spool from report write (abapspool list) into OTF in order to merge all spools into one PDF output, is it possible?

Regards!!!!

Accepted Solutions (1)

Accepted Solutions (1)

Venkat_Sesha
Advisor
Advisor
0 Kudos

TYPES:

BEGIN OF ty_list,

data(1023) TYPE c,

END OF ty_list,

ty_list_t TYPE STANDARD TABLE OF ty_list.

DATA: it_list TYPE ty_list_t,

wa_list TYPE ty_list.

START-OF-SELECTION.

SUBMIT ztest_1 EXPORTING LIST TO MEMORY AND RETURN.

PERFORM f_get_list_data

CHANGING it_list.

SUBMIT ztest_2 EXPORTING LIST TO MEMORY AND RETURN.

PERFORM f_get_list_data

CHANGING it_list.

END-OF-SELECTION.

CHECK it_list IS NOT INITIAL.

NEW-PAGE PRINT ON.

LOOP AT it_list INTO wa_list.

WRITE / wa_list-data.

ENDLOOP.

NEW-PAGE PRINT OFF.

SUBMIT rstxpdft4 WITH spoolno EQ sy-spono.

&----


*& Form F_GET_LIST_DATA

&----


  • text

----


FORM f_get_list_data

CHANGING fp_it_list TYPE ty_list_t.

DATA: lit_list TYPE STANDARD TABLE OF abaplist,

lit_ascii TYPE ty_list_t.

CALL FUNCTION 'LIST_FROM_MEMORY'

TABLES

listobject = lit_list

EXCEPTIONS

not_found = 1

OTHERS = 2.

IF sy-subrc = 0.

CALL FUNCTION 'LIST_TO_ASCI'

TABLES

listasci = lit_ascii

listobject = lit_list

EXCEPTIONS

empty_list = 1

list_index_invalid = 2

OTHERS = 3.

IF sy-subrc = 0.

APPEND LINES OF lit_ascii TO fp_it_list.

CLEAR: lit_ascii, lit_list.

ENDIF.

ENDIF.

ENDFORM. " F_GET_LIST_DATA

The programs ZTEST_1, ZTEST_2 are simple programs producing list output. We merge the outputs of these programs & generate a single PDF.

Answers (2)

Answers (2)

Former Member
0 Kudos

Problem solved! Thanks VENKAT for your cooperation!

Venkat_Sesha
Advisor
Advisor
0 Kudos

Also Please check the FM CONVERT_ABAPSPOOLJOB_2_PDF and program RSTXPDF5 which is used to convert a spool output to PDF. May be you can try top enhance it in case you want to read multiple spool jobs to be merged to single PDF

Hope This Helps