Upload data from excel file to Oracle table
Dear All,
I have to upload data from excel file to Oracle table without using third party tools and without converting into CSV file.
Could you tell me please how can i do this using PLSQl or SQL Loader.
Thnaks in Advance..
Dear All,
I have to upload data from excel file to
Oracle table without using third party tools and
without converting into CSV file.
Could you tell me please how can i do this
using PLSQl or SQL Loader.
Thnaks in Advance..As billy mentioned using ODBC interface ,the same HS service which is a layer over using traditional ODBC to access non oracle database.Here is link you can hit and trial and come out here if you have any problem.
http://www.oracle-base.com/articles/9i/HSGenericConnectivity9i.php[pre]
Khurram
Similar Messages
-
hi guru,
I want to upload data from excel file for mm02.. first of all help on the matter of how to upload data from excel...
i hv used the FM ALSM_EXCEL_TO_INTERNAL_TABLE.. but its not working it uploading garbage value ... so tell me how to used it...
help me on this matter.Check below example.
parameters : p_file LIKE rlgrap-filename OBLIGATORY.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM get_file_name.
PERFORM get_file_to_excel.
*& Form get_file_name
FORM get_file_name.
DATA: lv_name LIKE sy-repid.
lv_name = sy-repid..
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
program_name = lv_name
dynpro_number = syst-dynnr
static = 'X'
CHANGING
file_name = p_file.
ENDFORM. " get_file_name
*& Form get_file_to_excel
FORM get_file_to_excel.
DATA: idata LIKE alsmex_tabline OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = '1'
i_begin_row = '2' "Do not require headings
i_end_col = '2'
i_end_row = '60000'
TABLES
intern = idata
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
STOP.
ENDIF.
* Get first row retrieved
READ TABLE idata INDEX 1.
* Set first row retrieved to current row
DATA: gd_currentrow TYPE i.
gd_currentrow = idata-row.
LOOP AT idata.
* Reset values for next row
IF idata-row NE gd_currentrow.
APPEND f. CLEAR f.
gd_currentrow = idata-row.
ENDIF.
CASE idata-col.
WHEN '0001'.
f-belnr = idata-value.
ENDCASE.
ENDLOOP.
APPEND f. CLEAR f. -
Change Value While Uploading data From Excel File
Dear Expert,
Please guide me is it Possible?, if yes then How?
We have one BDC Uploader there After uploading data from Excel File, i want to check one field like this....
if it_f65data-newbs contains any Alphabet.
then user Should be able to change value on the same time while executing Program in table.
Please tell me how i can change value in running program
Regards'
Shelly MalikHi,
What you can probably do is, perform a consistency check on your data in the internal table and segregate all those rows that have inconsistent data (in your case, the field NEWBS containing albhabets) into another temporary internal table. Display the temporary internal table in an editable ALV grid saying that these data have not been inserted to the database, coz they have inconsistent data in the field NEWBS. Allow the user to edit and then save the data which will consequently refresh the internal table contents. -
Upload data from excel file to mii without UDS and PCo
Hi Experts,
I am trying to upload data from excel file to mii db without using UDS and PCo. Is there any other ways that we can achieve it.
I am thinking one solution , writing stored procedure. any other solutions?
Thanks in advance,
Eswar.Hi,
Thanks for reply.
I tried to create OLEDB data server which will point to my excel file in D drive.Its created successfully and i tried to query the datasource using sql query, I am not getting any modes in sql query template.
can u provide some steps..how to access this file.
Thanks, Eswar -
Loading data from .csv file into Oracle Table
Hi,
I have a requirement where I need to populate data from .csv file into oracle table.
Is there any mechanism so that i can follow the same?
Any help will be fruitful.
Thanks and regardsYou can use Sql Loader or External tables for your requirement
Missed Karthick's post ...alredy there :)
Edited by: Rajneesh Kumar on Dec 4, 2008 10:54 AM -
How to load the data from .csv file to oracle table???
Hi,
I am using oracle 10g , plsql developer. Can anyone help me in how to load the data from .csv file to oracle table. The table is already created with the required columns. The .csv file is having about 10lakh records. Is it possible to load 10lakh records. can any one please tell me how to proceed.
Thanks in advance981145 wrote:
Can you tell more about sql * loader??? how to know that utility is available for me or not??? I am using oracle 10g database and plsql developer???SQL*Loader is part of the Oracle client. If you have a developer installation you should normally have it on your client.
the command is
sqlldrType it and see if you have it installed.
Have a look also at the FAQ link posted by Marwin.
There are plenty of examples also on the web.
Regards.
Al -
How to transfer data from excel files into z-tables
Please help me with a code which transfers data from excel file to z-table.
Thanks in advance
ShuvirHi Daniel,
Export Data
Purpose
Use this procedure to export SAP data to a local file such as Microsoft Excel.
Menu Path
Use the following menu path to begin this process:
· SystemèListèSaveèLocal File
Helpful Hints
When reviewing fields, R = Required, O = Optional and C = Conditional.
Procedure
1. Start the transaction using the menu path or transaction code.
Whatever Data You Want to Export
2. Select SystemèListèSaveèLocal File. This works well for any data in SAP. This is the only option for the top-level (first page) of a report.
In a drill-down view within a report the Local File button on the toolbar may be used and has the same options.
Choose File Format
3. Click .
4. Click to continue. If prompted for a format after choosing Spreadsheet, select Excel Table to get an Excel file that can be modified more easily.
Choose File Save Location Step 1
5. Click to the right of the Directory field to choose a different location.
Choose File Save Location Step 2
6. Click or browse your computer to locate the directory where you want to save your file.
7. Complete the following field:
· File name:
You must add the proper file extension to the name of your file (.xls for Excel, .rtf for Rich Text, .html for HTML). The file extension tells your computer what program to open the file with. If you do not have the file extension at the end, you may not be able to open it.
8. Click to continue.
Generate File in Location and Format Selected
9. Click to create the file in the location and format selected. In this example the file was named "example.xls" and saved on the desktop.
Result
You have completed the export process.
thanks
karthik -
How to load the data from excel file into temprory table in Forms 11g?
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinDeclare
v_full_filename varchar2(500);
v_server_path varchar2(2000);
v_separator VARCHAR2(1);
v_filename VARCHAR2(400);
filename VARCHAR2 (100);
v_stop_load varchar2 (2000);
v_rec_error_log varchar2(4000);
v_error_log varchar2(4000);
ctr NUMBER (12);
cols NUMBER (2);
btn number;
RES BOOLEAN;
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheets ole2.obj_type;
worksheet ole2.obj_type;
cell ole2.obj_type;
cellType ole2.OBJ_TYPE;
args ole2.obj_type;
PROCEDURE olearg
IS
args ole2.obj_type;
BEGIN
args := ole2.create_arglist;
ole2.add_arg (args, ctr);
ole2.add_arg (args, cols);
cell := ole2.get_obj_property (worksheet, 'Cells', args);
ole2.destroy_arglist (args);
END;
BEGIN
v_full_filename := client_get_file_name(directory_name => null
,file_name => null
,file_filter => 'Excel files (*.xls)|*.xls|'
||'Excel files (*.xlsx)|*.xlsx|'
,message => 'Choose Excel file'
,dialog_type => null
,select_file => null
If v_full_filename is not null Then
v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
v_filename := v_separator||v_full_filename ;
:LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);
RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));
--Begin load data from EXCEL
BEGIN
filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
application := ole2.create_obj ('Excel.Application');
ole2.set_property (application, 'Visible', 'false');
workbooks := ole2.get_obj_property (application, 'Workbooks');
args := ole2.create_arglist;
ole2.add_arg (args, filename); -- file path and name
workbook := ole2.get_obj_property(workbooks,'Open',args);
ole2.destroy_arglist (args);
args := ole2.create_arglist;
ole2.add_arg (args, 'Sheet1');
worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
ole2.destroy_arglist (args);
ctr := 2; --row number
cols := 1; -- column number
go_block('xxx');
FIRST_RECORD;
LOOP
--Column 1 VALUE --------------------------------------------------------------------
olearg;
v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
:item1 := v_stop_load;
cols := cols + 1;
--Column 2 VALUE --------------------------------------------------------------------
olearg;
:item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
cols := cols + 1;
--<and so on>
ole2.invoke (application, 'Quit');
ole2.RELEASE_OBJ (cell);
ole2.RELEASE_OBJ (worksheet);
ole2.RELEASE_OBJ (worksheets);
ole2.RELEASE_OBJ (workbook);
ole2.RELEASE_OBJ (workbooks);
ole2.RELEASE_OBJ (application);
END;
--End load data from EXCELPlease mark it as answered if you helped. -
UPLOADING DATA FROM EXCEL FILE.
Hi All,
i have to upload the data from excel file to an internal table.I am using FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' for that. But the problem is it taking upto 50 characters only from each cell of excel sheet. in each cell i have more than 100 characters.
How to read these type of data?..
Plz help me in this regard.
thank you in advance!!!!
Regards,
RaviHi,
Check my previous post for the same question for referance
Re: Excel to itab
Guess this will help you.
Regards,
Ram. -
Upload data from excel file -URGENT
Hi All,
Advanced thanks to ur reply
How to upload data from excel sheet to itab
what are the functional modules we are using for that
Please help me
i look forward to ur reply
Regards
Raja Sekhar.THi,
TYPE-POOLS: truxs.
DATA: i_text_data TYPE truxs_t_text_data,
v_filename_string TYPE string.
DATA: BEGIN OF itab OCCURS 0,
Name(30),
Phone(15),
Fax(500).
DATA: END OF itab.
PARAMETERS: p_file LIKE rlgrap-filename.
START-OF-SELECTION.
v_filename_string = p_file.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = v_filename_string
filetype = 'ASC'
has_field_separator = 'X'
HEADER_LENGTH = 0
READ_BY_LINE = 'X'
dat_mode = ''
IMPORTING
FILELENGTH =
HEADER =
TABLES
data_tab = i_text_data
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.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
I_LINE_HEADER =
i_tab_raw_data = i_text_data
i_filename = p_file
TABLES
i_tab_converted_data = itab
EXCEPTIONS
conversion_failed = 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.
I think this code will help u.
With Regards,
Ranganathan -
Uploading data from excel file to a dynamically created internal table
Hi,
I have a requirement where i have to upload data from an excel file into a database table. I would be able to determine the structure of the table only at runtime based on the user input.. so i have created an internal table dynamically.
Could you please tell me if its possible to upload data from an excel file to the dynamically created internal table using any function modules?
I thought of doing this by declaring a generic internal table of one field and then uploading the *.csv file into it and then splitting it based on "," and then assigning it to the field symbol referencing the internal table.. but my file length exceeds 132 characters and i'm only able to get data of lenght 132 char's in my internal table ( generic one).
Could anyone please show me a way around this.
Thanks in advance,
HarshaSure, check this out.
report zrich_0002.
type-pools: slis.
field-symbols: <dyn_table> type standard table,
<dyn_wa>,
<dyn_field>.
data: it_fldcat type lvc_t_fcat,
wa_it_fldcat type lvc_s_fcat.
type-pools : abap.
data: new_table type ref to data,
new_line type ref to data.
data: iflat type table of string.
data: xflat type string.
data: irec type table of string with header line.
data: tabix type sy-tabix.
data: file type string.
selection-screen begin of block b1 with frame title text .
parameters: p_file type rlgrap-filename default 'c:Test.csv'.
parameters: p_flds type i.
selection-screen end of block b1.
start-of-selection.
* Add X number of fields to the dynamic itab cataelog
do p_flds times.
clear wa_it_fldcat.
wa_it_fldcat-fieldname = sy-index.
wa_it_fldcat-datatype = 'C'.
wa_it_fldcat-inttype = 'C'.
wa_it_fldcat-intlen = 10.
append wa_it_fldcat to it_fldcat .
enddo.
* Create dynamic internal table and assign to FS
call method cl_alv_table_create=>create_dynamic_table
exporting
it_fieldcatalog = it_fldcat
importing
ep_table = new_table.
assign new_table->* to <dyn_table>.
* Create dynamic work area and assign to FS
create data new_line like line of <dyn_table>.
assign new_line->* to <dyn_wa>.
file = p_file.
call method cl_gui_frontend_services=>gui_upload
exporting
filename = file
changing
data_tab = iflat
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.
loop at iflat into xflat.
clear irec. refresh irec.
split xflat at ',' into table irec.
loop at irec.
tabix = sy-tabix.
assign component tabix of structure <dyn_wa> to <dyn_field>.
<dyn_field> = irec.
endloop.
append <dyn_wa> to <dyn_table>.
endloop.
* Write out data from table.
loop at <dyn_table> into <dyn_wa>.
do.
assign component sy-index of structure <dyn_wa> to <dyn_field>.
if sy-subrc <> 0.
exit.
endif.
if sy-index = 1.
write:/ <dyn_field>.
else.
write: <dyn_field>.
endif.
enddo.
endloop.
Regards,
Rich Heilman -
Regarding uploading data from excel sheet to internal table
hi,
while executing the code im getting the output one by one but i want it to be displayed in a table format can any one help me regarding this issue.
thanks and regards,
siriHi Sirisha,
Through this FM we can't get the data in tabular format. After getting data from this FM we have to convert to tabular format. As far as i know there is no FM for Excel upload which directly gives data in tabular format.
Check below sample code which uploads 3 columns from excel file.
U can add as many case statements as the number of fields.
PARAMETERS: po_file TYPE rlgrap-filename DEFAULT 'E:test.xls'.
TYPES: BEGIN OF t_final,
empno(10) TYPE c,
name(30) TYPE c,
state(25) TYPE c,
END OF t_final.
DATA: i_tab TYPE STANDARD TABLE OF alsmex_tabline,
i_final TYPE STANDARD TABLE OF t_final,
wa_tab TYPE alsmex_tabline,
wa_final TYPE t_final.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR po_file.
PERFORM open_folder.
START-OF-SELECTION.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = po_file
i_begin_col = 1
i_begin_row = 1
i_end_col = 3
i_end_row = 65256
TABLES
intern = i_tab
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
CHECK NOT i_tab[] IS INITIAL.
LOOP AT i_tab INTO wa_tab.
CASE wa_tab-col.
WHEN 1.
wa_final-empno = wa_tab-value.
WHEN 2.
wa_final-name = wa_tab-value.
WHEN 3.
wa_final-state = wa_tab-value.
ENDCASE.
AT END OF row.
APPEND wa_final TO i_final.
CLEAR wa_final.
ENDAT.
ENDLOOP.
FORM open_folder .
DATA: li_file TYPE TABLE OF sdokpath,
lwa_file TYPE sdokpath.
CLEAR: po_file, lwa_file.
REFRESH li_file[].
CALL FUNCTION 'TMP_GUI_FILE_OPEN_DIALOG'
TABLES
file_table = li_file
EXCEPTIONS
cntl_error = 1
OTHERS = 2.
IF sy-subrc IS INITIAL.
READ TABLE li_file INTO lwa_file INDEX 1.
IF sy-subrc IS INITIAL.
po_file = lwa_file-pathname.
ENDIF.
ENDIF.
ENDFORM. " open_folder
Just try executing above code in debug mode. U will understand the functionality.
Thanks,
Vinod. -
Upload data from excel file to "Fast Data Entry" in FB60
Hi,
I have a requirement from users, they want to load data of G/L accounts items in FB60 using "Fast Data Entry" from an excel file.
I did some research and found out that the framework to transfer clipboard data into an SAP table(http://www.synactive.com/examples/example0016.html) seems to be the suitable solution.
However, I still cannot make it work.
Do you have any suggestion for my case ? How can I load data from an excel file to the transaction FB60?
Thanks in advance,
HungDear Hung,
You can upload data through LSMW (Batch Input).
But you need to convert your excel sheet into CSV format or txt format.
Please take help of your ABAP team if required.
This will accommodate your requirement.
Regards
Saurabh -
I want to upload data from excel to R.12 tables
Dear All,
We have implemented R.12 we have already migrate data from legacy to EBS but during go live period many transaction cannot be record.
I have data in excel I want to upload. What is the best & save way please let me know.
Regards,
Muhammad Faraz
EBS Coordinator I.C.THi Muhammad,
The easiest way to upload data into a table from excel is to use Import Data feature of SQLDeveloper.
What you need to do is :
Right-Click on the table name in the Navigator.
Select Import Data
Choose the excel file you want to load the data from.
Map the columns of the xls file to the columns in the table
Upload.
Thanks
Pushkar. -
Sending data from flat file or oracle table view to a IBM MQ
Hi,
We need a help in developing solution.
We have a scenario, where data(multiple records) in source (table/file) needs to populated into a queue(JMS IBM MQ) as a single message. To achieve this we are trying a two step process.
1) We created a temp table to store multiple records from file, this temp table is having one column of *‘clob’* data-type which will store data from file into a single row. We are facing issue while loading data from file to staging area using LKM FILE TO ORACLE (SQLLDR)
When we are executing interface, while creating C$ table it is going error out . Instead of taking clob (target write data type) it is taking varchar with +5000+ size whereas varchar supports only *4000*.
create table SNPM.C$_0SINGLERECORD
C1_C1 VARCHAR2(5000) NULL
NOLOGGING
Error message:
910 : 42000 : java.sql.SQLException: ORA-00910: specified length too long for its datatype
java.sql.SQLException: ORA-00910: specified length too long for its datatype
Need help in sending data into destination table.
2) After populating this data into destination(temp table) as a single record we need to send each row as a single message to JMS MQ. currently we are using LKM FILE to SQL to load into Staging area and IKM SQL TO JMS APPEND to put message in JMS MQ. We are succeeding in putting message of length < 4000 as these KMs are converting the data using varchar2, but we have data of large size+(>4K)+.
Pointer/ solution will be of great help.
Please let me know in case you need more description.The error message that is showing while using clob as datatype(which we created as user data type in data types section of respective technology)
java.lang.NumberFormatException: For input string: "4294967295"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
while using varchar2 in creating C$ table following is the error:
910 : 42000 : java.sql.SQLException: ORA-00910: specified length too long for its datatype
java.sql.SQLException: ORA-00910: specified length too long for its datatype
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
Maybe you are looking for
-
Error while runnin oaf page from local machine using jdeveloper
this is the error stack... Error Page Exception Details. oracle.apps.fnd.framework.OAException: Application: FND, Message Name: SYSTEM-ERROR. Tokens: MESSAGE = Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153093632)(ERR=12505)(ERROR_STA
-
How to display all reversal document ?
Dear all, When reversal document with negative posting, the balance is return 0. So, how can i display all the reversal documents for reporting ? Thank you very much, Sylvecast.
-
I have encountered a number of incidents where it appears that Macs are causing wireless routers to fail catastrophically. We had a DLink wireless router in my office, and periodically it would stop serving out IP addresses to clients. The router wou
-
Running a main Method from another class??
Hi, I am trying to run a main method from another class, eg the main method is in Class1 and i am trying to run it from class2. So I have class1 c1 = new class1(); c1.main();and I get the following compilation error: clas2.java:42: main(java.lang.Str
-
How to rearrange the addressbook template?
I want to change the order of the fields in the Addressbook entries. When I go to the Template tab in the Addressbook Preferences and try to move them it doesn't work. The Addressbook Help files say to "Click field labels to change which fields appea