How to download the report output  into PDF format

Hi friedns
from the report output when user clicks download button
it has to download to PDF format
how to do this
thanks in advance
venu

hi venu,
check this sample code
Save Report Output to a PDF File
This report takes another report as input, and captures the output of that report. The output is then converted to
PDF and saved to a local file. This shows how to use some of the PDF function modules, as well as an easy way to
create PDF files.
Source Code Listing
report zabap_2_pdf.
*-- Enhancements: only allow to be run with variant. Then called
*-- program will be transparent to users
*-- TABLES
tables:
tsp01.
*-- STRUCTURES
data:
mstr_print_parms like pri_params,
mc_valid(1) type c,
mi_bytecount type i,
mi_length type i,
mi_rqident like tsp01-rqident.
*-- INTERNAL TABLES
data:
mtab_pdf like tline occurs 0 with header line,
mc_filename like rlgrap-filename.
*-- SELECTION SCREEN
parameters:
p_repid like sy-repid, " Report to execute
p_linsz like sy-linsz default 132, " Line size
p_paart like sy-paart default 'X_65_132'. " Paper Format
start-of-selection.
concatenate 'c:\'
p_repid
'.pdf'
into mc_filename.
*-- 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.
*-- Make sure that a printer destination has been set up
*-- If this is not done the PDF function module ABENDS
if mstr_print_parms-pdest = space.
mstr_print_parms-pdest = 'LOCL'.
endif.
*-- Explicitly set line width, and output format so that
*-- the PDF conversion comes out OK
mstr_print_parms-linsz = p_linsz.
mstr_print_parms-paart = p_paart.
submit (p_repid) to sap-spool without spool dynpro
spool parameters mstr_print_parms
via selection-screen
and return.
*-- Find out what the spool number is that was just created
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.
call function 'DOWNLOAD'
exporting
bin_filesize = mi_bytecount
filename = mc_filename
filetype = 'BIN'
importing
act_filename = mc_filename
tables
data_tab = mtab_pdf.
FORM get_spool_number *
Get the most recent spool created by user/report *
--> F_REPID *
--> F_UNAME *
--> F_RQIDENT *
form get_spool_number using f_repid
f_uname
changing f_rqident.
data:
lc_rq2name like tsp01-rq2name.
concatenate f_repid+0(8)
f_uname+0(3)
into lc_rq2name separated by '_'.
select * from tsp01 where rq2name = lc_rq2name
order by rqcretime descending.
f_rqident = tsp01-rqident.
exit.
endselect.
if sy-subrc ne 0.
clear f_rqident.
endif.
endform." get_spool_number
Regards,
Naveen

