cancel
Showing results for 
Search instead for 
Did you mean: 

Reg File Upload Object in abap Webdynpro

Former Member
0 Kudos

Hi Friends,

Would like to enquire one doubt in the file upload object in abap webdynpro.

By default when we press the browse button, near to the file name there is a button which shows the the file types like:

., *.html, ,gif,.jpeg etc.

Is there any way we can control that, as i have an requirement where in to upload only certain extension types.

thankyou.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Thanks a lot friiend....Its kind of started working..rest i ll try myself.

Have found out that passing parameter close_in_any_case for window, will disable button, so have to code for the buttons manuallly.

Take care.

Former Member
0 Kudos

hi,

Bind the Mimetype of FileUpload' s property with an attribute of type String.

So after you have uploaded the file using Browse button, you will have the type of file in this attriubte.

Now you can read this file type ( whether JPG,Word,Excel ) and throw error message on any button's action.

If you dont have any action available write the code in WDdomodify but avoid writing in wddomodify.

You must be having some action handler to do validation. Write the code there. It will work.

Former Member
0 Kudos

Hi Saurav,

Thanks for your reply. I understood what u told. Would like to ask you one thing as i am new in webdynpro programming.

I have a view with upload object called in a window during an action, now when user presses ok button, and if the extension is not valid, another grid with valid extension types should be populated in the same window, and the window should not close untill the correct extension type is given or when close button is pressed. could u give a logic to implement this.?

Former Member
0 Kudos

hi,

with MimeType , you got that extension. Rite.

now on the click of button or any actin , you can check the mime type's value with some valid values.

throw an error message if extension is invalid and also give the valid entries to the user via Message only.

Former Member
0 Kudos

good u r online.

From the action handler of the window button i am getting the file type. But the user wants a grid in the same window showing the valid extension types stored in a table, so that the user can enter again uplaod the file before the close of the window.

could u throw a light on this.

Former Member
0 Kudos

HI,

I would suggest you to follow this approach :

1. Create a Table in your View in which FileUpload is there.

2. Populate this value with valid file extension.

3. Make it invisible by default.

4. Now when you have entered value in Fileupload and click on Ok button.

5. Check whether Mimetype matches any value in Table.

6. If it is invalid, Throw an error message and mke Table of Valid extension Visible.

Sample code to have Table with Valid entries.

types : begin of str,

valid_ext type string,

end of str.

data : wa type str,

itab type table of str.

wa-valid_Ext = 'EXL'.

append wa to itab.

wa-valid_ext = 'DOC'.

append wa to itab.

lo_nd->bind_Table( itab ).

here lo_nd is your ref to node of Table having valid extensions.

7. Bind this Table's Visible property wiht wdui_visiblity .

8. Set it Visible - 02 , Inviisible - 01.

I hope it is clear.