cancel
Showing results for 
Search instead for 
Did you mean: 

Upload file in webdynpro abap

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (2)

Answers (2)

ronaldo_aparecido
Contributor
0 Kudos
Former Member
0 Kudos

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

NagaPrakashT
Contributor
0 Kudos

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

Former Member
0 Kudos

Hello Prakash,

Thanks for your response, but i can not use File upload UI element. I want a Push button, which when clicked should perform usually operation like that we use in SAP GUI for example use of GUI_UPLOAD and F4_HELP for to have dialog box to specify path of file.

Thanks

Faiz Khan

nishantbansal91
Active Contributor
0 Kudos

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