cancel
Showing results for 
Search instead for 
Did you mean: 

File upload

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Sm1tje
Active Contributor
0 Kudos

You can upload any kind of file with the FileUpload UI element.

Former Member
0 Kudos

Micky,

I do agree with ur statement.

But I'm not able to read it.

Former Member
0 Kudos

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