Skip to Content
author's profile photo Former Member
Former Member

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

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Apr 21, 2009 at 02: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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 21, 2009 at 02: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]

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 21, 2009 at 03:54 PM

    Problem solved! Thanks a lot!

    Regards

    Cristina.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 21, 2009 at 04: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,

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on May 12, 2014 at 01: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,

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.