Application Development 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: 

Upload Excel File with a length cell up to 300 char into internal table

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

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

venkatesan_nagiah
Active Participant
0 Kudos

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]

Former Member
0 Kudos

Problem solved! Thanks a lot!

Regards

Cristina.

Former Member
0 Kudos

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,

0 Kudos

Hi Cristina,

I have a similar requirement. Were you able to solve your problem?

Thanks,

Isha

Former Member
0 Kudos

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,