cancel
Showing results for 
Search instead for 
Did you mean: 

how can I upload a file in Web Dynpro?

yjiang
Advisor
Advisor
0 Kudos

hi experts,

I am working on WD for uploading a excel and processing the excel.

I design a button with the event to call the method "cl_wd_runtime_services=>attach_file_to_response" for opening a local file, is it right???

if the method is right, how should I configure the parameters? any other methods for upload a excel from local??

Many thanks.

best wishes,

Yang

Accepted Solutions (1)

Accepted Solutions (1)

former_member186491
Contributor
0 Kudos

Hi Yang,

Please check this weblink -

http://wiki.sdn.sap.com/wiki/display/WDABAP/WDA+for+uploading+Data+from++Excel+sheet

This describes the process of achieving that same.

Hope this would help you.

Thanks.

Kumar Saurav.

yjiang
Advisor
Advisor
0 Kudos

thanks Kumar.

I have done the upload but the file must be tab delimited, otherwise the file conent is in chaos.

do you have any idea on how to upload the Excel file with CORRECT format parsing?

Answers (1)

Answers (1)

Former Member
0 Kudos

You can upload files using file upload UI element. Create a node with four attributes file name of type string, file content of type xstring, file type of type string and file size of type integer. Then read file upload UI element and set that to your node. Now you can convert your file contents from xstring to string and can use that for further processing.

Or you can use office control instead of file upload UI element.

You can also refer this link.

http://wiki.sdn.sap.com/wiki/display/WDABAP/Excel+File+Upload+And+Display+Data+Using+Web+DynPro+ABAP

Cheers,

Dineshwar.

yjiang
Advisor
Advisor
0 Kudos

hi Dineshwar,

thanks a lot, and the same  question.

I have done the upload but the file must be tab delimited, otherwise the file conent is in chaos.

do you have any idea on how to upload the Excel file with CORRECT file connent parsing as column or row?

Former Member
0 Kudos

If you want to use excel file for manipulation then it is better to go with single parameter (file content) instead of going with file name, file content, file size and file type.

Here, file content can be of type string. If your excel sheets' structure is standard then you can manipulate or display in tables.

Look at the following link, you will get an idea.

http://wiki.sdn.sap.com/wiki/display/WDABAP/Excel+File+Upload+And+Display+Data+Using+Web+DynPro+ABAP

yjiang
Advisor
Advisor
0 Kudos

hi Dineshwar,

thanks for you answer, your given information is the same concept of displaying tab delimited format, rather than .xsl file.

I think there may need some XML techniques to make transformation.

thanks a lot.

cheers, yang