07-10-2014 9:09 AM
Hi experts. I have a task with prd form. I need to display data in the pdf form. But I don't know the number of columns, it will be depend on the data. It can be 10 or 20, I don't know. Each page have to have header and footer with number of page. Do you know how to realize this task.
07-10-2014 9:13 AM
Hi,
do you need to print a form or do you need to have a result of a report in PDF ?
regards
Fred
07-10-2014 9:15 AM
07-10-2014 9:21 AM
Try searching with a search term ' Convert internal table to PDF in sap'. Kindly search in SCN before you raise a question.
Regards,
Siva
07-10-2014 9:24 AM
For me you have to separate two points
-> dynamic table
there is a lot of doc about dynamic table
PDF, you just have to print the result of your report, and convert the OTF into PDF using function CONVERT_OTF_2_PDF Like in program RSTXPDFT4
you could also, call a report and catch the result using :
* Perform the program and export the restult in memory.
SUBMIT (p_prog) VIA SELECTION-SCREEN AND RETURN EXPORTING LIST TO MEMORY.
This command will call the selection screen of the report, and get the result in memory, you will not see the result in the screen.
* Catch the memory of the report result.
CALL FUNCTION 'LIST_FROM_MEMORY'
TABLES
listobject = it_listobj
EXCEPTIONS
not_found = 1
OTHERS = 2.
07-10-2014 9:40 AM
it's not suit for me, because I have display in special form with header and footer on each page
07-10-2014 9:46 AM
So, use Smartforms, but I'm not sure you could do something dynamic in smartforms ..
07-10-2014 9:47 AM
You can use events TOP_OF_PAGE and END OF PAGE, which will get triggered when a spool is generated from list display or grid display.
Regards,
Siva
07-10-2014 10:22 AM
I've created web dynpro application with the table. Now I need it to output into pdf in a special form. I can attach this form if will require
07-10-2014 10:19 AM
Hi,
Develop a classical report with Header and Footer (Top of page, End of page) and then convert that into PDF form and download it.
Follow this link to know 'How to convert Report into PDF'. http://scn.sap.com/community/abap/blog/2012/03/28/convertdownload-abap-report-to-pdf
Regards,
Vijay
07-10-2014 11:25 AM
I've created web dynpro application with the table. Now I need it to output into pdf in a special form. I can attach this form if will require
07-10-2014 1:27 PM
hello fedor..
If You want to create a pdf file of your code..then its help you..
so, shift+p is your shortcut key to save your code into a pdf file
Regards
Niraj Sinha
07-10-2014 1:32 PM
I don't want to create a pdf file of my code. I want to output data from report in pdf file.
07-30-2014 5:57 PM
You can output your report into a spool then capture the spool and convert it to a pdf file which you can download. Please see code below.
*-- Setup the Print Parmaters
call function 'GET_PRINT_PARAMETERS'
exporting
authority = space
copies = '1'
cover_page = space
data_set = space
department = space
destination = space
expiration = '1'
immediately = space
in_archive_parameters = space
in_parameters = space
layout = space
mode = space
new_list_id = 'X'
no_dialog = 'X'
user = sy-uname
importing
out_parameters = mstr_print_parms
valid = mc_valid
exceptions
archive_info_not_found = 1
invalid_print_params = 2
invalid_archive_params = 3
others = 4.
submit (p_repid) to sap-spool without spool dynpro
spool parameters mstr_print_parms
via selection-screen
and return.
*-- Find out the spool number
perform get_spool_number using sy-repid
sy-uname
changing mi_rqident.
*-- Convert Spool to PDF
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = mi_rqident
no_dialog = space
dst_device = mstr_print_parms-pdest
importing
pdf_bytecount = mi_bytecount
tables
pdf = mtab_pdf
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.
*-- Download the file
call function 'DOWNLOAD'
exporting
bin_filesize = mi_bytecount
filename = mc_filename
filetype = 'BIN'
importing
act_filename = mc_filename
tables
data_tab = mtab_pdf.
07-31-2014 8:36 AM
07-31-2014 2:52 PM