Similar Messages

  • How to download the script data into pdf file

    how to download the script data into pdf file
    i have one option to download the script data to pdf file --->rstxpdft4 program.
    i have one doubt how to use this proogram.or any function module to download the script data to pdf file.
    Thanks and regards,
    Sri.

    Hi      Sri Sai,
    I know one method to convert the sapscript to pdf file :
    first generate a Spool Request for the required Sapscript
    then goto transaction SP01 and copy the generated Spool Request number
    now execute the SAP report RSTXPDFT4
    here enter the copied Spool request number and the target directory into the parameters
    execute the report
    required pdf file will be generated into the target directory
    i hope it will help you out
    Please refer this simple program:
    http://www.sapdevelopment.co.uk/reporting/rep_spooltopdf.htm
    Reward points if found helpful....
    Cheers,
    Eshwar.

  • How to download the Dynamic data into PPT format

    Hi Friends,
    I have one doubt on WDJ. How to download the Dynamic data into PPT format. For Example Some Dynamic data is available in to View in that One Download Link or button available. Click on Download link or button download that data into PPT Format
    Is it possible for WDJ. If possible please tell me.
    Or
    How to create Business Graphics in Web Dynpro Applications depening up on Excel Data and finally we can download the  Business Graphics  into powerpoint presentation.
    Thank you,
    Regards
    Vijay Kalluri
    Edited by: KalluriVijay on Mar 11, 2011 6:34 AM

    Hi Govindu,
    1. I have one doubt on WDJ. Click on either Submit Buttion or LinkToURL UI we can download the file that file having ppt formate(Text.PPT).
    I am using NWDS Version: 7.0.09 and Java Version: JDK 1.6
    2. is it possible to download the business Graphics in to the PPT by using Java DynPro
    Regards
    VijayK

  • How to download the report data in xml format

    Hi All,
    how to download the report data (sql/interactive) in xml format...
    Thanks,
    Vinoth

    You will want to do something like this:
    http://spendolini.blogspot.com/2006/04/custom-export-to-csv.html
    except customize it for xml.
    hth,
    John

  • SAP WEBGUI - How to download the report output to Excel ?

    Hi Folks ,
    We have generated a report in standard SAP GUI 7.1 . But our requirement is to view the report in SAP WEBGUI and download as EXCEL .
    We can view the report output in SAP WEBGUI , but could find an option to download as excel  !
    Is there any option in webgui ?
    Please provide you valuable inputs !
    Thanks.,
    V.Rangarajan

    Hi V.Ranjarajan,
    Have you created an ALV report?
    If yes, there are many ways to download the output to excel:
    Go to Menu -> Export - > Local File... , local file button, etc.
    In SAP CRM 7.0 there is a std functionality to even download search result list to excel.
    Hope this helps!
    Regards,
    Saumya

  • How to send the report output to the application server in a excel file

    Hello,
    how to send the report output to the application server in a excel file.
    and the report runs in background.
    Thanks in advance.
    Sundeep

    Dear Sundeep.
    I'm providing you with the following piece of code ... Its working fine for me ... hopefully it suits your requirement ...
    D A T A D E C L A R A T I O N *
    TYPES: BEGIN OF TY_EXCEL,
    CELL_01(80) TYPE C,
    CELL_02(80) TYPE C,
    CELL_03(80) TYPE C,
    CELL_04(80) TYPE C,
    CELL_05(80) TYPE C,
    CELL_06(80) TYPE C,
    CELL_07(80) TYPE C,
    CELL_08(80) TYPE C,
    CELL_09(80) TYPE C,
    CELL_10(80) TYPE C,
    END OF TY_EXCEL.
    DATA: IT_EXCEL TYPE STANDARD TABLE OF TY_EXCEL,
    WA_EXCEL TYPE TY_EXCEL..
    E V E N T : S T A R T - O F - S E L E C T I O N *
    START-OF-SELECTION.
    Here you populate the Internal Table.
    Display - Top of the Page.
    PERFORM DISPLAY_TOP_OF_PAGE.
    E V E N T : E N D - O F - S E L E C T I O N *
    END-OF-SELECTION.
    SET PF-STATUS 'GUI_STATUS'.
    E V E N T : A T U S E R - C O M M AN D *
    AT USER-COMMAND.
    CASE SY-UCOMM.
    WHEN 'EXPORT'.
    Exporting the report data to Excel.
    PERFORM EXPORT_TO_EXCEL.
    ENDCASE.
    *& Form DISPLAY_TOP_OF_PAGE
    text
    --> p1 text
    <-- p2 text
    FORM DISPLAY_TOP_OF_PAGE .
    SKIP.
    WRITE: /05(128) SY-ULINE,
    /05 SY-VLINE,
    06(127) 'O R I C A'
    CENTERED COLOR 1,
    132 SY-VLINE.
    WRITE: /05(128) SY-ULINE,
    /05 SY-VLINE,
    06(127) 'Shift Asset Depreciation - Period/Year-wise Report.'
    CENTERED COLOR 4 INTENSIFIED OFF,
    132 SY-VLINE.
    WRITE: /05(128) SY-ULINE.
    E X C E L O P E R A T I O N
    CLEAR: IT_EXCEL[],
    WA_EXCEL.
    PERFORM APPEND_BLANK_LINE USING 1.
    WA_EXCEL-cell_02 = ' XYZ Ltd. '.
    APPEND WA_EXCEL TO IT_EXCEL.
    CLEAR: WA_EXCEL.
    WA_EXCEL-cell_02 = 'Shift Asset Depreciation - Period/Year-wise Report.'.
    APPEND WA_EXCEL TO IT_EXCEL.
    PERFORM APPEND_BLANK_LINE USING 1.
    ENDFORM. " DISPLAY_TOP_OF_PAGE
    *& Form APPEND_BLANK_LINE
    text
    -->P_1 text
    FORM APPEND_BLANK_LINE USING P_LINE TYPE I.
    DO P_LINE TIMES.
    CLEAR: WA_EXCEL.
    APPEND WA_EXCEL TO IT_EXCEL.
    enddo.
    ENDFORM.
    *& Form EXPORT_TO_EXCEL
    text
    --> p1 text
    <-- p2 text
    FORM EXPORT_TO_EXCEL .
    DATA: L_FILE_NAME(60) TYPE C.
    Create a file name
    CONCATENATE 'C:\' 'Shift_Depn_' SY-DATUM6(2) '.' SY-DATUM4(2)
    '.' SY-DATUM+0(4) INTO L_FILE_NAME.
    Pass the internal table (it_excel which is already populated )
    to the function module for excel download.
    CALL FUNCTION 'WS_EXCEL'
    exporting
    filename = L_FILE_NAME
    tables
    data = IT_EXCEL
    exceptions
    unknown_error = 1
    others = 2.
    if sy-subrc <> 0.
    message e001(ymm) with 'Error in exporting to Excel.'.
    endif.
    ENDFORM. " EXPORT_TO_EXCEL
    *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    When you click the button - Export to Excel ( GUI-Status) you'll be able to export the content of the Internal Table to an Excel file .......
    Regards,
    Abir
    Don't forget to award Points *

  • How to put the alv output into the spool request?

    Hi guys,
    How to put the alv output into the spool request?
    Thanks!

    Hi
    Sending an ALV List screen output to SPOOL
    Convert ALV list to PDF and send mails to respective persons
    Regards
    Pavan

  • PAYABLES NOT GETTING THE REPORT OUTPUT IN PDF AFTER APPLYING RUP5 R12

    Hi All,
    RDBMS:10.2.0.3.0
    Oracle Apps :12.0.4
    OS:AIX 5.3
    Problem Description:
    We are presently facing an issue in Payables not getting the report output in PDF esp for the reports "Invoice Register", Invoice Hold Report and also other reports. We were able to generate the reports till our last test performed on last Thursday. This instance was cloned over the last weekend and probably the new upgrade to RUP5 R12,would have impacted it.
    Concurrent Programs submitted are completed normal but on clicking "view output" results in Blank PDF output.
    The error message what was shown is as below:
    "Adobe Reader could not open 'AcrC.tmp' because it is either not a supported file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)".
    Where could we locate ther above 'AcrC.tmp' of Adobe Reader..
    could anyone please share such an experience encountered for resolution..
    Would appreciate an early response..
    Thanks for your time!
    Regards,

    I suggest you speak to your DBA/sysadmin. This is not likely to be a reports problem.
    Check that you can see the output from apps through the viewer (the report may not hav output anything)
    Check whether you can print anything on that printer from apps.
    May also be worth checking to see if you can print to another printer from this report.

  • How to retrieve complete report output in HTML format

    Hi,
    I'm looking for how to retrieve complete report output in HTML format.
    I have tried the following and it only give me first page of the report output where in the actual report output should be 5 pages. Is there something I'm missing.
    CallbackOption[] boCallOpt = new CallbackOption[1];
    ImageManagement boImgMan = new ImageManagement();
    boImgMan.setCallbackScript("getImage.jsp");
    boImgMan.setImageManagementHolder("imageName");
    boImgMan.setDocumentReferenceHolder("docRef");
    boCallOpt[0] = boImgMan;
    RetrieveData oRetrieveData = new RetrieveData();
    RetrieveView oRetrieveView = new RetrieveView();
    oRetrieveView.setCallbackOption(boCallOpt);
    oRetrieveData.setRetrieveView(oRetrieveView);
    Action[] oActions;
    oActions = new Action[1];
    oActions[0] = fillPrompts;
    oReportEngine.getDocumentInformation(boDocInfo.getDocumentReference(), null, oActions, null,oRetrieveData);
    Testing this on BOE XI 3.0
    Thanks,

    For Web Intelligence, HTML is an interactive viewing format and not an export format such as PDF.
    Note that the HTML will be embedded with postback URLs to the application for images and drill downs.
    Closest you'd get is to be able to specify HTML output of an entire REPORT rather than REPORT_PAGE in the ViewSupport.setViewMode method.  But this brings back just one report in the document, and will have postback URLs mentioned above.
    Sincerely,
    Ted Ueda

  • Sandard Smart Form output into PDF format.

    Hi to all,
    Any one please guide me, how  to convert  sandard Smart Form output into PDF format.
    Regards,
    Thanesh

    hi thanesh,
    the below code may help you.
    data: FM_NAME TYPE RS38L_FNAM.
    DATA:       W_BIN_FILESIZE TYPE I,
          T_OTF TYPE ITCOO OCCURS 0 WITH HEADER LINE,
          T_PDF_TAB TYPE TLINE OCCURS 0 WITH HEADER LINE,
          W_FILESIZE TYPE I,
          WA_CTRLOP TYPE SSFCTRLOP,
          WA_OUTOPT TYPE SSFCOMPOP,
          T_OTFDATA TYPE SSFCRESCL.
    call function 'SSF_FUNCTION_MODULE_NAME'
      exporting
        formname                 = <ur form name>
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
    IMPORTING
       FM_NAME                  = FM_NAME
    EXCEPTIONS
       NO_FORM                  = 1
       NO_FUNCTION_MODULE       = 2
       OTHERS                   = 3
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    WA_CTRLOP-GETOTF = 'X'.
    WA_CTRLOP-NO_DIALOG = 'X'.
    WA_OUTOPT-TDNOPREV = 'X'.
    call function <function module generated for ur form>
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
       CONTROL_PARAMETERS         = WA_CTRLOP
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
       OUTPUT_OPTIONS             = WA_OUTOPT
       USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
       JOB_OUTPUT_INFO            = T_OTFDATA
      JOB_OUTPUT_OPTIONS         =
    EXCEPTIONS
       FORMATTING_ERROR           = 1
       INTERNAL_ERROR             = 2
       SEND_ERROR                 = 3
       USER_CANCELED              = 4
       OTHERS                     = 5
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    T_OTF[] = T_OTFDATA-OTFDATA[].
    call function 'CONVERT_OTF'
    EXPORTING
       FORMAT                      = 'PDF'
       MAX_LINEWIDTH               = 132
      ARCHIVE_INDEX               = ' '
      COPYNUMBER                  = 0
    IMPORTING
       BIN_FILESIZE                = W_BIN_FILESIZE
      BIN_FILE                    =
      tables
       OTF                         = T_OTF
        LINES                       = T_PDF_TAB
    EXCEPTIONS
       ERR_MAX_LINEWIDTH           = 1
       ERR_FORMAT                  = 2
       ERR_CONV_NOT_POSSIBLE       = 3
       ERR_BAD_OTF                 = 4
       OTHERS                      = 5
    if sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    endif.
    call function 'WS_DOWNLOAD'
    EXPORTING
       BIN_FILESIZE                  = W_BIN_FILESIZE
      CODEPAGE                      = ' '
       FILENAME                      = 'D:\TEST11.PDF'
       FILETYPE                      = 'BIN'
      MODE                          = ' '
      WK1_N_FORMAT                  = ' '
      WK1_N_SIZE                    = ' '
      WK1_T_FORMAT                  = ' '
      WK1_T_SIZE                    = ' '
      COL_SELECT                    = ' '
      COL_SELECTMASK                = ' '
      NO_AUTH_CHECK                 = ' '
    IMPORTING
       FILELENGTH                    = W_FILESIZE
      tables
        data_tab                      = T_PDF_TAB
      FIELDNAMES                    =
    EXCEPTIONS
       FILE_OPEN_ERROR               = 1
       FILE_WRITE_ERROR              = 2
       INVALID_FILESIZE              = 3
       INVALID_TYPE                  = 4
       NO_BATCH                      = 5
       UNKNOWN_ERROR                 = 6
       INVALID_TABLE_WIDTH           = 7
       GUI_REFUSE_FILETRANSFER       = 8
       CUSTOMER_ERROR                = 9
       NO_AUTHORITY                  = 10
       OTHERS                        = 11
    if sy-subrc = 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    WRITE: / 'SUCCESSFULLY CONVERTED'.
    endif.

  • Converting the WAD applications into PDF format

    Hi SAPians,
    I'm in need to convert WAD results into PDF Format using SAP BW 3.5 and Acrobat Reader 7.0. And I've referred some documents in Net, But,they gave ideas only for 3.5 and Acorobat 5 version.
    But i've to convert the WAD results into PDF format only by using Acrobat Reader 7.0. So, kindly let me know the steps to do so.
    Thanks in Advance.
    Jayaprakash J

    Hi Shahid syed,
    Thanks for your reply.
    It was very useful.
    But, i've askd the solution for sap bw 3.5 with Acrobat reader 7.0.
    So, plz let me knw if any solutions for that to make wad reports into pdf format.
    Points will be awarded.
    Thanks & Regards
    Jayaprakash J

  • Oracle HTMLDB report output in PDF format using FOP

    Hi,
    We are currently using Oracle HTMLDB1.6.I am trying to implement the HTMLDB report output in PDF format.I got at document but it is not clear.Could you please let use know wheether anybody has already used in their organization.
    Appreciate your response.
    Regards
    Murai

    Hey Murai,
    did you read the technote:
    http://www.oracle.com/technology/pub/notes/technote_htmldb_fop.html
    There is anything explained!
    greets,
    tim

  • Report output  in PDF format instead of TEXT

    Hello every1,
    I am using oracle application E-bS version 11.5.10.2 and i want ORACLE reports output in PDF format instead of standard 'text' default format(the place where v register concurrent programs). so can any one tell me what changes should i do to achieve my goal i had change format as pdf in concurrent program and run report but it shows error as follows:
    REP-3000: Internal error starting Oracle Toolkit.
    REP-3000: Internal error starting Oracle Toolkit.
    Plz. share your knowledge regarding.
    Radhi
    Edited by: user713 on Jun 20, 2011 9:32 AM

    Hi,
    check this support note.
    Reference
    Master Note : Comprehensive REP-3000 Troubleshooting and Overview Guide (Doc ID 200474.1)
    Regards, roberto

  • Printing report output in PDF format

    Hi,
    I want to know what are the settings needed to print a report output in PDF format, while executing the report from Oracle applications (Ver 11.5.6).
    Report is executed as a concurrent request from Oracle applications.
    Normally when we run the report from Oracle applications, output will be opened in a internet browser(IE) in HTML format. But I want the output to be opened in PDF format instead of HTML.
    OS: Sun Solaris 2.8.
    Thanks & Regards,
    Sarish

    Hi Sarish
    Please contact Oracle Support for an answer or to customise your application so that it prints a report output in PDF Format.
    To get PDF output you must run report/job with DESFORMAT=PDF in the command line instead of DESFORMAT=HTML/HTMLCSS.
    Regards
    Sripathy

  • Converting sap script output into pdf format?

    Hi all,
    I have modified the standard purchase order script form MEDRUCK . Now i need to generate the output into pdf format.
    This is not only limited to  spool requests , But also  when the user creates the purchase  order and clicks on print or print preview the output should be in pdf format.
    Please help on where and what code has to be written for this requirement?
    Thanks, 
    Aravind.

    Hi
    I don't know which is your release, but I don't think it's possible to create a preview in pdf format, but u can create a pdf file instead of the spool and then open it automatically, this is an example:
    - A) Open form
    IF P_PDF = 'X'.
              XDEVICE        = 'PRINTER'.
    * Get OTF
              ITCPO-TDGETOTF = 'X'.
          ENDIF.
          CALL FUNCTION 'OPEN_FORM'
               EXPORTING
                    DEVICE                      = XDEVICE
                    DIALOG                      = 'X'
                    FORM                        = 'ZFI_CL_EC_MOVI'
                    OPTIONS                     = ITCPO
                    MAIL_SENDER                 = LVS_SENDER
                    MAIL_RECIPIENT              = LVS_RECIPIENT
               EXCEPTIONS
                    CANCELED                    = 1
                    DEVICE                      = 2
                    FORM                        = 3
                    OPTIONS                     = 4
                    UNCLOSED                    = 5
                    MAIL_OPTIONS                = 6
                    ARCHIVE_ERROR               = 7
                    INVALID_FAX_NUMBER          = 8
                    MORE_PARAMS_NEEDED_IN_BATCH = 9
                    SPOOL_ERROR                 = 10
                    OTHERS                      = 11.
          IF SY-SUBRC <> 0.
            EXIT.
          ENDIF.
    B) Close FORM
    CALL FUNCTION 'CLOSE_FORM'
             TABLES
                  OTFDATA                  = T_OTF
             EXCEPTIONS
                  UNOPENED                 = 1
                  BAD_PAGEFORMAT_FOR_PRINT = 2
                  SEND_ERROR               = 3
                  SPOOL_ERROR              = 4
                  OTHERS                   = 5.
        IF SY-SUBRC <> 0.
          MESSAGE I208(00) WITH 'Errore chiusura stampa'(A02).
        ELSE.
          PERFORM DOWNLOAD_PDF.
        ENDIF.
    C) Create PDF and open it:
    FORM DOWNLOAD_PDF.
      DATA: BIN_FILESIZE TYPE I.
      DATA: T_FILE_PDF     TYPE STANDARD TABLE OF TLINE,
            DOCTAB_ARCHIVE TYPE STANDARD TABLE OF  DOCS.
      DATA: FILE_TABLE     TYPE FILETABLE WITH HEADER LINE.
      DATA: RC          TYPE I,
            USER_ACTION TYPE I.
      DATA: TITLE    TYPE STRING,
            FILENAME TYPE STRING.
      CHECK P_PDF = 'X'.
      CALL FUNCTION 'CONVERT_OTF_2_PDF'
           IMPORTING
                BIN_FILESIZE           = BIN_FILESIZE
           TABLES
                OTF                    = T_OTF
                DOCTAB_ARCHIVE         = DOCTAB_ARCHIVE
                LINES                  = T_FILE_PDF
           EXCEPTIONS
                ERR_CONV_NOT_POSSIBLE  = 1
                ERR_OTF_MC_NOENDMARKER = 2
                OTHERS                 = 3.
      IF SY-SUBRC <> 0.
        MESSAGE I208(00) WITH 'Errore conversione PDF'(A03).
        EXIT.
      ENDIF.
      TITLE = 'Creare File'(T02).
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>FILE_OPEN_DIALOG
         EXPORTING
           WINDOW_TITLE            = TITLE
           DEFAULT_EXTENSION       = '*.pdf'
        CHANGING
          FILE_TABLE              = FILE_TABLE[]
          RC                      = RC
          USER_ACTION             = USER_ACTION
        EXCEPTIONS
          FILE_OPEN_DIALOG_FAILED = 1
          CNTL_ERROR              = 2
          ERROR_NO_GUI            = 3
          OTHERS                  = 4
      IF SY-SUBRC <> 0.
        MESSAGE I208(00) WITH 'Errore creazione PDF'(A04).
        EXIT.
      ELSE.
        IF USER_ACTION = 9. EXIT. ENDIF.
        IF RC = 1.
          READ TABLE FILE_TABLE INDEX 1.
        ENDIF.
      ENDIF.
      MOVE FILE_TABLE-FILENAME TO FILENAME.
      CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD
        EXPORTING
           BIN_FILESIZE            = BIN_FILESIZE
           FILENAME                = FILENAME
           FILETYPE                = 'BIN'
        CHANGING
          DATA_TAB                = T_FILE_PDF
        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 <> 0.
        MESSAGE I208(00) WITH 'Errore creazione PDF'(A04).
        EXIT.
      ELSE.
        MESSAGE S208(00) WITH 'File creato con successo'(S01).
      ENDIF.
      CHECK P_OPEN = 'X'.
      CALL FUNCTION 'CALL_BROWSER'
           EXPORTING
                URL                    = FILE_TABLE-FILENAME
           EXCEPTIONS
                FRONTEND_NOT_SUPPORTED = 1
                FRONTEND_ERROR         = 2
                PROG_NOT_FOUND         = 3
                NO_BATCH               = 4
                UNSPECIFIED_ERROR      = 5
                OTHERS                 = 6.
      IF SY-SUBRC <> 0.
        MESSAGE S208(00) WITH 'Impossibile aprire file'(A05).
      ENDIF.
    ENDFORM.                    " DOWNLOAD_PDF
    Max

Maybe you are looking for