04-21-2009 3:27 PM
Hi all.
I have a the following problem. I am trying to upload an excel file with long texts (about 700 char) and I am using FM ALSM_EXCEL_TO_INTERNAL_TABLE but the standard structure ALSMEX_TABLINE only allows char50. Do you have any idea to solve this without having to copy these FM/ structure to "Z"?
Thanks in advance.
04-21-2009 3:36 PM
Hi,
Use this function module it will upload the long text
CLEAR : w_subrc.
DATA : wa_tab_raw_data TYPE truxs_t_text_data.
Function module to upload the excel file from presentation server
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
i_line_header = 'X'
i_tab_raw_data = wa_tab_raw_data
i_filename = p_inp
TABLES
i_tab_converted_data = t_input
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
w_subrc = 'X'.
ENDIF.
Regards
Krishna
Edited by: Krishna Gowrneni on Apr 21, 2009 8:07 PM
Edited by: Krishna Gowrneni on Apr 21, 2009 10:33 PM
04-21-2009 3:36 PM
Hi,
Use this function module it will upload the long text
CLEAR : w_subrc.
DATA : wa_tab_raw_data TYPE truxs_t_text_data.
Function module to upload the excel file from presentation server
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
i_line_header = 'X'
i_tab_raw_data = wa_tab_raw_data
i_filename = p_inp
TABLES
i_tab_converted_data = t_input
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
w_subrc = 'X'.
ENDIF.
Regards
Krishna
Edited by: Krishna Gowrneni on Apr 21, 2009 8:07 PM
Edited by: Krishna Gowrneni on Apr 21, 2009 10:33 PM
04-21-2009 3:38 PM
Hi Cristina,
1. Copy the module into your customer namespace.
2. As Associated Type for the table parameter INTERN, use your own structure that has the same components as the original structure ALSMEX_TABLINE. By using your own component types, you can get around the restrictions on rows, columns or cell length.
For more information check OSS note:
[Note 933420 - ALSM_EXCEL_TO_INTERNAL_TABLE|https://websmp207.sap-ag.de/~form/handler?_APP=01100107900000000342&_EVENT=REDIR&_NNUM=933420&_NLANG=E]
04-21-2009 4:54 PM
04-21-2009 5:41 PM
Hi again.
I have the problem again. I get 255 characters, although my internal table line has 4096 characteres, see below the program code:
DATA: BEGIN OF t_input OCCURS 0,
line(4096),
END OF t_input.
DATA: wa_input LIKE LINE OF t_input.
Function module to upload the excel file from presentation server
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
i_line_header = 'X'
i_tab_raw_data = wa_tab_raw_data
i_filename = 'C:\test.xls'
TABLES
i_tab_converted_data = t_input
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
Have I define the line of internal table with an specil type?
Thanks again,
05-09-2014 7:28 AM
Hi Cristina,
I have a similar requirement. Were you able to solve your problem?
Thanks,
Isha
05-12-2014 2:31 PM
Hello Isha,
I did the following, maybe there is anther right ways but after looking for a solution during long time, the only thing that I found was this.
I hope this be usefull for you.
Declare in se11
structure zalsmex_tabline
ROW TYPE KCD_EX_ROW_N
COL TYPE KCD_EX_COL_N
VALUE TYPE CHAR1000SF
Copy estándar function module ALSM_EXCEL_TO_INTERNAL_TABLE and change the structure of table to z structure
Regards
Cristina,