cancel
Showing results for 
Search instead for 
Did you mean: 

How to upload excel file in Webdynpro application using ABAP

Former Member
0 Kudos

Hi Experts,

Am developing a webdynpro application in which it will take an excel file as input and display the contents in the form of a table in output. I am able to upload tab delimited text file and populate the table using the below code but not able to do the same with .xls file. Pls let me know if I need to use a different function module for upload excel file.

  • get single attribute

wd_context->get_attribute(

EXPORTING

name = `DATASOURCE`

IMPORTING

value = l_xstring ).

CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'

EXPORTING

in_xstring = l_xstring

IMPORTING

out_string = l_string.

SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE i_data.

  • Bind With table Element.

LOOP AT i_data INTO l_string.

SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.

READ TABLE fields INTO lv_field INDEX 1.

fs_table-name = lv_field.

READ TABLE fields INTO lv_field INDEX 2.

fs_table-age = lv_field.

APPEND fs_table TO t_table1.

ENDLOOP.

lo_nd_data = wd_context->get_child_node( 'DATA_TAB' ).

lo_nd_data->bind_table( T_TABLE1 ).

Thanks,

Subathra

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello Subathra,

Were you able to upload directly from excel instead of saving it as tab delimitted txt file.

If so can you please let me know the solution also..

Because i am also in need of such a solution...

Regards, Linda.

Former Member
0 Kudos

Using webdynpro, u can upload only tab delimited file.

Direct excel upload is not possible through that upload.

U have to use XML coding. if u want more help means let me know..ill give u the code

Former Member
0 Kudos

Hi Virkly,

I need your help.

Please give me the XML Code for Uploading Excel File in WDA.

Thanks in advance.

Bull Eye

gopalkrishna_baliga
Participant
0 Kudos

Hi Virky,

Can you share your XML code to read excel file in webdynpro?

thanks

Gopal

Former Member
0 Kudos

Dear Exports

Can anyone guide me how to uplode the .xlsx or ..xls formatted excel file using abap webdynpro without converting it to .txt file. Because my client requirement is only to upload the excel file. because to convert the .xlsx flie to .txt file it will be time taking and cost expanssive. Another requirement is suppose today i have create a application for uploading a file which has 8 columns and 10 rows. suppose tomorrow the client will make some changes in that flat file means the client will add 2 extra columns and 10 more columns in that fil. and will upload that file. Then the new file will be display on the browser or old file. but my requirement is to display the new file in browser.

Can anyone kindly help to solve my problem. I am completely fresher in this field and I need to do it as soon as possible. Please help to solve the problem. 

Regards

Rashmita

yjiang
Advisor
Advisor
0 Kudos

hi Virkly,

I am also working on the excel upload feature.

could you please share your XML code with me??

thanks, Yang

Former Member
0 Kudos

Hi Neha,

The thread says that the excel file must be saved as tab delimited text file before used for uploading. Is that the only possible way to upload excel file? Can we not upload the .xls file directly without converting the file type to .txt?

Thanks

Subathra