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
Shuvir
Hi 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
Similar Messages
-
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. -
How to import data from CSV file into a table by using oracle forms
Hi,
I have a CSV file and i want to insert in oracle database in a table by using a button in oracle forms.
the user can select CSV file by using open dialog .
can any one help me to find method to make import and select file from the client machine ?
thx.1. create table blob
CREATE TABLE IB_LOVE
DOC BLOB,
CONTRACT_NO VARCHAR2(20 BYTE) NOT NULL
)2. use the code below to insert:
INSERT INTO ordmgmt.ib_love
(contract_no, doc
VALUES (:control.contract_no_input, NULL
lb$result :=
webutil_file_transfer.client_to_db (:b2.file_name, v_file_blob_name, v_col_blob_name,
'CONTRACT_NO = ' || :control.contract_no_input);
:SYSTEM.message_level := 25;
COMMIT;
:SYSTEM.message_level := 0;3. use the code below to download
if :control.CONTRACT_NO_INPUT is not null then
vboolean := webutil_file_transfer.DB_To_Client_With_Progress(
vfilename, --filename
'IB_LOVE', ---table of Blob item
'DOC', --Blob column name
'CONTRACT_NO = ' || :CONTROL.CONTRACT_NO_INPUT, ---where clause to retrieve the record
'Downloading from Database', --Progress Bar title
'Wait to Complete'); --Progress bar subtitle client_host('cmd /c start '||vfilename);
client_host('cmd /c start '||vfilename);
else
errmsg('Please choose contract no');
end if;4. use the code below to open file dialog
x:= WEBUTIL_FILE.FILE_OPEN_DIALOG ( 'c:\', '*.gif', '|*.gif|*.gif|', 'My Open Window' ) ;
:b2.FILE_NAME:=X; -
How to load the data from excel file into table in oracle using UTL_FI
How to load the data from excel file into table in oracle
and from table to excel file
using UTL_FILE package
Please give me some exampleThis is something i tried in oracle apex
http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
Regards,
CKLP -
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 -
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 can i read local excel file into internal table in webdynpro for abap a
Could someone tell me how How can i read local excel file into an internal table in webdynpro for abap application.
thank u for your replyDeep,
File manuplations...............................
1. At the presentation level:
->GUI_UPLOAD
->GUI_DOWNLOAD
->CL_GUI_FRONTEND
2. At the application server level:
->OPEN DATASET : open a file in the application server for reading or writing.
->READ DATASET : used to read from a file on the application server that has been opened for reading
-> TRANSFER DATASET : writing data to a file.
-> CLOSE DATASET : closes the file
-> DELETE DATASET : delete file
If file is on the local PC,use the function module GUI_UPLOAD to upload it into an internal table by passing the given parameters......
call function 'GUI_UPLOAD'
exporting
filename = p_file
filetype = 'ASC'
has_field_separator = '#'
tables
data_tab = t_data
p_file : excel file path.
t_data : internal table
<b>reward points if useful.</b>
regards,
Vinod Samuel. -
Loading data from .csv file into existing table
Hi,
I have taken a look at several threads which talk about loading data from .csv file into existing /new table. Also checked out Vikas's application regarding the same. I am trying to explain my requirement with an example.
I have a .csv file and I want the data to be loaded into an existing table. The timesheet table columns are -
timesheet_entry_id,time_worked,timesheet_date,project_key .
The csv columns are :
project,utilization,project_key,timesheet_category,employee,timesheet_date , hours_worked etc.
What I needed to know is that before the csv data is loaded into the timesheet table is there any way of validating the project key ( which is the primary key of the projects table) with the projects table . I need to perform similar validations with other columns like customer_id from customers table. Basically the loading should be done after validating if the data exists in the parent table. Has anyone done this kind of loading through the APEX utility-data load.Or is there another method of accomplishing the same.
Does Vikas's application do what the utility does ( i am assuming that the code being from 2005 the utility was not incorporated in APEX at that time). Any helpful advise is greatly appreciated.
Thanks,
AnjaliHi Anjali,
Take a look at these threads which might outline different ways to do it -
File Browse, File Upload
Loading CSV file using external table
Loading a CSV file into a table
you can create hidden items in the page to validate previous records before insert data.
Hope this helps,
M Tajuddin
http://tajuddin.whitepagesbd.com -
How to Read data From Excel File in Labview 8.5?
We can read it from xls file, but it is encrypted..... we need exact data...
i have attached that excel file...i want to extract the full data from that file..how i can read it...when i read by using "Read from spreadsheet file" function, data was in encrypted form....so please send me the correct way...
Attachments:
stn_auto.xls 40 KB -
Upload data from flat file into internal table
Hi friends,
I want to upload the data from a flat file into internal table , but the problem is that all the columns in that flat file are seperated by "|" character instead of tabs.
Plz help me out.........HEllo,
DO like this.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
FILENAME = LV_FILENAME
FILETYPE = 'ASC'
HAS_FIELD_SEPARATOR = 'X' " Check here
* HEADER_LENGTH = '1'
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
* IMPORTING
* FILELENGTH =
* HEADER =
TABLES
DATA_TAB = IT_COJRNL
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.
VAsanth -
How to extract data from text file to database table
Hi ,
I am trying to upload data in text file to database table using GUI_UPLOAD function .what would be the program for that.
thanks in advance.Hi,
I don't think you have a standard sap program to upload data from file to database table...
Instead you can create a custom program like this..
DATA: T_FILEDATA(1000) OCCURS 0 WITH HEADER LINE.
DATA: T_ZTABLE LIKE ZTABLE OCCURS 0 WITH HEADER LINE.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'C:\TEST.TXT'
tables
data_tab = T_FILEDATA
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.
LOOP AT T_FILEDATA.
T_ZTABLE = T_FILEDATA.
APPEND T_ZTABLE.
ENDLOOP.
MODIFY ZTABLE FROM TABLE T_ZTABLE.
COMMIT WORK..
Thanks,
Naren -
Hello,
Can somebody suggest me how to read from an excel file (consisting of 10 work sheets) to an array?
Thanks,
SheYou have to be careful when using the spreadsheet-files vi's. They are located in the Functions Palette under File IO, you will find "Write To / Read From Spreadsheet File.vi"s.
Here is what the Context Help says about the vi function:
"Reads a specified number of lines or rows from a numeric text file beginning at a specified character offset and converts the data to a 2D, single-precision array of numbers. You optionally can transpose the array. The VI opens the file before reading from it and closes it afterwards. You can use this VI to read a spreadsheet file saved in text format. This VI calls the Spreadsheet String to Array function to convert the data. "
This is quick & easy when the spreadsheet is all the same format. You can set the format to string as well. HOWEVER... you do have to convert the Excel spreadsheet to text before using it.
I haven't experimented with the Active-X, but it may look as the way to go if you have combination text / numeric values in the spreadsheet.
If you did convert it to text, then you can use array functions as well and treating the file as an array of strings (see very brief example attached). The example is to illustrate a point only
JLV
Attachments:
starting point for spreadsheet.vi 28 KB -
How to retrieve data from xml file into obiee reports
Hi all,
I've got a situation here. A xml file is stored as blob in oracle database table. Now i need to retrieve data/info from that xml file into obiee reports. How am i supposed to proceed with this ?I will go for a table function:
http://gerardnico.com/wiki/database/oracle/table_function
In two words, you can create a function that behave as a table. Then you create a function to pick up your xml, you parse it and you send back the rows.
I know that Oracle has also a library for XML files but I never use it until now.
Success
Nico -
How to read data from excel file in windows azure cloud service?
I have a web application in visual studio 2010 and windows azure sdk.It asks the user to upload an excel file and then read its data
to the database.When i ran the application on localhost it ran perfectly but when I run it using windows azure sdk emulator (using my application as a web role) it gives the error "The Microsoft.ACE.OLEDB.12.0' provider is not registered on the local
machine".How to resolve this other than using OpenXml?You can access office documents only if office COM objects (means office) is installed on the machine.
One option is using of Open.XML (why don't you want to use it?) and another option is to use Office365. However the later one would probably change the whole architecture of you application.
One workaround might be to save Excel file as HTML and read it as HTML. This will not give you all of Open.XML and COM power, but you can very easy access and change data.
Damir Dobric
developers.de
daenet.de
daenet.eu
daenet.com -
How to insert data from APEX form into two tables
Hi,
I'm running APEX 4.1 with Oracle XE 11g, having two tables CERTIFICATES and USER_FILES. Some of the (useless) fields are cut to reduce information:
CREATE TABLE CERTIFICATES
CERT_ID NUMBER NOT NULL ,
CERT_OWNER NUMBER NOT NULL ,
CERT_VENDOR NUMBER NOT NULL ,
CERT_NAME VARCHAR2 (128) ,
CERT_FILE NUMBER NOT NULL ,
) TABLESPACE CP_DATA
LOGGING;
ALTER TABLE CERTIFICATES
ADD CONSTRAINT CERTIFICATES_PK PRIMARY KEY ( CERT_ID ) ;
CREATE TABLE USER_FILES
FILE_ID NUMBER NOT NULL ,
FILENAME VARCHAR2 (128) ,
BLOB_CONTENT BLOB ,
MIMETYPE VARCHAR2 (32) ,
LAST_UPDATE_DATE DATE
) TABLESPACE CP_FILES
LOGGING
LOB ( BLOB_CONTENT ) STORE AS SECUREFILE
TABLESPACE CP_FILES
STORAGE (
PCTINCREASE 0
MINEXTENTS 1
MAXEXTENTS UNLIMITED
FREELISTS 1
BUFFER_POOL DEFAULT
RETENTION
ENABLE STORAGE IN ROW
NOCACHE
ALTER TABLE USER_FILES
ADD CONSTRAINT CERT_FILES_PK PRIMARY KEY ( FILE_ID ) ;
ALTER TABLE CERTIFICATES
ADD CONSTRAINT CERTIFICATES_USER_FILES_FK FOREIGN KEY
CERT_FILE
REFERENCES USER_FILES
FILE_ID
NOT DEFERRABLE
What I'm trying to do is to allow users to fill out all the certificate data and upload a file in an APEX form. Once submitted the file should be uploaded in the USER_FILES table and all the fields along with CERT_ID, which is the foreign key pointing to the file in the USER_FILES table to be populated to the CERTIFICATES table. APEX wizard forms are based on one table and I'm unable to build form on both tables.
That's why I've created a view (V_CERT_FILES) on both tables and using INSTEAD OF trigger to insert/update both tables. I've done this before and updating this kind of views works perfect. Here is where the problem comes, if I'm updating the view all the data is updated correctly, but if I'm inserting into the view all the fields are populated at CERTIFICATES table, but for USER_FILES only the fields FILE_ID and LAST_UPDATE_DATE are populated. The rest three regarding the LOB are missing: BLOB_CONTENT, FILENAME, MIMETYPE. There are no errors when running this from APEX, but If I try to insert into the view from SQLDeveloper, I got this error:
ORA-22816: unsupported feature with RETURNING clause
ORA-06512: at line 1
As far as I know RETURNING clause in not supported in INSTEAD of triggers, although I didn't have any RETURNING clauses in my trigger (body is below).
Now the interesting stuff, after long tracing I found why this is happening:
First, insert is executed and the BLOB along with all its properties are uploaded to wwv_flow_file_objects$.
Then the following insert is executed to populate all the fields except the BLOB and it's properties, rowid is RETURNED, but as we know RETURNING clause is not supported in INSTEAD OF triggers, that's why I got error:
PARSE ERROR #1918608720:len=266 dep=3 uid=48 oct=2 lid=48 tim=1324569863593494 err=22816
INSERT INTO "SVE". "V_CERT_FILES" ( "CERT_ID", "CERT_OWNER", "CERT_VENDOR", "CERT_NAME", "BLOB_CONTENT") VALUES (:B1 ,:B2 ,:B3 ,:B4, ,EMPTY_BLOB()) RETURNING ROWID INTO :O0
CLOSE #1918608720:c=0,e=11,dep=3,type=0,tim=1324569863593909
EXEC #1820672032:c=3000,e=3168,p=0,cr=2,cu=4,mis=0,r=0,dep=2,og=1,plh=0,tim=1324569863593969
ERROR #43:err=22816 tim=1324569863593993
CLOSE #1820672032:c=0,e=43,dep=2,type=1,tim=1324569863594167
Next my trigger gets in action, sequences are generated, CERTIFICATES table is populated and then USER_FILES, but only the FILE_ID and LAST_UPDATE_DATE.
Finally update is fired against my view (V_CERT_FILES), reading data from wwv_flow_files it populates BLOB_CONTENT, MIMETYPE and FILENAME fields at the specific rowid in V_CERT_FILES, the one returned from the insert at the beginning. Last, file is deleted from wwv_flow_files.
I'm using sequences for the primary keys, this is only the body of the INSTEAD OF trigger:
select user_files_seq.nextval into l_file_id from dual;
select certificates_seq.nextval into l_cert_id from dual;
insert into user_files (file_id, filename, blob_content, mimetype, last_update_date) values (l_file_id, :n.filename, :n.blob_content, :n.mimetype, sysdate);
insert into certificates (cert_id, cert_owner, cert_vendor, cert_name, cert_file) values (l_cert_id, :n.cert_owner, :n.cert_vendor, :n.cert_name, l_file_id);
I'm surprised that I wasn't able to find a valuable source of information regarding this problem, only MOS note about running SQLoader against view with CLOB column and INSTEAD OF trigger. The solution would be to ran it against base table, MOS ID 795956.1.
Maybe I'm missing something and that's why I decided to share my problem here. So my question is how do you create this kind of architecture, insert into two tables with a relation between them in APEX ? I read a lot in the Internet, some advices were for creating custom form with APEX API, create a custom ARP, create two ARP or create a PL/SQL procedure for handing the DML?
Thanks in advance.
Regards,
SveThank you however I was wondering if there was an example available which uses EJB and persistence.
Maybe you are looking for
-
Post Author: LeedsLass CA Forum: Desktop Intelligence Reporting I've built two prompts in a report which use the Pattern Match option. However in order to fetch all results you have to leave a '%' in the prompt field which generates the sql LIKE '%'
-
I have an iPhone 5 and it won't turn on, shows low battery but won't charge.
I have an iPhone 5, 16GB. Have had it for 22 months. All of a sudden it will not take a charge at all. Have tried to plug into iTunes. It does not show up. It also does nothing when I try to do a hard reset. This is what happens now.... I do not
-
Programmatically creating Hierarchy Viewer
Hi All, Please advise on creating heriarchy viewer programmatically instead of the creating a databound based viewer. Best Regards, Ankit Gupta
-
Hi this thread i made earlier http://discussions.apple.com/thread.jspa?threadID=1662966&tstart=0 is now archived and i wanted to comment on it so i made this one 2. I think i may have a few years ago added a disk label and put in a dvd to burn it. is
-
Embed application within another
Hi there, I have an APEX application which uses tabs, on one of the tabs i would like to use a report from another application, is it possible to link to this report somehow or do I have to recreate the report? I am using APEX 4.0, thanks...