I tried this, But it is working for Uploading the File.
FILE UPLOAD IN WEB DYNPRO ABAP DOWNLOAD
The Download file can be viewed in a Pop-up window. Create a Web Ddynpro Application and test it,Ĭlick on Browse -> Choose a file for Upload -> Click on Upload.Īfter Uploading,file details can be seen in the Table and a Link to Download will be availablle.Ĭlick on the Link to download the Uploaded file. You can also try using this formula: TEXT (31421,'YYYY-mm-dd') and the date should display correctly. Note that an Excel stores data in number format and to display in date format, you have to show it format as a date. Lo_nd_n_file_download->bind_table( new_items = lt_n_file_download set_initial_elements = abap_true ).Īctivate all the Web Dynpro components. Uploading an excel file in Web Dynpro for ABAP. Insert zfile_upload1 from ls_file_upload. Ls_file_upload-FILE_CONTENTS = ls_n_upload-FILE_CONTENTS. Ls_file_upload-FILE_SIZE = ls_n_upload-FILE_SIZE.
Ls_file_upload-FILE_TYPE = ls_n_upload-FILE_TYPE. Ls_file_upload-FILE_NAME = ls_n_upload-FILE_NAME. Ls_n_upload-file_size = xstrlen( ls_n_upload-file_contents ). * ls_n_upload will contain the File name file type and file contents * Lo_nd_n_upload = wd_context->get_child_node( name = wd_this->wdctx_n_upload ). Lo_nd_n_file_download = wd_context->get_child_node( name = wd_this->wdctx_n_file_download ). Go to the methods tab and double-click on ONACTIONUPLOADA(action property for UPLOAD button) and place the below code:ĭATA lo_nd_n_upload TYPE REF TO if_wd_context_node.ĭATA lo_el_n_upload TYPE REF TO if_wd_context_element.ĭATA ls_n_upload TYPE wd_this->element_n_upload.ĭATA lo_nd_n_file_download TYPE REF TO if_wd_context_node.ĭATA lt_n_file_download TYPE wd_this->elements_n_file_download. The z-table fields and types are mentioned below. Now, Choose the UI element FILE_UPLOAD and create binding for the property data, Filename, mimetype.Īfter Binding the UI element FILE UPLOAD,Ĭreate a z-table to store all the attachments that has been uploaded, so that the files can be downloaded later. Now, in the Table columns choose the column File contents, and in the TEXT property BIND the attribute FILE_NAME OF NODE N_FILE_DOWNLOAD.Īfter Binding, the table look like the table in the below screen shot. Create a BUTTON UI element with text property as Upload and action property as UPLOAD.Īfrer creating Button, Create a group and inside group create a UI element TABLE.Īfter creating the table right-click on the table UI element and choose Create Binding.Ĭlick on Context and choose the Node N_FILE_DOWNLOAD.