2005 Dec 13 11:50 AM
Hi, some answers would be greatly appreciated.
In an ABAP program there is this internal table full of data, and I have to write its contents into a PDF. The only way it seems is to make a spool and then use CONVERT_ABAPSPOOLJOB_2_PDF function to convert that spool into PDF.
The question is how do I make a spool within the ABAP program?
Thanks!
2005 Dec 13 11:59 AM
Hi Welcome to SDN.
Check out the following code sample to create spool withing program.
data: loc_dest like pri_params-pdest .
clear : wf_listname , loc_dest , wf_listtext .
move: 'List name' to wf_listname .
move: 'List header text' to wf_listtext .
select single spld into usr01-spld from usr01 where bname eq sy-uname .
if sy-subrc eq 0 .
move: usr01-spld to loc_dest .
endif .
call function 'GET_PRINT_PARAMETERS'
exporting
destination = loc_dest
copies = wf_copies
list_name = wf_listname
list_text = wf_listtext
immediately = ' '
release = ' '
new_list_id = 'X'
expiration = wf_days
line_size = 200
line_count = 65
layout = 'X_65_200'
sap_cover_page = 'X'
receiver = 'SAP*'
department = ''
no_dialog = 'X'
importing
out_parameters = wf_params
valid = wf_valid.
if wf_valid <> space.
new-page print on parameters wf_params no dialog.
perform write_summary .
new-page print off.
endif .
within the write_summary do a normal write operation.
loop at <itab> .
write:/
endloop .
Hope this is clear.
REgards
Raja
Hi, some answers would be greatly appreciated.
In an ABAP program there is this internal table full of data, and I have to write its contents into a PDF. The only way it seems is to make a spool and then use CONVERT_ABAPSPOOLJOB_2_PDF function to convert that spool into PDF.
The question is how do I make a spool within the ABAP program?
Thanks!
2005 Dec 13 11:59 AM
Hi Welcome to SDN.
Check out the following code sample to create spool withing program.
data: loc_dest like pri_params-pdest .
clear : wf_listname , loc_dest , wf_listtext .
move: 'List name' to wf_listname .
move: 'List header text' to wf_listtext .
select single spld into usr01-spld from usr01 where bname eq sy-uname .
if sy-subrc eq 0 .
move: usr01-spld to loc_dest .
endif .
call function 'GET_PRINT_PARAMETERS'
exporting
destination = loc_dest
copies = wf_copies
list_name = wf_listname
list_text = wf_listtext
immediately = ' '
release = ' '
new_list_id = 'X'
expiration = wf_days
line_size = 200
line_count = 65
layout = 'X_65_200'
sap_cover_page = 'X'
receiver = 'SAP*'
department = ''
no_dialog = 'X'
importing
out_parameters = wf_params
valid = wf_valid.
if wf_valid <> space.
new-page print on parameters wf_params no dialog.
perform write_summary .
new-page print off.
endif .
within the write_summary do a normal write operation.
loop at <itab> .
write:/
endloop .
Hope this is clear.
REgards
Raja
2005 Dec 13 12:56 PM
Thanks, that solves part of the problem.
One last question though: how to get the spool id of that particular spool? The only thing I can think of is to get all the spool requests and get the latest request?
Thanks again.
2005 Dec 13 1:00 PM
just use sy-spono it will hold the spool created by you in this session.
Regards
Raja
if you find the answers helpful, click on the radio buttons to reward the answers and if the question is answered mark it as answered.
more about this at
/people/mark.finnern/blog/2004/08/10/spread-the-love
2005 Dec 13 1:02 PM
hi Jen,
You can retriev the spool id by doing a SELECT on TSP01 table.
Regards,
Suresh Datti
2007 Dec 18 11:22 AM
Hi,
Can u Plz send one complete program for 'to generate spool request for an Interal table data and then pass that spool req. to RSTXPDFT4 pgm.
Thank U
Narendra
2005 Dec 19 7:38 PM
Hi, when I try to do simple write as per the instructions, i get an ABAP dump with Internal error: Invalid page number.
Illegal Page Number.
no idea why this is happening. anyclu.
thanks
Lakhbir
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |