Application Development Blog Posts
Learn and share on deeper, cross technology development topics such as integration and connectivity, automation, cloud extensibility, developing at scale, and security.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member187570
Participant
0 Kudos

Do you wonder how easy it is to create PDF files from a spool number. it is  just two steps process.

Step-1 : Take a spool number and pass to FM "CONVERT_ABAPSPOOLJOB_2_PDF"

DATA: lv_spool_id type TSP01-RQIDENT value '748100',
            lt_pdf_data type table of tline WITH HEADER LINE.     

CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
   EXPORTING
     SRC_SPOOLID                    = lv_spool_id
   TABLES
       PDF                                 = lt_pdf_data .



Step-2 : Down load PDF File

Data :lv_file_name type string value 'c:\kalu1.pdf'.

CALL FUNCTION 'GUI_DOWNLOAD'
   EXPORTING
     FILENAME                        = lv_file_name
    FILETYPE                        = 'BIN'                     "Most Important replace default value of ASC to BIN otherwise you may not able to open the file

   TABLES
     DATA_TAB                        =  lt_pdf_data[] .