‎2008 Nov 14 10:54 AM
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.
‎2008 Nov 14 10:57 AM
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.
‎2008 Nov 14 11:01 AM
The Problem still remains, I need the hex code of Cell Separator.
‎2008 Nov 14 11:10 AM
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.
‎2008 Nov 14 11:03 AM
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.
‎2008 Nov 14 11:03 AM