on 12-24-2013 7:56 AM
Hello All,
I have a requirement to upload the file (of all types) in webynpro abap. I am aware that i can use File Upload UI element that can be used to upload files but client want to have button to upload files.
I wan to create a button in a view, when button is clicked popup or dialog box should be opened to path of file. I tried to do it using GUI function module such has GUI_UPLOAD, method such has CL_GUI_FRONTEND_SERVICE methods but error is displayed that NOT_SUPPORT_GUI. When i searched forum for this error, expert say that we can not use above methods in webynpro.
I want to have some method to perform above operation.
Otherwise, can i change the text and position of button from right of to left of input field and display text in input field and the time of display.
Thanks
Faiz Khan
Hi maybe this link can help you.
Upload and Download files in Webdynpro ABAP - Web Dynpro ABAP - SCN Wiki
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Ronaldo,
The client is ready to use the FileUpload UI element and we have implemented the steps mentioned above link. But the requirement is more then Uploading file, as mentioned below:
1. To upload multiple files, add a link or a button that create FileUpload UI element dynamically.
2, To display error message if file selected is other than word, excel, ppt, and PDF. The error message should be displayed at the time of file selection i.e. when i click on browser button of FileUpload button and select the file.
3. when a file is selected for upload and click on button (to dynamically create File Uplaod UI element to upload another file as mentioned in first requirement) the first file which i selected is cleared. How the issue can be solved.
4. Since a node named File_upload with filename, filetype, filesize & filecontent attribute is created, and same node is getting bind with more then one File Upload button how can we retrieve from node multiple file to store.
Thanks
Faiz Khan
Dear Khan,
You can create a popup window and embed a view which contains File Upload UI element in the pop window. Call this popup window in action of the button. you can use component controller's context to make the data global.
Thanks,
Naga
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Faiz khan,
What is the reason why you didn't use the GUI upload button.
Define attribute in the note Data with type xstring & Filename type cfilename & bind the data attribute with the data property of the element.
& define one action for the button.
DATA lo_el_upload_file TYPE REF TO if_wd_context_element.
DATA ls_upload_file TYPE wd_this->element_upload_file.
DATA ls_upload_file_tmp TYPE wd_this->element_upload_file.
* navigate from <CONTEXT> to <UPLOAD_FILE> via lead selection
lo_nd_upload_file = wd_context->get_child_node( name = wd_this->wdctx_upload_file ).
* get element via lead selection
lo_el_upload_file = lo_nd_upload_file->get_element( ).
* get all declared attributes
lo_el_upload_file->get_static_attributes(
IMPORTING
static_attributes = ls_upload_file ).
* get all declared attributes
Automatic data in coming in the ls_upload_File with XSTRING value & convert the Xstring data to string data
CALL FUNCTION 'ECATT_CONV_XSTRING_TO_STRING'
EXPORTING
im_xstring = ls_upload_file-data
IMPORTING
ex_string = lw_dstring.
SPLIT lw_dstring AT cl_abap_char_utilities=>newline INTO TABLE lt_string.
Regards.
Nishant Bansal
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.