Read data from excel sheet and then perform the required operations.
Hi all
I need to write a procedure which can read data from excel sheet.I have excel sheet in which i have to options one is modification and other is addition.so if it reads modification then i need to read the concerned table name then check its availability in pl-sql datbase.If table exists then reading the realated column in that row to fire the querry. The excel sheet is saved in local disk c.
can anybody help me with this.How i need to start specialy to read the data from excel sheet saved in local disk c.
Edited by: user13334062 on Jun 30, 2010 3:45 AM
Hi
If you can convert the excel to a csv format, then it can be simply query from DB Creating Oracle External Tables. Best part is that you may still change the CSV using EXCEL.
Following action Points can be adopt;
*1. Convert Excel File to a csv. File Save as CSV*
*2. Create Oracle Directory* ( This has to be the location of your excel file )
SQL> Create directory mydir as 'C:\testdb'; --- "testdb" is the location folder in win for your excel sheet.
*3. Create the External Table*
SQL> create table my_ext_tab (
Field1 Datatype,
Field2 Datatype,
Field3 Datatype,
Field4 Datatype,
Field5 Datatype
Organization external
(type oracle_loader default directory mydir
access parameters (records delimited by newline fields terminated by ',')
location ('my_ext_tab.csv'))
reject limit 100;
*4. Now you can query the table "my_ext_tab"*
Select * from "my_ext_tab";
Please avoid the reformat the data column inside the spreadsheet (CSV).
Similar Messages
-
Hi,
I want to create a visual webpart which will read data from excel sheet and import it in to sql server database.(using sharepoint development)
I want to do it using visual webpart.
Please help to solve the issue.
Thanks in advance!
Regards
RajniHi Rajni,
Microsoft.Office.Interop.Excel assembly provides class to read excel file data, in your web part solution, reference the assembly, and following blog contains samples about how to read the excel file data,
and import it to SQL database.
1.Create a Visual Web Part Project:Create
Visual Web Parts in SharePoint 2010
2.Read the excel workbook by using SPFile class:
http://alancejacob.blogspot.in/2012/06/read-data-from-excel-file-and-insert-in.html
http://stackoverflow.com/questions/14496608/read-excel-file-stored-in-sharepoint-document-library
3.Export the excel workbook to SQL Server:
http://www.c-sharpcorner.com/UploadFile/99bb20/import-excel-data-to-sql-server-in-Asp-Net/
Best Regards,
Eric
Eric Tao
TechNet Community Support -
Problem in reading data from Excel sheet to 2D string array (ActiveX & LabView).
I am trying to read data from Excel sheet to 2D string array (ActiveX & LabView). Error -2147352571 is generated (type mismatch) if cell value is "#NULL!", "#N/A" etc. What should I do?
Hello �
Is the error happening when the cell value is #NULL or #NA only?
Sometimes these errors occur because of an ActiveX object mismatch. The version of the ActiveX object might have changed or been updated since the VI was created. The VI tries to use an earlier, incompatible version of the ActiveX object.
To solve the problem, you need to link automation refnum terminal to the correct ActiveX object. To do so, right-click an automation refnum terminal and choose Select ActiveX Class»Browse from the shortcut menu. From the Type Library pull-down menu, select the latest version of the library you want to use, such as Microsoft Excel Object Library. In the Objects list, select an ActiveX object, and click the OK button. Link ea
ch automation refnum terminal in the VI and its subVIs until the run arrow is not broken. Also, you might have to replace some or all of the Invoke Nodes and Property Nodes for the ActiveX objects.
Also, I came across this Knowledgebase. The error number is slightly different but it is always good to check it out and make sure it is not your case.
Hope this helps.
S Vences
Applications Engineer
National Instruments -
Read data from Excel file and diaplay in Webdynpro
Hi all,
I need some help. I have a Excel file with set of name, phonenumbers . I want to know how to display the data using Webdynpro. Could some one help me. help is appreciated and I promise to award points for right answer.
Thank you
Maruti<b>Hi
i can explain you to read data from Excel file
First You have to download the jxl.jar file. You can get this file from the Below site
</b><a href="http://www.andykhan.com/jexcelapi/download.html">jexcelapi jar</a>
It will be in Compressed Fromat So Unzip it to get the Contents
After Unzipping The File You will get a Folder (jexcelapi/jxl.jar)
Now in NWDS open web dynpro explorer, Right Click Your Project, a popup menu will appear and in that click Properties
You will get window displaying your Project Properties
On Left Side of the window You Will Find "Java Build Path"
Click That "Java Build Path" and you will get 4 Tabs Showing ( Source,Projects,Libraries,Order and Export)
Click Libraries Tab
You will find options many options buttons
In that click the Button "Add External Jars"
You will get Window in order to fecth the jxl.jar file from the location you had stored
After selecting the jxl.jar i will get displayed and click ok
Now Open Navigator
Open Your Project
You will find Lib folder
Copy the jxl.jar to that lib folder
Note : You cannot Read the Content from the excel file directly
First You Have to copy that file to the Server,
And from the Server you can get the file absolute path
With the absolute path you can read the contents of the Excel file
You have to save the Excel file as .xls Format and Not as xlsx format i will not accept that...
You have Upload the Excel file from the Server Using the File Upload UI Element
This Coding will extract 3 columns from the Xls File
Coding
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
import jxl.Cell;
import jxl.Sheet;
import jxl.Workbook;
import com.sap.fileupload.wdp.IPrivateFileUpload_View;
import com.sap.tc.webdynpro.services.sal.datatransport.api.IWDResource;
public void onActionUpload_File(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionUpload_File(ServerEvent)
IPrivateFileUpload_View.IContextElement element1 = wdContext.currentContextElement();
IWDResource resource = element1.getFileResource();
element1.setFileName(resource.getResourceName());
element1.setFileExtension(resource.getResourceType().getFileExtension());
//@@end
public void onActionUpload_File_in_Server(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionUpload_File_in_Server(ServerEvent)
InputStream text=null;
int temp=0;
try
File file = new File(wdContext.currentContextElement().getFileResource().getResourceName().toString());
FileOutputStream op = new FileOutputStream(file);
if(wdContext.currentContextElement().getFileResource()!=null)
text=wdContext.currentContextElement().getFileResource().read(false);
while((temp=text.read())!=-1)
op.write(temp);
op.flush();
op.close();
path = file.getAbsolutePath();
wdComponentAPI.getMessageManager().reportSuccess(path);
catch(Exception e)
e.printStackTrace();
//@@end
public void onActionUpload_Data_into_Table(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionUpload_Data_into_Table(ServerEvent)
try
Workbook wb =Workbook.getWorkbook(new File(path));
Sheet sh = wb.getSheet(0);
//wdComponentAPI.getMessageManager().reportSuccess("Columns = "+sh.getColumns());
//wdComponentAPI.getMessageManager().reportSuccess("Rows = "+sh.getRows());
int columns = sh.getColumns();
int rows = sh.getRows();
int i=0;
for(int j=1;j<=rows;j++)
ele=wdContext.nodeTable_Data().createTable_DataElement();
Cell c1 = sh.getCell(i,j);
ele.setTab_Name(c1.getContents());
Cell c2 = sh.getCell(i+1,j);
ele.setTab_Degree(c2.getContents());
Cell c3 = sh.getCell(i+2,j);
ele.setTab_Percentage(c3.getContents());
wdContext.nodeTable_Data().addElement(ele);
catch(Exception ex)
wdComponentAPI.getMessageManager().reportSuccess(ex.toString());
//@@end
* The following code section can be used for any Java code that is
* not to be visible to other controllers/views or that contains constructs
* currently not supported directly by Web Dynpro (such as inner classes or
* member variables etc.). </p>
* Note: The content of this section is in no way managed/controlled
* by the Web Dynpro Designtime or the Web Dynpro Runtime.
//@@begin others
String path;
IPrivateFileUpload_View.ITable_DataElement ele;
//@@end
Regards
Chandran S -
How to read the data from excel file and store into the table?
Hi All,
I have table with BLOB datatype contains a excel file. I have to read that data from excel and store into one table with all the fields in excel.
All the excel fields and my table columns are same.
Can you share with me how can acheive this using LOB's?
ThanksHi OraSuirya,
you can try with external tables .
syntax as follows
create table ext_table_csv (
i Number,
n Varchar2(20),
m Varchar2(20)
organization external (
type oracle_loader
default directory ext_dir
access parameters (
records delimited by newline
fields terminated by ','
missing field values are null
location ('file.csv')
reject limit unlimited;
For this you need to create directory
Directory Creation syntax:
create or replace directory ext_dir as 'D:\oracle\user_dir\ext_dir';
grant read, write on directory ext_dir to <User>;
please paste the excel file in the particular directory .
I hope this will help you.
Please correct me if I am wrong anywhere .
Thanks,
Tippu. -
Cannot retrieve the data from excel sheet
hi all ...
i am trying to retrieve the data from excel sheet and at the same time i am inserting the data into mysql database.
code is as follows
try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); conn1=DriverManager.getConnection("jdbc:odbc:"+estr,"",""); Class.forName("com.mysql.jdbc.Driver"); conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/"+ t_dsn ,"root","manager"); sql="select * from student_info"; srch2 = conn.prepareStatement(sql); rs1 = srch2.executeQuery(); String query = "select * from ["+einput+"$]"; String query1= "select count(*) from ["+einput+"$]"; st = conn1.createStatement(); rs = st.executeQuery(query); ResultSetMetaData rsmd = rs.getMetaData(); c = rsmd.getColumnCount();//gets the column count rs1 = st.executeQuery(query1); while (rs1.next()) //loop to get no. of rows { r = rs1.getInt(1); } rs = st.executeQuery(query); for(i=1;i<=r;i++){ rs.next(); for(j=1;j==c;j++) { a = rs.getString(j); b= rs.getString(j); d = rs.getString(j); } rs1.next(); PreparedStatement ps2 = conn.prepareStatement("insert into materials_out values(?,?,?)"); ps2.setString(1,a); ps2.setString(2,b); ps2.setString(3,d); ps2.executeUpdate(); } }catch(Exception e){ e.printStackTrace(); }
but it is showing error as :
java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name too long
at sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6957)
at sun.jdbc.odbc.JdbcOdbc.standardError(JdbcOdbc.java:7114)
at sun.jdbc.odbc.JdbcOdbc.SQLDriverConnect(JdbcOdbc.java:3073)
at sun.jdbc.odbc.JdbcOdbcConnection.initialize(JdbcOdbcConnection.java:323)
at sun.jdbc.odbc.JdbcOdbcDriver.connect(JdbcOdbcDriver.java:174)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at Outward_register.jButton2ActionPerformed(Outward_register.java:368)
at Outward_register.access$400(Outward_register.java:23)
at Outward_register$5.actionPerformed(Outward_register.java:312)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6038)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
at java.awt.Component.processEvent(Component.java:5803)
at java.awt.Container.processEvent(Container.java:2058)
at java.awt.Component.dispatchEventImpl(Component.java:4410)
at java.awt.Container.dispatchEventImpl(Container.java:2116)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3986)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
at java.awt.Container.dispatchEventImpl(Container.java:2102)
at java.awt.Window.dispatchEventImpl(Window.java:2429)
at java.awt.Component.dispatchEvent(Component.java:4240)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
please help me ...please help me ... The question has nothing to do with 'getting' data from excel and certainly not with putting it into MySQL.
The stack trace specifically tells you that your connection string is wrong.
It also tells you which connection string is wrong.
Which you can use to determine specifically which one is wrong. And which you did not provide that info to us. -
Getting short dumps while reading bulky data from excel sheet
Hi all,
We have converted our non-unicode based sap system (R/3 4.7, Windows 2003,
SQL 2000) into a unicode based system recently. We are facing two peculiar
problems for last few days.
*Problem 1 - *Whenever we want to upload the data from excel sheet, the
system throws a dump after reading about 400 entries, while last week the
same system used to read about 8000 entries in a single go.
*Problem 2 - *Also, whenever we realease a transport requst from development
containing a lot of changes, the request will reach the quality system but
without the changes. but if i ll try to import the changes into quality
system after generating more than one request containing small small
changes, they get reflected in QAS immediately. Is there any size
constraint in transporting a request fro DEV->QAS->PRD.
Please suggest some ways.
I am pasting the dump (that I am getting while data uploading from Excel).
~~~~~~~~~~~~~~~~~~
Runtime errors
MESSAGE_TYPE_X*
Occurred on
22.02.2008 at
13:21:02*
The current application triggered a termination with a short dump.
What happened?
The current application program detected a situation which really
should not occur. Therefore, a termination with a short dump was
triggered on purpose by the key word MESSAGE (type X).
What can you do?
Print out the error message (using the "Print" function)
and make a note of the actions and input that caused the
error.
To resolve the problem, contact your SAP system administrator.
You can use transaction ST22 (ABAP Dump Analysis) to view and administer
termination messages, especially those beyond their normal deletion
date.
Error analysis
Short text of error message:
Control Framework : Error processing control
Technical information about the message:
Diagnosis
An error occurred when the system tried to process the commands
from the Automation Queue on the presentation server.
There are several possible reasons for this:
- The installation of the SAP GUI on the presentation server is
faulty or obsolete.
- There is an error in the application program
- There is an error in the SAPGUI or an integrated control
Procedure
1. Make sure that you have imported the appropriate Support
Package, the current kernel, and GUI patch for the release of your
System
2. Check whether the error occurs locally on one or a few PCs, or
generally on all PCs. Note whether the error only occurs for some
users, for example because of a specific Customizing setting.
If it only occurs locally, this suggests an installation problem
with the PC. Check the installation; if necessary, reinstall the
software. In the dump, search for the SY-MSGLI field, since it may
point to the cause of the error.
3. Activate the Automation Trace (in accordance with SAP Note
158985).
4.Start the transaction and continue until the screen immediately
before the dump.
5. From the System -> Utilities menu, choose Autom. Queue,
Synchronous Processing.
The status bar of the GUI displays the text:
"Automation synchron flush mode on"
6. If you now proceed with the application, the short dump will
display the ABAP call that caused the error; the Automation Trace
will contain the error on the presentation server.
7. If necessary, load the short dump and trace files on to
sapservX, so that SAP can analyze them.
Message classe...... "CNDP"
Number.............. 006
Variable 1.......... " "
Variable 2.......... " "
Variable 3.......... " "
Variable 4.......... " "
Variable 3.......... " "
Variable 4.......... " "
How to correct the error
Probably the only way to eliminate the error is to correct the program.
You may able to find an interim solution to the problem
in the SAP note system. If you have access to the note system yourself,
use the following search criteria:
"MESSAGE_TYPE_X" C
"SAPLOLEA" or "LOLEAU02"
"AC_SYSTEM_FLUSH"
If you cannot solve the problem yourself, please send the
following documents to SAP:
1. A hard copy print describing the problem.
To obtain this, select the "Print" function on the current screen.
2. A suitable hardcopy prinout of the system log.
To obtain this, call the system log with Transaction SM21
and select the "Print" function to print out the relevant
part.
3. If the programs are your own programs or modified SAP programs,
supply the source code.
To do this, you can either use the "PRINT" command in the editor or
print the programs using the report RSINCL00.
4. Details regarding the conditions under which the error occurred
or which actions and input led to the error.
System environment
SAP Release.............. "620"
Application server....... "nhbho930"
Network address.......... "192.168.0.30"
Operating system......... "Windows NT"
Release.................. "5.2"
Hardware type............ "4x Intel 801586"
Character length......... 16 Bits
Pointer length........... 32 Bits
Work process number...... 0
Short dump setting....... "full"
Database server.......... "NHBHO930"
Database type............ "MSSQL"
Database name............ "DEV"
Database owner........... "dev"
Character set............ "C"
SAP kernel............... "640"
Created on............... "Aug 17 2007 00:18:58"
Created in............... "NT 5.0 2195 Service Pack 4 x86 MS VC++ 13.10"
Database version......... "SQL_Server_8.00 "
Patch level.............. "196"
Patch text............... " "
Supported environment....
Database................. "MSSQL 7.00.699 or higher, MSSQL 8.00.194"
SAP database version..... "640"
Operating system......... "Windows NT 5.0, Windows NT 5.1, Windows NT 5.2,
Windows NT 6.0"
User, transaction...
Client.............. 300
User................ "NHBABAP"
Language key........ "E"
Transaction......... "SE38 "
Program............. "SAPLOLEA"
Screen.............. "SAPMSDYP 0010"
Screen line......... 0
Information on where terminated
The termination occurred in the ABAP program "SAPLOLEA" in
"AC_SYSTEM_FLUSH".
The main program was "ZBDC_CONTRACT ".
The termination occurred in line 29 of the source code of the (Include)
program "LOLEAU02"
of the source code of program "LOLEAU02" (when calling the editor 290).
~~~~~~~~~~~~~~~~~~~~~
Thank you all.
Cheers.
Mitra __.____._for the 50 millionth time: Excel spreadsheets are NOT databases, you should NOT try to use them as such and NEVER access them using JDBC.
You should also under NO condition use the JDBC-ODBC bridge driver (that was actually the 78 millionth time that was told someone). -
How to read the data from Excel file and Store in XML file using java
Hi All,
I got a problem with Excel file.
My problem is how to read the data from Excel file and Store in XML file using java excel api.
For getting the data from Excel file what are all the steps i need to follow to get the correct result.
Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
Thanks & Regards,
Sreenu,
[email protected],
india,If you want someone to do your work, please have the courtesy to provide payment.
http://www.rentacoder.com -
Read data from Excel and write into oracle database
Hi
I want to know how can i read data from excel and write into oracle database using java.Kindly help me out to find a solution.
Thanks and Regards
NeetaHai,
I am suggesting the solution.
I will try out and let u know soon.
Make a coma separated file from your excel file.
Assuming that your requirement allows to make a csv file.
This file may be passed as an file object to be read by java.Using JDBC you must be able to populate the data base.You can also use String Tokenizer if needed.
You do not want to go via sql Loader?
For reading the excel file itself do you want java? -
How to get data from excel sheet present in the client(local) system?
hi,
I have to upload the data from an excel sheet present in the local system(not on the server) to the table using webdynpro.
i donot want to upload the excel file
if it is necessary to upload the file then it should be on temporary basis and it should be deleted automatically.
i can get the data from excel sheet which is present in the km using HSSF api but how to do the same if it is in local system?
if anyone has the sample application of this type please give me the link.
thanksYou can use the FM ALSM_EXCEL_TO_INTERNAL_TABLE with Web Dynpro ABAP.
-
Pasting data from Excel sheet to Table in web dynpro View
Hii All,
Is it possible to copy data ( some rows) from Excel sheet and paste in table in a view?
I tried doing this, but only first element is getting pasted..
Does anybody know how to do this?
Is there any way to perform similar thing?
Pls help.
regards,
AmeyHi,
Copy paste may work if you have that many rows in your table(not sure).
One thing you can do is upload the excel and then populate the context of the node bound to the table by fetching data from the excel
For this you can make use of JXL or APACHE POI.
Regards
Ayyapparaj -
Uploading data from excel sheet
HI,
Can anyone provide me the details to upload vendor data from excel sheet to database through bdc?
Thankyou.upload the excel file in your internal table and then use BDC to updated the database table.
FM's to upload Excel:
GUI_UPLOAD
KCD_EXCEL_OLE_TO_INT_CONVERT
ALSM_EXCEL_TO_INTERNALTABLE
refer to the link:
http://diocio.wordpress.com/2007/02/12/sap-upload-excel-document-into-internal-table-2/
http://www.sap-img.com/abap/learning-bdc-programming.htm
With luck,
Pritam. -
Upload data from excel sheet into md61
Hi Gurus,
Can anybody please tell me the solution like how to upload the data from excel sheet into the MD61
if u suggest me to write an ABAP code then its fine or any other way would be great
and can u also send me the abap code i would be thankful to allHi,
I can be done in 2 ways.
1. Using LSMW you can upload your MD61 demand thru Excel sheet.
2. You can use BDC to upload the demand from Excel. For this you need to take help from the ABAP. You need to record the macro usinf SHDB and the table maintenance will be taken care by the developer.
For LSMW you need not depend on your developer, as a functional consultant you can do it yourself.
Regards,
V. Suresh -
Dowloading data from excel sheet
Hi all,
Please tell me the function module to download the data from excel sheet in to the internal table created in program.
And how to download the data from a particular line in the excel sheet into internal table.HI,
TYPES:
BEGIN OF ty_upload,
field1 TYPE c length 12,
field2 TYPE c length 12,
field3 TYPE c length 12,
END OF ty_upload.
DATA it_upload TYPE STANDARD TABLE OF ty_upload WITH DEFAULT KEY.
DATA wa_upload TYPE ty_upload.
DATA itab TYPE STANDARD TABLE OF alsmex_tabline WITH DEFAULT KEY.
FIELD-SYMBOLS: <wa> type alsmex_tabline.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = filename
i_begin_col = 1
i_begin_row = 1
i_end_col = 3
i_end_row = 65535
TABLES
intern = itab.
LOOP AT itab ASSIGNING <wa>.
CASE <wa>-col.
WHEN '0001'.
wa_upload-field1 = <wa>-value.
WHEN '0002'.
wa_upload-field2 = <wa>-value.
WHEN '0003'.
wa_upload-field3 = <wa>-value.
ENDCASE.
APPEND wa_upload TO it_upload.
CLEAR wa_upload.
ENDLOOP
http://www.sap-img.com/abap/upload-direct-excel.htm
<b>Another Program</b>
*& Report UPLOAD_EXCEL *
*& Upload and excel file into an internal table using the following *
*& function module: ALSM_EXCEL_TO_INTERNAL_TABLE *
REPORT UPLOAD_EXCEL no standard page heading.
*Data Declaration
data: itab like alsmex_tabline occurs 0 with header line.
* Has the following format:
* Row number | Colum Number | Value
* i.e. 1 1 Name1
* 2 1 Joe
TYPES: Begin of t_record,
name1 like itab-value,
name2 like itab-value,
age like itab-value,
End of t_record.
DATA: it_record type standard table of t_record initial size 0,
wa_record type t_record.
DATA: gd_currentrow type i.
*Selection Screen Declaration
PARAMETER p_infile like rlgrap-filename.
*START OF SELECTION
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = p_infile
i_begin_col = '1'
i_begin_row = '2' "Do not require headings
i_end_col = '14'
i_end_row = '31'
tables
intern = itab
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
if sy-subrc <> 0.
message e010(zz) with text-001. "Problem uploading Excel Spreadsheet
endif.
* Sort table by rows and colums
sort itab by row col.
* Get first row retrieved
read table itab index 1.
* Set first row retrieved to current row
gd_currentrow = itab-row.
loop at itab.
* Reset values for next row
if itab-row ne gd_currentrow.
append wa_record to it_record.
clear wa_record.
gd_currentrow = itab-row.
endif.
case itab-col.
when '0001'. "First name
wa_record-name1 = itab-value.
when '0002'. "Surname
wa_record-name2 = itab-value.
when '0003'. "Age
wa_record-age = itab-value.
endcase.
endloop.
append wa_record to it_record.
*!! Excel data is now contained within the internal table IT_RECORD
* Display report data for illustration purposes
loop at it_record into wa_record.
write:/ sy-vline,
(10) wa_record-name1, sy-vline,
(10) wa_record-name2, sy-vline,
(10) wa_record-age, sy-vline.
endloop.
Regards
Sudheer -
Uploading data from excel sheets through BDC's into sap system
hi guys,
can you please help me with this. As we use gui_upload to upload data from flat file to sap system, which function module you use to upload data from Excel sheet to sap system through bdc'shello pavan,
welcome to SDN
check the below program
REPORT ZEXCEL_TO_INTERNAL .
data: begin of itab occurs 0,
name(20) type c,
addre(20) type c,
end of itab.
DATA : ITAB1 LIKE ALSMEX_TABLINE OCCURS 0 WITH HEADER LINE.
DATA : B1 TYPE I VALUE 1,
C1 TYPE I VALUE 1,
B2 TYPE I VALUE 100,
C2 TYPE I VALUE 9999.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME =
'C:\Documents and Settings\administrator\Desktop\ppcon001bd_24.xls'
I_BEGIN_COL = B1
I_BEGIN_ROW = C1
I_END_COL = B2
I_END_ROW = C2
TABLES
INTERN = itab1
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.
ENDIF.
loop at itab1.
write:/ itab1.
Endlop.
Regards,
Naveen
Maybe you are looking for
-
Can we use xml Publisher reporting for sql* Plus in EBS
Hello All, The current report is designed in Sql* Plus Executable report and the output is in txt format, Now the requirement is to have the output in Excel format. So is it possible to use the xml reporting and make the output as Excel from the word
-
Using FM ARCHIVOBJECT_DISPLAY.
Hi abapers, I'm using the FM ARCHIVOBJECT_DISPLAY to display a document from DMS server. I've tested the FM and it display the document in a new ynpro/window. the problem is that I've integrated this FM in a dynpro module pool and i nead to display
-
I am trying to make a 6.1 AC3
I am trying to make a 6.1 AC3. I have all the tracks (.Aiff) to make it but I don't know what setting to use in compressor 2.3. I see that compressor has the ability to use a center surround channel. Does any body know any settings I can use?
-
hello there.. i Just want to know how to tell if the BluRay players your showing here can support PAL or only NTSC for example : Sony - Smart Blu-ray Player Model: BDPS1100
-
Infospokes for Infocubes and ODS
Hi, Request to let me know based on the requirement below on how to create Infospokes using ascii flat file interface..... Can we create using ascii file format and would also like to know any other alternate means for the same. Please provide the st