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

Function Module required

I am uploading excel sheet into ABAP. I was using gui_upload function module. Problem is the excel sheet is having fields which are getting different number of columns for different excel sheets. So, i am unable to use gui_upload function module. Is there any other function module which can be used to achieve this.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

8 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Dec 10, 2005 at 11:54 AM

    Hi,

    try using ALSM_EXCEL_TO_INTERNAL_TABLE function module.

    if it helps u pl. award appropriate points.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 10, 2005 at 11:54 AM

    aslm_excel_to_internal_table

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 10, 2005 at 11:54 AM

    please reward for helpful answers

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 10, 2005 at 11:59 AM
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
    filename = p_inp " file name i_begin_col = 1
    i_begin_row = 1
    i_end_col = 100
    i_end_row = 65536
    TABLES
    intern = l_t_excel
    EXCEPTIONS
    inconsistent_parameters = 1
    upload_ole = 2
    OTHERS = 3.

    don't forget to delete first record as it will have header (fiueld names)

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 10, 2005 at 12:20 PM

    Please Close the thread if your Porblem solves...

    reward for helpful answers...

    regards

    vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 10, 2005 at 12:30 PM

    are you facing any problem with the Function module...

    if so please let me know....

    regards

    vijay

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 10, 2005 at 12:41 PM

    I hope both the FMs are same...

    please unassign the Points which you gave it to me....

    this looks very odd...

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 12, 2005 at 04:15 AM

    Hi try this,

    REPORT zexcelup

    LINE-SIZE 1023

    LINE-COUNT 250.

    TABLES: alsmex_tabline.

    DATA: BEGIN OF iexcel OCCURS 0.

    INCLUDE STRUCTURE alsmex_tabline.

    DATA: END OF iexcel.

    • No of columns

    DATA: BEGIN OF data_tab OCCURS 0,

    value_0001(25),

    value_0002(25),

    value_0003(25),

    value_0004(25),

    value_0005(25),

    value_0006(25),

    value_0007(25),

    value_0008(25),

    value_0009(25),

    value_0010(25),

    value_0011(25),

    value_0012(25),

    value_0013(25),

    value_0014(25),

    value_0015(25),

    value_0016(25),

    value_0017(25),

    value_0018(25),

    value_0019(25),

    value_0020(25),

    value_0021(25),

    value_0022(25),

    value_0023(25),

    value_0024(25),

    value_0025(25),

    value_0026(25),

    value_0027(25),

    value_0028(25),

    value_0029(25),

    value_0030(25),

    value_0031(25),

    value_0032(25),

    value_0033(25),

    value_0034(25),

    value_0035(25),

    value_0036(25),

    value_0037(25),

    value_0038(25),

    value_0039(25),

    value_0040(25),

    value_0041(25),

    value_0042(25),

    value_0043(25),

    value_0044(25),

    value_0045(25),

    value_0046(25),

    value_0047(25),

    value_0048(25),

    value_0049(25),

    value_0050(25),

    value_0051(25).

    DATA: END OF data_tab.

    DATA: tind(4) TYPE n.

    DATA: zwfeld(19).

    FIELD-SYMBOLS: <fs1>.

    PARAMETERS: filename LIKE rlgrap-filename MEMORY ID m01,

    noheader AS CHECKBOX.

    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

    EXPORTING

    filename = filename

    i_begin_col = 1

    i_begin_row = 1

    i_end_col = 100

    i_end_row = 30000

    TABLES

    intern = iexcel

    EXCEPTIONS

    inconsistent_parameters = 1

    upload_ole = 2

    OTHERS = 3.

    IF sy-subrc <> 0.

    WRITE: / 'EXCEL UPLOAD FAILED ', filename, sy-subrc.

    ELSE.

    SORT iexcel BY row col.

    LOOP AT iexcel.

    IF noheader = 'X'

    AND iexcel-row = 1.

    CONTINUE.

    ENDIF.

    tind = iexcel-col.

    CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.

    ASSIGN (zwfeld) TO <fs1>.

    <fs1> = iexcel-value.

    AT END OF row.

    APPEND data_tab.

    CLEAR data_tab.

    ENDAT.

    ENDLOOP.

    ENDIF.

    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.