Skip to Content
avatar image
Former Member

Excel Upload in SRM System

Dear Experts,

                     Am trying to upload excel file(xls) in SRM system using below code but am getting data in Chinese format don't know how to convert into normal format and i used other format like .CSV(Comma del..) but in this am getting data but getting with special characters like (, #) , please help me to upload excel file(xls format) file to internal table.

CALL METHOD CL_GUI_FRONTEND_SERVICES=>GUI_UPLOAD

     EXPORTING

       FILENAME                = L_FHEAD01

       FILETYPE                = 'ASC'

*     HAS_FIELD_SEPARATOR     = '|'

*     HEADER_LENGTH           = 0

*     READ_BY_LINE            = 'X'

       DAT_MODE                = 'X' "SPACE

*     CODEPAGE                = SPACE

*     IGNORE_CERR             = ABAP_TRUE

       REPLACEMENT             = '#'

*     VIRUS_SCAN_PROFILE      =

*  IMPORTING

*     FILELENGTH              =

*     HEADER                  =

     CHANGING

       DATA_TAB                = LT_TRAN

*     ISSCANPERFORMED         = SPACE

     EXCEPTIONS

       FILE_OPEN_ERROR         = 1

       FILE_READ_ERROR         = 2

       NO_BATCH                = 3

       GUI_REFUSE_FILETRANSFER = 4

       INVALID_TYPE            = 5

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Dec 11, 2015 at 12:51 PM

    Hi Sarmat,

    I don't think that the class you are using for upload will work well in Web Dynpro.

    Please see some below blogs for better approach.

    Excel File Upload And Display Data Using Web DynPro ABAP - Web Dynpro ABAP - SCN Wiki

    Upload XLSX file in WebDynpro ABAP and view its content

    For delimiting the garbage value, you can follow the below thread.

    BR,

    RAM.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      HI Rama,

                     Thanks for your quick reply, am not uploading in webdynpro, am uploading in normal ABAP(SE38)  only but using SRM server  . Please help

  • Dec 14, 2015 at 09:47 AM

    Hi Sarmath

    PLease try using this standard classes which may do the trick for you .

    DATA : oref_container TYPE REF TO cl_gui_custom_container,

            iref_control     TYPE REF TO i_oi_container_control,

            iref_document    TYPE REF TO i_oi_document_proxy,

            iref_spreadsheet TYPE REF TO i_oi_spreadsheet,

            iref_error       TYPE REF TO i_oi_error.

    Check the attached on how I used it ..

    Also try using these FM

    cl_gui_frontend_services=>file_open_dialog


    * CALL: FM to upload excel data into internal table
    CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
     

    Check this note as well

    790860 - Frequently asked questions for Excel upload and download

    regards

    Vinita


    Add comment
    10|10000 characters needed characters exceeded

  • Dec 14, 2015 at 10:14 AM

    Hi,

    Use the function module ALSM_EXCEL_TO_INTERNAL_TABLE or use the class CL_FDT_XL_SPREADSHEET to upload excel file.

    Please check the following links:

    For FM: http://wiki.scn.sap.com/wiki/display/Snippets/How+to+use++FM+ALSM_EXCEL_TO_INTERNAL_TABLE

    For the class: http://zevolving.com/2013/11/abap-webdynpro-upload-excel-file-using-class-cl_fdt_xl_spreadsheet/

    Regard,

    Taiyeb

    Add comment
    10|10000 characters needed characters exceeded