Skip to Content
0
Former Member
Aug 08, 2011 at 12:54 PM

Uploading Excel file in SRM

198 Views

Hello,

I need to upload excel file in SRM system.

FM ALSM_EXCEL_TO_INTERNAL_TABLE & TEXT_CONVERT_XLS_TO_SAP are not available in this system.

i am able to upload text file (.txt) using following code

AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILE.
 CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
 PROGRAM_NAME        = SYST-REPID
* DYNPRO_NUMBER       = SYST-DYNNR
*   FIELD_NAME          = 'P_FILE'
 STATIC              = 'X'
MASK                = '.excel , *.xls '
  CHANGING
file_name           = p_file
EXCEPTIONS   MASK_TOO_LONG       = 1
 OTHERS              = 2          .
IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO*
*       WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

ld_file = p_file.

  CALL METHOD cl_gui_frontend_services=>gui_upload
  EXPORTING
    filename = ld_file
*    filetype = 'ASC'
*    filetype = 'BIN'
    filetype = 'DAT'
    HAS_FIELD_SEPARATOR           = 'X'
  CHANGING
    data_tab = itab[]
  EXCEPTIONS
    OTHERS   = 1.

tried with filetype = ASC , BIN & DAT - All r allowing .txt file only.

Please tell me which parameters do i need to provide in order to upload excel file

thanks & regrads,