Alv Export To Local File

вторник 04 декабряadmin

Printing to PDF can actually be obtained by printing the document to local printer, and use PDF printer driver as output printer. However, by using certain FM, we could put custom button into our ALV toolbar, which provide function to download to PDF. If you want to learn how to put custom button into ALV toolbar and you use REUSE_ALV_GRID_DISPLAY_LVC, you could read.

This code could be put anywhere appropriate in the program. In this case, I put this code in ‘USER_COMMAND’ subroutine, which is called everytime user execute function code of ALV. If user click on the ‘download to PDF’ button, a popup window will appear to let user decide where to put the file in local directory.

I have a problem with SAP WEBGUI when I try to export my ALV in Excel file. Movie So I used the button Local File. When I choose. And I press confirm button, nothing happens. After this operation, any other button doesn't work. SAP CL_GUI_ALV_GRID class method, attribute details, ALV List Viewer. MC_FC_PC_FILE - Export Local File MC_FC_PRINT - Print MC_FC_PRINT_BACK.

Form user_command using r_ucomm like sy-ucomm '#EC CALLED rs_selfield type slis_selfield. Data: lv_filename type string, lv_path type string, lv_fullpath type string, lv_user_action type i, lv_spool type tsp01-rqident, lv_pdf_bytecount type i, li_pdf type tlinetab, lwa_params type pri_params, lwa_report type zfs_ap_benefit_inkind_report, li_slopt type standard table of rsparams. If r_ucomm eq '%PDF'. *-- for change the file name and extension file to PDF call method cl_gui_frontend_services=>file_save_dialog exporting default_file_name = '*.pdf' file_filter = '*.pdf' changing filename = lv_filename path = lv_path fullpath = lv_fullpath user_action = lv_user_action EXCEPTIONS cntl_error = 1 error_no_gui = 2 not_supported_by_gui = 3 others = 4.

If sy-subrc 0. Message id sy-msgid type sy-msgty number sy-msgno with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4. *-- If button cancel not clicked then download pdf.

If lv_user_action '9'. *---- Get parameters from select option call function 'RS_REFRESH_FROM_SELECTOPTIONS' exporting curr_report = sy-repid tables selection_table = li_slopt.

*---- Get print parameters call function 'GET_PRINT_PARAMETERS' exporting destination = 'LOCL' immediately = ' ' line_count = '65' line_size = '255' no_dialog = 'X' cover_page = ' importing out_parameters = lwa_params. *---- Submit the transcation to spool submit with selection-table li_slopt to sap-spool spool parameters lwa_params without spool dynpro and return. *---- Get created spool number from tsp01 select max( rqident ) into lv_spool from tsp01 where rqclient = sy-mandt and rqowner = sy-uname. Call function 'CONVERT_ABAPSPOOLJOB_2_PDF' exporting src_spoolid = lv_spool no_dialog = ' ' importing pdf_bytecount = lv_pdf_bytecount tables pdf = li_pdf. Muruga muruga om muruga full mp3 song download.

*---- Download to local call function 'GUI_DOWNLOAD' exporting bin_filesize = lv_pdf_bytecount filename = lv_fullpath filetype = 'BIN' tables data_tab = li_pdf. FM REUSE_ALV_GRID_DISPLAY_LVC automatically provide ALV toolbars for us. However, sometimes we need to add functionality to add new toolbar button. In example below, we want to add ‘download to pdf’ button for our alv. Here’s the steps. Copy GUI status from other program Go to transaction SE41.

Copy status ‘STANDARD_FULLSCREEN’ from program ‘SAPLSLVC_FULLSCREEN’, provide the program name and new GUI STATUS name for the program. There will be a confirmation dialog to define new short text for GUI STATUS object. It’s ok not to define new short text, so just proceed to next step. Add new button to newly created GUI STATUS a. Go to SE38 –> Edit –> Display Object List. In left toolbar you’ll see ‘GUI Status’ folder. Contract the folder and click on the new GUI STATUS.

Place the cursor where you want to put the new toolbar, then click ‘Insert Entry’ button. Enter new OK Code (function code) for your status. Once you press enter, a dialog box will appear. Choose static text as we are not to create a runtime defined icon. Provide information of the Function Text.