How to retrieve data from an Excel file which is located on server
hi everybody,
I am using SAP NWDS 2004s .
I have done an application on how to export the table data into an Excel .
Now i want to get the data from an Excel file which is located in server and display that data which is in excel in a View for example a Sample view in Webdynpro .
In Sample view i took a uielement textview to display the data ....
can any one help how to procced further
Thanks in advance
Madhavi
Options to read Excel data to WebDynpro context
Reading Excel Sheet from Java without using any Framework
Reading Multiple Sheets of Excel Sheet from Java
Few Threads
How to Display the content of Excel file into Webdynpro Table
Is it possible to upload data from excel file(.xls)
Re: How to export the data as integer into excel sheet?
regards
Vinod
Similar Messages
-
How to load data from a flat file which is there in the application server
HI All,
how to load data from a flat file which is there in the application server..Hi,
Firstly you will need to place the file(s) in the AL11 path. Then in your infopackage in "Extraction" tab you need to select "Application Server" option. Then you need to specify the path as well as the exact file you want to load by using the browsing button.
If your file name keeps changing on a daily basis i.e. name_ddmmyyyy.csv, then in the Extraction tab you have the option to write an ABAP routine that generates the file name. Here you will need to append sy-datum to "name" and then append ".csv" to generate complete filename.
Please let me know if this is helpful or if you need any more inputs.
Thanks & Regards,
Nishant Tatkar. -
Help! How to read data from an Excel file?
Hi,
I need to read data from an Excel file that may contain more then one table in a sheet. How can I read them?
I would be eternally grateful to anyone who can give me any information.Did you try POI from Apache?
http://jakarta.apache.org/poi/index.html -
How to read data from the excel file using java code.
Hi to all,
I am using below code to getting the data from the excel file but I can't get the corresponding data from the specific file. can anyone give me the correct code to do that... I will waiting for your usefull reply......
advance thanks....
import java.io.*;
import java.sql.*;
public class sample{
public static void main(String[] args){
Connection connection = null;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection( "jdbc:odbc:Mydsn","","" );
Statement st = con.createStatement();
ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );
System.out.println("sample:"+rs);
ResultSetMetaData rsmd = rs.getMetaData();
System.out.println("samplersd:"+rsmd);
int numberOfColumns = rsmd.getColumnCount();
System.out.println("numberOfColumns:"+numberOfColumns);
while (rs.next()) {
System.out.println("sample1:"+rs);
for (int i = 1; i <= numberOfColumns; i++) {
if (i > 1) System.out.print(", ");
String columnValue = rs.getString(i);
System.out.print(columnValue);
System.out.println("");
st.close();
con.close();
} catch(Exception ex) {
System.err.print("Exception: ");
System.err.println(ex.getMessage());
}1: What is the name of the excel sheet?
2: What is printed in this program? null ? anything?
error?Excel file name is "sample.xls" I set excel file connectivity in my JDBC driver(DSN). Here in my program I am not giving that excel file name. I am giving only that excel sheet name. that is followed
ResultSet rs = st.executeQuery( "Select * from [Sheet1$]" );The output of this program is given bellow.
sample:sun.jdbc.odbc.JdbcOdbcResultSet@1b67f74
samplersd:sun.jdbc.odbc.JdbcOdbcResultSetMetaData@530daa
numberOfColumns:2 -
How to read data from many excel files
I'm aquiring data continusly from several sensors, and every days file name are changed. Data are saved on xls files.
Now, I'd like to read every data from this files and put them in a waveform. How can I concatenate all files and read the values?You probably do not want to use a traditional waveform. LabVIEW has a Waveform Chart which inputs one point at a time. Waveform Graph inputs an array.
I suspect that the data is stored in an array. You need to read the arrays in and build them into larger arrays. If your right click on the build array vi, you can select concantenate which will append one array to the end of the other. When you have built your giant array, just feed it to a waveform graph.
If you need to see some example code, go to the advanced search page. It is at www.ni.com >> support >> advanced search (it is at the botton--click on the words). Enter excel read in the all the words field and search just the example programs. There were for hits.
Jeremy Braden
National Ins
truments -
How to load data from MS Excel file
Hello All,
Please help me regarding:
how to load data/ insert records from MS Excel spreadsheet into Oracle table without converting that MS Excel file into CSV.
Thank You in advance.Vivek More wrote:
how to load data/ insert records from MS Excel spreadsheet into Oracle table without converting that MS Excel file into CSV.Setup HS connectivity:
1. Create ODBC SYSTEM DSN using Microsift Excel driver(xls) and select your excel file as workbook.
2. Create file initXLS.ora in %ORACLE_HOME%\hs\admin directory contailing the following line:
HS_FDS_CONNECT_INFO = XLS3. Modify listener.ora file in %ORACLE_HOME%\network\admin directory and add the following lines to SID_LIST under SID_LIST_LISTENER
(SID_DESC =
(SID_NAME = XLS)
(ORACLE_HOME = your-oracle-home)
(PROGRAM = hsodbc)
)4. Modify tnsnames.ora file in %ORACLE_HOME%\network\admin directory and add the following lines:
XLS =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
(CONNECT_DATA =
(SID = XLS)
(HS=OK)
)5. Restart listener.
6. Create database link (public or private depending on your needs):
CREATE PUBLIC DATABASE LINK XLS USING 'XLS';7. Now you are all set. For example my file has:
NAME
SAM
JOEDefault sheet name "Sheet1$" is treated as table name (Since excel is case sensitive you need to use quoted name). First row is treated as column name. And select:
SQL> select * from "Sheet1$"@xls;
NAME
SAM
JOE
SQL> Now if you do not know excel sheet names you can issue (I renamed excel sheet Sheet1$ to Names$):
SQL> select table_name from all_tables@xls;
TABLE_NAME
Names$
Sheet2$
Sheet3$
SQL> select column_name from all_tab_columns@xls where table_name = 'Names$';
COLUMN_NAME
NAME
SQL> SY. -
How to import data from a text file through DTS to Sql Server
Please don't mistake me as i'm a new comer to sql server,please help me.
how to import the data present in a plain text file through DTS into sql server and store the data in a temporary table.
How far the temporary table is stored in the database.
Please reply me as soon as possible.
Thank you viewers.>
I can say that anybody with
no experience could easily do an export/import in
MSSQLServer 2000.
Anybody with no experience should not mess up my Oracle Databases ! -
Loading data from an excel file to Oracle Tables
Hi Everyone,
Once again I will have to bring some data from some excel file, which I have already done and "know" how to do and I would like to confirm with you all something first.
What I shall do is the following:
From one excel workbook file which has a lot of info just in one spread sheet feed some tables with the data coming from it.
So what I have though is create mane name ranges (Define names on excel) as I need and work with them, but I will be facing with headers on the rows and columns. There is where I doubt if it will be possible. So far, I will not be able to modify the Excel’s file structure.
Something more or less like this:
Country1 Country 2
Sales1 9999999 9999999
Sales2 9999999 9999999
Sales3 9999999 9999999
Total123 9999999 9999999
Sales4 9999999 9999999
Sales5 9999999 9999999
Sales6 9999999 9999999
Total456 9999999 9999999
Best regards.
JaisonHi SH,
First of all, I do really appreciate your time, patience and guidance.
Ok, let me get this straight.
You will need to create a data server for each Excel Work book
That means that as I will just work with one excel sheet, I will just have one data server and within it, there will be the spread sheets (excel tabs) and therefore the different named ranges.
Each of your named ranges will be a data store beneath the data server which can be used as a source model in your ODI interfaces. Therefore if you have a single workbook with 12 sheets for the months, each covered by a single named range, you would have a single data server withe 12 data stores.
This means that I will have something like this:
+ “My_Workbook.xls” server name (Just one)
- Spread sheet 1 (1 or several named ranges)
- Spread sheet 2 (1 or several named ranges)
- Spread sheet 3 (1 or several named ranges)
- Spread sheet n (1 or several named ranges)
I do think that if my statement above is correct, I think I got the idea. Is it like that?
I have gotten another question; let’s say for example that in any spread sheet I will have three different named ranges. The difference between spread sheet and spread sheet will be the month within and of course the information. Would it be accurate to bring it like that? That means that so far for twelve month I will bring 36 named ranges.
Well I think I had explained myself. Please do not hesitate to contact me if any further detail is required.
Best regards.
J -
How to retrieve data from excel sheet
Hi,
How to retrieve data from excel sheet into a java file.janu05 wrote:
If we append a $ in the end of the table name it is showing an error saying "invalid name,should not contain any invalid character or punctuation"Great, I'm very happy for you.
Unless that was a question. In which case you might what to tell us a little more.
Like which API you are using (assuming we are still on "reading an Excel sheet". -
How to export the data from an excel file to Oracle database by using macro
Hi,
I want to export data from an excel file into Oracle database.There is one method that by creating the macros through excel we are able to do this.
can anybody please send me the code to create macros?
Thanks in advance.
Regards,
Surendra.VThere are several resources on the web, but you could start analyzing if this code fits your needs --> VBA Macro for Excel 2003 Export of Text File with Comma and Quote Delimiters.
~ Madrid -
I need how to load data from MS Excel(csv format) to NW Excel
Hi,
I am doing Migration project from SAP MS to NW Manually.
I need how to load data from MS excel (csv format) to NW excel .
For example 2008 budget data.
Could you please help me in this.
Thanks and Regards
KrishnaHi,
You need to create a transformation file and a conversion file if required. First upload the excel (csv) file into BPC using Manage Data and Upload File option.
Create the transformation file (refer to the sap help on how to define a transformation file). You need to specify the mapping correctly and include all your application dimensions and map them to appropriate columns of the flat file.
Before running the import package, do validate the data in the flat file you uploaded into BPC with the transformation file you created.
Thanks,
Sreeni -
Reading the data from excel file which is in application server.
Hi,
Iam trying to read the data from excel file which is in application server.
I tried using the function module ALSM_EXCEL_TO_INTERNAL_TABLE. But it didn't work.
I tried just reading using open data set and read data set it is giving junk characters.
Please suggest me if you have any solution.
Best Regards,
Brahma ReddyHi Narendra,
Please see the below code I have written
OPEN DATASET pa_sfile for INPUT in text mode ENCODING DEFAULT MESSAGE wf_mess.
CHECK sy-subrc = 0.
DO.
READ DATASET pa_sfile INTO wf_string.
IF sy-subrc <> 0.
EXIT.
else.
split wf_string at wl_# into wf_field1 wf_field2 wa_upload-field3
wa_upload-field4 wa_upload-field5 wa_upload-field6 wa_upload-field7 wa_upload-field8
wa_upload-field9 wa_upload-field10 wa_upload-field11 wa_upload-field12 wa_upload-field13
wa_upload-field14 wa_upload-field15 wa_upload-field16 wa_upload-field17 wa_upload-field18
wa_upload-field19 wa_upload-field20 wa_upload-field21 wa_upload-field22 wa_upload-field23
wa_upload-field24 wa_upload-field25 wa_upload-field26 wa_upload-field27 wa_upload-field28
wa_upload-field29 wa_upload-field30 wa_upload-field31 wa_upload-field32 wa_upload-field33
wa_upload-field34 wa_upload-field35 wa_upload-field36 .
wa_upload-field1 = wf_field1.
wa_upload-field2 = wf_field2.
append wa_upload to int_upload.
clear wa_upload.
ENDIF.
ENDDO.
CLOSE DATASET pa_sfile.
Please note Iam using ECC5.0 and it is not allowing me to declare wl_# as x as in your code.
Also if Iam using text mode I should use extension encoding etc.( Where as not in your case).
Please suggest me any other way.
Thanks for your help,
Brahma Reddy -
Reading data from an excel file
Hi,
I want to read data from the excel file and display it in
jsp page. Iam getting the following error:
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con =
DriverManager.getConnection("jdbc:odbc:mydsn","","");
Statement st = con.createStatement();
ResultSet rs = st.executeQuery("select * from [holidays$]");
Here i have created the dsn with the name "mydsn". I have the
following data in the mydsn.dsn file:
[ODBC]
DRIVER=Microsoft Excel Driver (*.xls)
UID=admin
UserCommitSync=Yes
Threads=3
SafeTransactions=0
ReadOnly=1
PageTimeout=5
MaxScanRows=8
MaxBufferSize=2048
FIL=excel 8.0
DriverId=790
DefaultDir=D:\WorkSpace\Projects\VINET\devl\webroot\jsp
DBQ=D:\WorkSpace\Projects\VINET\devl\webroot\jsp\list_of_holidays_2003.xls
thanks in advance
phani.You might want to look at the POI project (an open source Jakarta sub-project) that allows you to create/modify/read excel files via Java code. That might be more flexible and easier than what you're currently trying to do.
Cheers -
GUI_UPLOAD to read data from an Excel File
Hi Folks,
I'm using FM GUI_UPLOAD to read data from an Excel File. But all I see in the table returned is 1 row with garbage values (special chacaters). Excel Workbook has proper data in the sheet, but its not getting uploaded properly. Sy-subrc is 0.
What could be the reason?
Thanksuse FM : ALSM_EXCEL_TO_INTERNAL_TABLE
See the example program to get from XLS file to Internal table
REPORT ZLWMI151_UPLOAD no standard page heading
line-size 100 line-count 60.
*tables : zbatch_cross_ref.
data : begin of t_text occurs 0,
werks(4) type c,
cmatnr(15) type c,
srlno(12) type n,
matnr(7) type n,
charg(10) type n,
end of t_text.
data: begin of t_zbatch occurs 0,
werks like zbatch_cross_ref-werks,
cmatnr like zbatch_cross_ref-cmatnr,
srlno like zbatch_cross_ref-srlno,
matnr like zbatch_cross_ref-matnr,
charg like zbatch_cross_ref-charg,
end of t_zbatch.
data : g_repid like sy-repid,
g_line like sy-index,
g_line1 like sy-index,
$v_start_col type i value '1',
$v_start_row type i value '2',
$v_end_col type i value '256',
$v_end_row type i value '65536',
gd_currentrow type i.
data: itab like alsmex_tabline occurs 0 with header line.
data : t_final like zbatch_cross_ref occurs 0 with header line.
selection-screen : begin of block blk with frame title text.
parameters : p_file like rlgrap-filename obligatory.
selection-screen : end of block blk.
initialization.
g_repid = sy-repid.
at selection-screen on value-request for p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
PROGRAM_NAME = g_repid
IMPORTING
FILE_NAME = p_file.
start-of-selection.
Uploading the data into Internal Table
perform upload_data.
perform modify_table.
top-of-page.
CALL FUNCTION 'Z_HEADER'
EXPORTING
FLEX_TEXT1 =
FLEX_TEXT2 =
FLEX_TEXT3 =
*& Form upload_data
text
FORM upload_data.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = p_file
I_BEGIN_COL = $v_start_col
I_BEGIN_ROW = $v_start_row
I_END_COL = $v_end_col
I_END_ROW = $v_end_row
TABLES
INTERN = itab
EXCEPTIONS
INCONSISTENT_PARAMETERS = 1
UPLOAD_OLE = 2
OTHERS = 3.
IF SY-SUBRC <> 0.
write:/10 'File '.
ENDIF.
if sy-subrc eq 0.
read table itab index 1.
gd_currentrow = itab-row.
loop at itab.
if itab-row ne gd_currentrow.
append t_text.
clear t_text.
gd_currentrow = itab-row.
endif.
case itab-col.
when '0001'.
t_text-werks = itab-value.
when '0002'.
t_text-cmatnr = itab-value.
when '0003'.
t_text-srlno = itab-value.
when '0004'.
t_text-matnr = itab-value.
when '0005'.
t_text-charg = itab-value.
endcase.
endloop.
endif.
append t_text.
ENDFORM. " upload_data
*& Form modify_table
Modify the table ZBATCH_CROSS_REF
FORM modify_table.
loop at t_text.
t_final-werks = t_text-werks.
t_final-cmatnr = t_text-cmatnr.
t_final-srlno = t_text-srlno.
t_final-matnr = t_text-matnr.
t_final-charg = t_text-charg.
t_final-erdat = sy-datum.
t_final-erzet = sy-uzeit.
t_final-ernam = sy-uname.
t_final-rstat = 'U'.
append t_final.
clear t_final.
endloop.
delete t_final where werks = ''.
describe table t_final lines g_line.
sort t_final by werks cmatnr srlno.
Deleting the Duplicate Records
perform select_data.
describe table t_final lines g_line1.
modify zbatch_cross_ref from table t_final.
if sy-subrc ne 0.
write:/ 'Updation failed'.
else.
Skip 1.
Write:/12 'Updation has been Completed Sucessfully'.
skip 1.
Write:/12 'Records in file ',42 g_line .
write:/12 'Updated records in Table',42 g_line1.
endif.
delete from zbatch_cross_ref where werks = ''.
ENDFORM. " modify_table
*& Form select_data
Deleting the duplicate records
FORM select_data.
select werks
cmatnr
srlno from zbatch_cross_ref
into table t_zbatch for all entries in t_final
where werks = t_final-werks
and cmatnr = t_final-cmatnr
and srlno = t_final-srlno.
sort t_zbatch by werks cmatnr srlno.
loop at t_zbatch.
read table t_final with key werks = t_zbatch-werks
cmatnr = t_zbatch-cmatnr
srlno = t_zbatch-srlno.
if sy-subrc eq 0.
delete table t_final .
endif.
clear: t_zbatch,
t_final.
endloop.
ENDFORM. " select_data -
Step by Step details on how to load data from a flat file
hi can anyone explain how to load data from a flat file. Pls giv me step by step details. thnx
hi sonam.
it is very easy to load data from flat file. whn compared with other extrations methods...
here r the step to load transation data from a flat file.......
step:1 create a Flat File.
step:2 log on to sap bw (t.code : rsa1 or rsa13).
and observe the flat file source system icon. i.e pc icon.
step:3 create required info objects.
3.1: create infoarea
(infoObjects Under Modeling > infoObjects (root node)-> context menu -
> create infoarea).
3.2: create char /keyfig infoObject Catalog.(select infoArea ---.context menu --->create infoObject catalog).
3.3: create char.. infoObj and keyFig infoObjects accourding to ur requirement and activate them.
step:4 create infoSource for transaction data and create transfer structure and maintain communication structure...
4.1: first create a application component.(select InfoSources Under modeling-->infosources<root node>>context menu-->create applic...component)
4.2: create infoSource for transation data(select appl..comp--.context menu-->create infosource)
>select O flexible update and give info source name..
>continue..
4.4: *IMp* ASSIGN DATASOURCE..
(EXPAND APPLIC ..COMP..>EXPAND YOUR INFOSOURCE>CONTEXT MENU>ASSIGN DATASOURCE.)
>* DATASOURCE *
>O SOURCE SYSTEM: <BROWSE AND CHOOSE YOUR FLAT FILE SOURCE SYSTEM>.(EX:PC ICON).
>CONTINUE.
4.5: DEFINE DATASOURCE/TRANSFER STRUCTURE FOR IN FOSOURCE..
> SELECT TRANSFER STRUCTURE TAB.
>FILL THE INFOOBJECT FILLED WITH THE NECESSARY INFOOBJ IN THE ORDER OR SEQUENCE OF FLAT FILE STRUCTURE.
4.6: ASSIGN TRANSFER RULES.
---> NOW SELECT TRANSFER RULES TAB. AND SELECT PROPOSE TRANSFER RULES SPINDLE LIKE ICON.
(IF DATA TARGET IS ODS -
INCLUDE 0RECORDMODE IN COMMUNICATION STRUCTURE.)
--->ACTIVATE...
STEP:5 CREATE DATATARGET.(INFOCUBE/ODS OBJECT).
5.1: CREATE INFO CUBE.
-->SELECT YOUR INFOAREA>CONTEXT MENU>CREATE INFOCUBE.
5.2: CREATE INFOCUBE STRUCTURE.
---> FILL THE STRUCTURE PANE WILL REQUIRE INFOOBJECTS...(SELECT INFOSOURCE ICON>FIND UR INFOSOURCE >DOUBLE CLICK > SELECT "YES" FOR INFOOBJECT ASSIGNMENT ).
>MAINTAIN ATLEAST ON TIME CHAR.......(EX; 0CALDAY).
5.3:DEFINE AND ASSIGN DIMENSIONS FOR YOUR CHARACTERISTICS..
>ACTIVATE..
STEP:6 CREATE UPDATE RULES FOR INFOCUDE USING INFOSOURCE .
>SELECT UR INFOCUBE >CONTEXT MENU> CREATE UPDATE RULES.
> DATASOURCE
> O INFOSOURCE : _________(U R INFOSOURCE). AND PRESS ENTER KEY.......
>ACTIVATE.....UR UPDATE RULES....
>>>>SEE THE DATA FLOW <<<<<<<<----
STEP:7 SCHEDULE / LOAD DATA..
7.1 CREATE INFOPACKAGE.
--->SELECT INFOSOURCE UNDER MODELING> EXPAND UR APPLIC.. COMP..> EXPAND UR INFOSOURCE..> SELECT UR DATASOURCE ASSIGN MENT ICON....>CONTEXT MENU> CREAE INFOPACKAGE..
>GIVE INFOPACKAGE DISCREPTION............_________
>SELECT YOUR DATA SOURCE.-------> AND PRESS CONTINUE .....
>SELECT EXTERNAL DATA TAB...
> SELECT *CLIENT WORKSTATION oR APPLI SERVER >GIVE FILE NAME > FILE TYPE> DATA SAPARATER>
>SELECT PROCESSING TAB
> PSA AND THEN INTO DATATARGETS....
>DATATARGET TAB.
>O SELECT DATA TARGETS
[ ] UPDATE DATATARGET CHECK BOX.....
--->UPDATE TAB.
O FULL UPDATE...
>SCHEDULE TAB..
>SELECT O START DATA LOAD IMMEDIATELY...
AND SELECT "START" BUTTON........
>>>>>>>>>>
STEP:8 MONITOR DATA
> CHECK DATA IN PSA
CHECK DATA IN DATA TARGETS.....
>>>>>>>>>>> <<<<<<<<<----
I HOPE THIS LL HELP YOU.....
Maybe you are looking for
-
How do I disable Game Center in ios7?
Hi there. I know this question has recently been asked, but I can't seem to find a solution to our particular problem. My 8-year daughter wanted to play Early Bird HD on my iPad and when she started the game, the ios7 game center login screen appea
-
My audio files no longer sync to the in the 5d in camera audio. It did when I bought the program but no longer does I reinstalled and it still will not sync the files recorded on the H4N with the Canon 5D Mark II Camera. The program used to import
-
Hello, I will put this as simply as I can.. 1: I have is a recording from satellite which I put onto DVD. 2: I have then opened/added the disk within VisualHub and and chose the DV option. 3: Then I opened it within iMovie to edit it and then the fin
-
I started receiving java error 545 on my blackberry curve this morning. I can not start my phone or make a call. This very disappointing. Boost needs to produce better phones.
-
Re: Yoga 13 - patch that gives 100gb of free space
RE Lenovo offerred the patch that gives you at least 100gb of free space. I also ordered and installed an additional 128gb SSD and 8gb RAM.--- Where can I find this patch? Moderator Note; subject edited