2018 Oct 10 9:30 AM
i want to download my internal table data as PDF document without using any smartform or adobe form.So i don't want to use without those print parameters can i able to download the data into a pdf document.
2018 Oct 10 9:45 AM
Hi Shaik,
You can refer below link for converting data into pdf.
https://wiki.scn.sap.com/wiki/display/ABAP/PDF+files+in+SAP.
Thanks
2018 Oct 10 9:55 AM
Thank you for your advice.
along with i am using below code:
*&---------------------------------------------------------------------*
*& Report ZPR_ITAB_2_PDF
*&---------------------------------------------------------------------*
*&
*&---------------------------------------------------------------------*
REPORT ZPR_ITAB_2_PDF.
TABLES: mara.
DATA: itab TYPE TABLE OF mara,
wa TYPE mara.
DATA:g_val TYPE c,
w_pripar TYPE pri_params,
w_arcpar TYPE arc_params,
i_pdf TYPE TABLE OF tline,
spoolid LIKE tsp01-rqident.
START-OF-SELECTION.
SELECT * FROM mara INTO TABLE itab
UP TO 100 ROWS.
CALL FUNCTION 'GET_PRINT_PARAMETERS'
EXPORTING
in_archive_parameters = w_arcpar
in_parameters = w_pripar
layout = 'X_65_132'
line_count = 65
line_size = 132
no_dialog = 'X'
IMPORTING
out_archive_parameters = w_arcpar
out_parameters = w_pripar
valid = g_val.
IF g_val NE space AND sy-subrc = 0.
w_pripar-prrel = space.
w_pripar-primm = space.
NEW-PAGE PRINT ON NEW-SECTION PARAMETERS w_pripar ARCHIVE PARAMETERS w_arcpar NO DIALOG.
ENDIF.
********
loop at itab into wa. "-->Loop your internal table write here + include the content you want to add in the PDF
WRITE: wa-matnr,
wa-ernam,
wa-ersda.
*write: wa.
endloop.
*********
NEW-PAGE PRINT OFF.
CALL FUNCTION 'ABAP4_COMMIT_WORK'.
spoolid = sy-spono.
CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
EXPORTING
src_spoolid = spoolid
no_dialog = ' '
TABLES
pdf = i_pdf.
CALL FUNCTION 'GUI_DOWNLOAD'
EXPORTING
filename = 'C:\dell\itab_to_pdf.pdf'
filetype = 'BIN'
TABLES
data_tab = i_pdf.
It is giving me error as :
Exception condition "ERR_NO_SPOOLJOB" triggered
Kindly suggest on this//
2018 Oct 10 10:21 AM
2018 Oct 11 6:43 AM
Thanks for suggestion ..
But it is creating spool id now and file also downloading in local system but file is not opening.
Error am getting : cannot open the file and file doesn't have no pages.