Skip to Content

Reading Excel file from Application Server into ABAP Internal Table

Dear Experts,

I'm having trouble reading an Excel file from application server. I tried implementing this solution https://wiki.scn.sap.com/wiki/display/Snippets/Reading+Excel+file+from+Application+Server+into+ABAP+Internal+Table

but I'm still facing some issue with the structure of I_DATA1

I'm not sure how schould I be defining it

This is my type definition :

types:begin of i_data,
A type string,
B type string,
C type string,
D type string,

end of i_data.

My Excel file has 4 columns

Please advise me .

Regards,

Houriya

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Best Answer
    Nov 22, 2017 at 03:59 PM

    Dear community,

    After debugging the program, I came across the things that were missing :

    1 - if you plan to reproduce the same example giving by Praveen Singh, in the function module ZEXCEL_TO_ABAP,

    * while loading the XML data you need to put 'c_shared_str_xml' variable instead of the variable 'c_sheet_xml'.

    *while loading the sheet data you need to put 'c_sheet_xml' variable instead of the variable 'c_shared_str_xml'.

    2 - When it comes to the XLST Transformation, it needs to have the same name of the internal table and its fields.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 25, 2017 at 05:32 AM

    Your transformation should reflect the name of your internal table and names of its fields.

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 25, 2017 at 03:37 AM
    -4

    hi

    use this fm TEXT_CONVERT_XLS_TO_SAP

    example:

    DATA:LT_RAW TYPE TRUXS_T_TEXT_DATA,
    LV_FILE TYPE RLGRAP-FILENAME.

    REFRESH:CT_UPLOAD[].


    CLEAR LV_FILE.
    LV_FILE = PA_FILE.

    CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
    I_FIELD_SEPERATOR = 'X'
    I_TAB_RAW_DATA = LT_RAW
    I_FILENAME = LV_FILE
    TABLES
    I_TAB_CONVERTED_DATA = CT_UPLOAD
    EXCEPTIONS
    CONVERSION_FAILED = 1
    OTHERS = 2.

    adv: in ur code dont use string.

    use char or text with length

    Add comment
    10|10000 characters needed characters exceeded

    • I'm pretty sure OP already knows this. It's part of the code in the Wiki referenced in the original question.

      Sorry but I don't see how generic information about OPEN DATASET (which is available in ABAP Help) could possibly help OP in reading Excel format.