‎2012 Dec 06 5:15 PM
Hi Everyone,
When I convert Spool to Pdf, I get some additional blank line between each line containing data.
But these blank lines are not present in the spool.
Could anyone tell me the reason for the same and how to resolve it as I don't need these blank lines in Pdf.
Thanks
‎2012 Dec 07 5:14 AM
Hi Kush,
Let us know, How are you converting spool to PDF? Using custom logic calling function modules or calling standard programs(like RSTXPDFT4) ?
Regards,
Sravan Guduru
‎2012 Dec 07 5:26 AM
Hi Sravan,
I am creating Spool using NEW-PAGE PRINT ON NO DIALOG PARAMETERS l_params and then passing the spool number in FM CONVERT_ABAPSPOOLJOB_2_PDF. To get print parameters am using FM GET_PRINT_PARAMETERS.
Regards,
Kush
‎2012 Dec 07 5:50 AM
Hi Sharma,
Can i know , how to get the spool id dynamically to get form in pdf using SUBMIT RSTXPDFT4 ?
‎2012 Dec 07 5:54 AM
In the above code, after getting spool no. & preparing file name, call program RSTXPDFT4 and see how the PDF is.
‎2012 Dec 07 6:01 AM
Hi Sravan,
Yes I can get the pdf. But I need to give the spool id manually. What can i do set spool id as dynamically. Can you see my codings in thread..
http://scn.sap.com/thread/3277195
Thanks..
‎2012 Dec 07 6:02 AM
Hi Sravan,
I used the spool number generated from SP01 and passed it externally to RSTXPDF4 in se38 but I am still getting the same result.
Regards,
Kush
‎2012 Dec 07 5:35 AM
‎2012 Dec 07 5:42 AM
Hi Vijay,
Please find the code below:
* Get Print parameters
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
immediately = ''
no_dialog = c_x
release = ''
IMPORTING
out_parameters = l_params
valid = l_valid.
NEW-PAGE PRINT ON NO DIALOG PARAMETERS l_params.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = sy-repid
is_layout = w_layout
it_fieldcat = t_fieldcat
it_events = t_events_list
is_print = w_print
TABLES
t_outtab = t_final_table
EXCEPTIONS
program_error = 1
OTHERS = 2.
NEW-PAGE PRINT OFF.
* Save Spool Number in local variable
g_spool_nr = sy-spono.
* Prepare File name
CONCATENATE c_file
c_dash
sy-datum
sy-uzeit
INTO l_filename.
* Pop up to save file
CALL METHOD cl_gui_frontend_services=>file_save_dialog
EXPORTING
default_extension = c_ext
default_file_name = l_filename
initial_directory = c_dir
CHANGING
filename = l_filename
path = l_path
fullpath = l_fullpath
user_action = l_result.
IF l_result EQ 0.
* Convert Spool to Pdf
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = g_spool_nr
no_dialog = space
IMPORTING
pdf_bytecount = l_bytecount
TABLES
pdf = lt_line
EXCEPTIONS
err_no_abap_spooljob = 1
err_no_spooljob = 2
err_no_permission = 3
err_conv_not_possible = 4
err_bad_destdevice = 5
user_cancelled = 6
err_spoolerror = 7
err_temseerror = 8
err_btcjob_open_failed = 9
err_btcjob_submit_failed = 10
err_btcjob_close_failed = 11
OTHERS = 12.
IF sy-subrc EQ 0.
* Download Pdf File
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = l_fullpath
filetype = c_bin
TABLES
data_tab = lt_line
EXCEPTIONS
file_write_error = 1
no_batch = 2
gui_refuse_filetransfer = 3
invalid_type = 4
no_authority = 5
unknown_error = 6
header_not_allowed = 7
separator_not_allowed = 8
filesize_not_allowed = 9
header_too_long = 10
dp_error_create = 11
dp_error_send = 12
dp_error_write = 13
unknown_dp_error = 14
access_denied = 15
dp_out_of_memory = 16
disk_full = 17
dp_timeout = 18
file_not_found = 19
dataprovider_exception = 20
control_flush_error = 21
OTHERS = 22.
IF sy-subrc EQ 0.
* MESSAGE s002.
ELSE.
* MESSAGE s003 DISPLAY LIKE c_e.
ENDIF.
ENDIF.
ELSE.
* MESSAGE s004.
ENDIF.
Regards,
Kush
‎2012 Dec 07 12:18 PM
check this link http://scn.sap.com/message/9328383 it is not exactly the same as your requirement but do talk about formatting and fonts in pdf... hope this helps..