‎2009 Jan 19 8:24 AM
Hi ,
I want to upload a Excel file .Please tell me ,i can use GUI_upload or not . As i read in the documentaion of this function oly ASC and BIN file are mentiones there .
Rgds,
Premraj
Edited by: PremRaj kaushik on Jan 19, 2009 9:24 AM
‎2009 Jan 19 8:26 AM
Hi,
You can use GUI_UPLOAD using file type parameter as 'ASC' for uploading Excel file.
Best regards,
Prashant
‎2009 Jan 19 8:26 AM
Hi,
You can use GUI_UPLOAD using file type parameter as 'ASC' for uploading Excel file.
Best regards,
Prashant
‎2009 Jan 19 8:26 AM
Hi,
U can also use ws_upload for the same and use F1 to get the help on Filetype like ASC or DAT
Regards
Mudit
‎2009 Jan 19 8:27 AM
‎2009 Jan 19 8:29 AM
Hi,
Use FN Module TEXT_CONVERT_XLS_TO_SAP'
Declare Type pools: TYPE-POOLS: truxs.
Declare Data: Data i_raw TYPE truxs_t_text_data.
Declare Parameter : p_fname TYPE rlgrap-filename.
Better to Have a it_excel all fields in Char or string type. in order to avoid type mismatches.
Call FN Module and pass variables
FORM file_upload_fname USING p_fname TYPE rlgrap-filename.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
i_tab_raw_data = i_raw
i_filename = p_fname
TABLES
i_tab_converted_data = it_excel.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
To delete header line
IF it_excel IS NOT INITIAL.
DELETE it_excel INDEX 1.
ELSE.
MESSAGE i000(0k) WITH 'No Data in Excel File'.
ENDIF.
ENDFORM. " FILE_UPLOAD_FNAME
Regards,
shiva
‎2009 Jan 19 8:33 AM
Hi ,
Use fm ALSM_EXCEL_TO_INTERNAL_TABLE to upload data frm excel.
Regards,
Radhika
‎2009 Jan 19 8:45 AM
Hi PremRaj,
You can use function module GUI_UPLOAD
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename =
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = ' '
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
DAT_MODE = ' '
CODEPAGE = ' '
IGNORE_CERR = ABAP_TRUE
REPLACEMENT = '#'
CHECK_BOM = ' '
VIRUS_SCAN_PROFILE =
NO_AUTH_CHECK = ' '
IMPORTING
FILELENGTH =
HEADER =
tables
data_tab =
EXCEPTIONS
FILE_OPEN_ERROR = 1
FILE_READ_ERROR = 2
NO_BATCH = 3
GUI_REFUSE_FILETRANSFER = 4
INVALID_TYPE = 5
NO_AUTHORITY = 6
UNKNOWN_ERROR = 7
BAD_DATA_FORMAT = 8
HEADER_NOT_ALLOWED = 9
SEPARATOR_NOT_ALLOWED = 10
HEADER_TOO_LONG = 11
UNKNOWN_DP_ERROR = 12
ACCESS_DENIED = 13
DP_OUT_OF_MEMORY = 14
DISK_FULL = 15
DP_TIMEOUT = 16
OTHERS = 17
.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
Here by giving file type as 'ASC', you can upload Excel format file into you abap program.
Hope it helps you.
Regards
Mansi
‎2009 Jan 19 9:15 AM
Hi,
You can use GUI_UPLOAD or WS_UPLOAD and select filetype is 'ASC' for uploading teh excel file.
Regards,
Jyothi CH.
Edited by: Jyothi Chinnabathuni on Jan 19, 2009 4:21 PM
‎2009 Jan 19 9:26 AM
Hi,
Use FM "ALSM_EXCEL_TO_INTERNAL_TABLE " uploading excel file. In this FM you can give column and row specification.
You can also use FM "GUI_UPLOAD" .
Regards
Md.MahaboobKhan
‎2009 Jan 19 11:23 AM
Hi,
You can also use OLE to download it in excel file.
search in SDN for that.
regards,
Lokesh