Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

excel file upload from pc to internal table

Hello all,

i am trying to upload an excel file to internal table but i get an error.

i am using fm 'F4_FILENAME' to get the file and then i am using  fm  'ALSM_EXCEL_TO_INTERNAL_TABLE' .


i have searched the net but i couldnt find a solution to that error.



here is my code :

DATA FILE_PATH LIKE  RLGRAP-FILENAME.

DATA: it_raw    TYPE          truxs_t_text_data.

data : BEGIN OF itab OCCURS 0,

        BSKODU like ZR52-BSKODU,

        BSADI LIKE ZR52-BSADI,

        GSBER LIKE ZR52-GSBER,

        GBATARIH LIKE ZR52-GBATARIH,

        GBITARIH LIKE ZR52-GBITARIH,

        AKTIFPASIF LIKE ZR52-AKTIFPASIF,

        MAIL LIKE ZR52-MAIL,

   END OF ITAB.

START-OF-SELECTION.

CALL FUNCTION 'F4_FILENAME'

     EXPORTING

       field_name = 'FILE_LOC' "

     IMPORTING

       file_name  = FILE_PATH.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'

     EXPORTING

       FILENAME = FILE_PATH

       I_BEGIN_COL             = '1'

       I_BEGIN_ROW             = '2'

       I_END_COL               = '2'

       I_END_ROW               = '2'

      TABLES

       INTERN                  = ITAB

      EXCEPTIONS

       INCONSISTENT_PARAMETERS = 1

       UPLOAD_OLE              = 2.

regards,

cem

Former Member
Not what you were looking for? View more on this topic or Ask a question