Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Excel File Upload

former_member212005
Active Contributor
0 Likes
629

Hi,

I am uploading an .xls file into a dynamically created internal table.

The problem that I am facing is that the data in the excel files are in different cells. So I need to know the hexacode of the Cell Separator so that I may split my data at that position.

If I can know the way to get the structure of the excel file, will also help..

All these things are happening dynamically..............i.e. I do not the structure of internal table...untill run time.

5 REPLIES 5
Read only

Former Member
0 Likes
602

Hi

Use ALSM_EXCEL_INTERNAL_TABLE.

Data: XL_itab type alsmex_tabline occurs 1 with header line.

ALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      FILENAME                      = p_fname
      I_BEGIN_COL                   = 2
      I_BEGIN_ROW                   = 12
      I_END_COL                     = 5
      I_END_ROW                     = 15
    TABLES
      INTERN                        = xl_itab
* EXCEPTIONS
*   INCONSISTENT_PARAMETERS       = 1
*   UPLOAD_OLE                    = 2
*   OTHERS                        = 3
            .
  IF SY-SUBRC <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Regards,

Vishwa.

Read only

0 Likes
602

The Problem still remains, I need the hex code of Cell Separator.

Read only

0 Likes
602

Hi

Check this Link: [About Using Hex for Download|http://sapprograms.blogspot.com/2008/11/creating-more-than-1-sheet-in-excel.html]

Hope, you will get an idea on how to do it for upload.

Regards,

Vishwa.

Read only

Former Member
0 Likes
602

Hi,

use this FM


  TYPE-POOLS: truxs.
  DATA: itab TYPE truxs_t_text_data   .

  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
      i_field_seperator    = 'X'
      i_tab_raw_data       = itab
      i_filename           = p_file
    TABLES
      i_tab_converted_data = <dyn_table>
    EXCEPTIONS
      conversion_failed    = 1
      OTHERS               = 2.

Read only

Former Member
0 Likes
602

Hi,

try these..


GUI_UPLOAD
WS_UPLOAD

Arunima