on 04-25-2012 1:43 PM
Hi,
How to upload excel file into internal table in sap crm.
Regards,
Ravi.
Hi,
In addition to GUI_UPLOAD function you can use these functions to upload excel (include xls) files to internal table.
* KCD_EXCEL_OLE_TO_INT_CONVERT
* ALSM_EXCEL_TO_INTERNAL_TABLE
* TEXT_CONVERT_XLS_TO_SAP
Regards,
Onur.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
By using the fm UPLOAD_XLS_FILE_2_ITAB directly excel file can be uploaded to internal table.
CALL FUNCTION 'UPLOAD_XLS_FILE_2_ITAB'
EXPORTING
i_filename = p_local
TABLES
e_itab = lt_file
EXCEPTIONS
file_error = 1
OTHERS = 2.
Regards,
Vignesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try the code snippet from the below link. It will help you to upload excel file(*.xsl) into SAP CRM.
Its working fine, customize it as you need.
http://wiki.sdn.sap.com/wiki/display/Snippets/ABAP+-+Upload+data+from+Excel+to+Sap+using+OO
Thank you.
Regards,
Swadini Sujanaranjan.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravi.
we cannot upload data from excel to internal table.But if u save the file with .csv (comma separeated value file) extension it is easy to upload into internal table by using the functions.
hope the sample code below will help you....
DATA: lt_file_table TYPE filetable,
ls_file LIKE LINE OF lt_file_table,
lv_filename TYPE string,
lv_file TYPE string,
lv_rc TYPE sy-subrc,
lv_path TYPE char255..
CALL FUNCTION 'TRINT_SPLIT_FILE_AND_PATH'
EXPORTING
full_name = lv_filename
IMPORTING
stripped_name = lv_file
file_path = lv_path
EXCEPTIONS
x_error = 1
OTHERS = 2.
cl_gui_frontend_services=>gui_upload(
EXPORTING
filename = lv_file
* filetype = 'DAT'
has_field_separator = 'X'
CHANGING
data_tab = lt_dlr_price
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
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19
).
cheers...............
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.