on 05-08-2008 7:51 PM
Hi experts,
Using fileupload UI element,
1.I want to select a excel file.
2. Read the excel file
3. Show the ouput in table.
I could the do the above with CSV file type.
But I need with xls file type.
How to proceed???
Thx,
Suba
You can upload any kind of file with the FileUpload UI element.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
hi subaram.......
the best is to use a .csv file because the excel files are not properly supprted.
data:
begin of wa, structure of the node/file
mandt type mandt,
matnr type matnr,
end of wa,
itab like table of wa,
rows type standard table of string , will hold the entire contents
wa_rows(300) type c .
DATA lo_el_context TYPE REF TO if_wd_context_element.
DATA ls_context TYPE wd_this->element_context.
DATA lv_contents LIKE ls_context-contents.
* get element via lead selection
lo_el_context = wd_context->get_element( ).
* get single attribute
lo_el_context->get_attribute(
EXPORTING
name = `CONTENTS`
IMPORTING
value = lv_contents ).
DATA : loc_conv TYPE REF TO cl_abap_conv_in_ce,
var_string TYPE string, holds the string value of the file
inst type ref to CL_SWF_UTL_CONVERT_XSTRING,
inst1 type ref to cl_abap_conv_in_ce.
CALL METHOD cl_abap_conv_in_ce=>create
EXPORTING
input = lv_contents
encoding = 'UTF-8'
replacement = '?'
ignore_cerr = abap_true
RECEIVING
conv = loc_conv.
CALL METHOD loc_conv->read
IMPORTING
data = var_string.
---regards
alex b justin
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.