Automation of transaferring Excel data to table in Database
Hi,
I am new to SSIS. I need to do automation process to transfer data from excel to table in database. I will get the report daily. So how to make the automation process without manually placing the excel table into excel source everyday?
1. The excel names changes everyday.
2. Everyday the excel must be load into same table.
3. while loading the excel I need to get rid of some rows in excel. Is it is possible in automation process?
4. Will automation process can form a column with current date as a new column while transferring the data?
Thanks in advance....
BALUSUSRIHARSHA
Hi BALUSUSRIHARSHA,
After testing the issue in my environment, we can refer to the following steps to achieve your requirement:
Create two variables, VarFolderPath stores the folder path in which our files exist, VarFileName stores the date value in the file name like below:
(DT_STR, 4, 1252) DATEPART("yy" , GETDATE())+ "-" + RIGHT("0" + (DT_STR, 2, 1252) DATEPART("mm" , GETDATE()), 2) + "-" + RIGHT("0" + (DT_STR, 2, 1252) DATEPART("dd"
, GETDATE()), 2)
In the Data Flow Task, drag an Excel Source with the as Excel Connection Manager.
Add the property below the Excel Connection Manger expression:
Property: ExcelFilePath Expression: @[User::VarFolderPath] + @[User::VarFileName]
Drag a Conditional Split Transformation that connect to the Excel Source, then add some conditions to filter some rows.
Drag a Derived Column Transformation that connect to the Conditional Split Transformation, then add a Derived Column Name with <add a new column> option and use GETDATE() as Expression.
Drag an OLE DB Destination that connect to the Derived Column Transformation, then configure a table to store the data.
The following screenshot are for your references:
If there are any other questions, please feel free to ask.
Thanks,
Katherine Xiong
Katherine Xiong
TechNet Community Support
Similar Messages
-
Comaparing Data within Tables in Database
Hi All,
I need to write a PL/SQL Procedure to Compare Data within Tables in a Database.
For Ex :- There is two tables A and B . A has id as 101 and B has is has 101. I need to comapre the Data . If no match is found within the tables i need to have those table name and column name printed. Please help.Assuming that you want to compare tables with identical structure here is one query that will give you all the records that exist in TABLE_A but do not in TABLE_B
select 'exist in A but doesn't in B' desc, a.*
from TABLE_A a
MINUS
select 'exist in A but doesn't in B' desc, b.*
from TABLE_B bfrom the other hand if you want to get the oposite result you can transform the query above to
select 'exist in B but doesn't in A' desc, b.*
from TABLE_B b
MINUS
select 'exist in B but doesn't in A' desc, a.*
from TABLE_A afinally, if you want to get all the records that are missing in some of the tables, you can do a UNION of the queries above:
select 'exist in A but doesn't in B' desc, a.*
from TABLE_A a
MINUS
select 'exist in A but doesn't in B' desc, b.*
from TABLE_B b
UNION
select 'exist in B but doesn't in A' desc, b.*
from TABLE_B b
MINUS
select 'exist in B but doesn't in A' desc, a.*
from TABLE_A aNow the question is, which records do you want to print?
Also this query might work quite slow if TABLE_A and TABLE_B are large tables.
I hope this will give you some ideas. -
Data collection table in database
Hi,
In our SAP ME WIP databse we are not able to see the parameter values for data collection ,as entered by operator.
We tried searchin in WIP db as system rule setting for '
Store Data Collection Results in ODS ' is false.
Are there any other settings apart from those mentioned in "how-to-guide" for datacollection that stores data in ODS database?
Or are we going wrong somewhere?
Attached is the reccomended landscape that we have used in our project.
Regards
Mansi
P.S.I think this post is in the wrong forum, but what table are you looking in for your data?
Did you figure out the answer to this problem? -
Data transfer from oracle database(external database) to sap database
Hi Abapers,
I have a requirment like excel data upload from oracle database(external database) to SAP database .Plz any one can help me how to create a bdc program for this requarment.
Advance thanks you.
JnanaHI
use function module 'ASLM_EXCEL_TO_INTERNAL_TABLE' TO UPLOAD DATA FROM EXCEL SHEET TO INTERNAL TABLE. FROM THERE U CAN SAVE IT TO DATABASE USING BDC FUNCTION MODULES. -
Importing excel data into oracle tables
Hello gurus,
Importing excel data into oracle tables..
I know this is the most common question on the thread ...First, i searched the forum, i found bunch of threads with loading data using sqlloader, converting excel into .Txt, tab delimited file, .csv file etc....
Finally i was totally confused in terms how to get this done....
Here is wat i have
- Excel file on local computer.
- i have laod data into dev environment tables(So no risk involved, but want to try something simple)
- Oracle version 11.1.0.7
- Sqlplus and toad (editors)
Here is wat i like to do ....i dont know if its possible
- Without going to unix server can i do everthing on local system by making use of oracle db and sqlplus or toad
SQLLOADER might be one option...but i dont want to go the unix server for placing files and logs and stuff.
Wat will be best and simplest option to do?? and wat format will best to convert from excel into csv, or txt or tab delimited etc.....
If you suggest sqlloader, any code example will be greatly appriciated.
Thank you so much!!!Hi,
user642297 wrote:
Imran,
This is increadible option in toad!!! It works absolutely sweet!! I have toad 9.7 version. IT works great. Thank you so much!!You are welcome :)
Well i have further discussion on this ....this option is great if you doing in staging or development area. What if your doing in prod?? If you automating the sqlloader then how do u do it?? I think we still need to stick with traditional approach of laoding data by making use of SQLLoader right ?? If m wrong please correct me.well, in our case, we do have access to a custom schema in prod where we create the staging table and load the data from datafiles.
try this:
load data
infile 'C:\dest.csv'
into table dest_table
fields terminated by "~" optionally enclosed by '"'
TRAILING NULLCOLS
(name,
owner_nm,
description_column,
UPDT_DT DATE 'MM/DD/YYYY')
{code}
you can get more info about sql loader and your error here:
http://download.oracle.com/docs/cd/B10501_01/server.920/a96652/ch05.htm
http://www.allinterview.com/showanswers/53766.html
And one more quick question ...i found an example of control file , in that i see .dat format file. Is it a data file ?? can i try that option ?? But in excel i didnt see to convert the .dat format file.
Any thoughts ???
It is same as a delimiter text file.
steps to create a .dat file (from a excel file):
1. Insert a column between two columns and populate it with the delimiter (in our case, it is ~)
2. Save the file as unicode text.
3. Open the file in text editor and remove all the tabs (find an replace with blank)
4. Save the file as "DEST.dat". Select encoding as UTF-8 while saving.
5. Your .dat file is ready.
Regards
Imran
Edited by: Imran Soudagar on Apr 22, 2010 10:22 PM -
Excel to oracle tables automation
Hi Gurus,
I want to load data from excel(data exist for each table/Tab in the file) into oracle tables(unix environment). Loading should be done using sqlldr and with proper error handling.
How can I implement this automation process.?
Thanks in advance.Hi,
I am using oracle 10g on the server side, and on the client machine only oracle client software installed. I will have the excel with different spreadsheets per table on the same client machine. can you help me in this scenario, as I dont have personal experience to automate the things like this.
Thanks -
Upload data from Excel to Internal table
Hi,
I am facing a peculiar problem in uploading the data in excel sheet to internal table.
The excel file contains material number and product hierarchy number. The product hierarchy number for some material is downloaded as 5.73101E17 for the value 573100910115782000. Though I expand the sheet the display is the same 5.73101E17. When i upload the sheet using the f'n module "ALSM_EXCEL_TO_INTERNAL_TABLE" the value is taken as it is (5.73101E+17) into the internal table which is wrong. I tried to change the data type to type n. Then the value is uploaded as 5731011700000000.
Please propose a solution to this without having to change the format of the column from general to "number without decimals"
Regards,
SamHI
see this example code which EXCEL TO INTERNAL TABLE AND THEN TO APPLICATION
*& Report ZSD_EXCEL_INT_APP
REPORT ZSD_EXCEL_INT_APP.
parameter: file_nm type localfile.
types : begin of it_tab1,
f1(20),
f2(40),
f3(20),
end of it_tab1.
data : it_tab type table of ALSMEX_TABLINE with header line,
file type rlgrap-filename.
data : it_tab2 type it_tab1 occurs 1,
wa_tab2 type it_tab1,
w_message(100) TYPE c.
at selection-screen on value-request for file_nm.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
PROGRAM_NAME = SYST-REPID
DYNPRO_NUMBER = SYST-DYNNR
FIELD_NAME = ' '
STATIC = 'X'
MASK = ' '
CHANGING
file_name = file_nm
EXCEPTIONS
MASK_TOO_LONG = 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.
start-of-selection.
refresh it_tab2[].clear wa_tab2.
file = file_nm.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = file
i_begin_col = '1'
i_begin_row = '1'
i_end_col = '10'
i_end_row = '35'
tables
intern = it_tab
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 it_tab.
case it_tab-col.
when '002'.
wa_tab2-f1 = it_tab-value.
when '004'.
wa_tab2-f2 = it_tab-value.
when '008'.
wa_tab2-f3 = it_tab-value.
endcase.
at end of row.
append wa_tab2 to it_tab2.
clear wa_tab2.
endat.
endloop.
data : p_file TYPE rlgrap-filename value 'TEST3.txt'.
OPEN DATASET p_file FOR OUTPUT IN TEXT MODE ENCODING DEFAULT.
*--- Display error messages if any.
IF sy-subrc NE 0.
MESSAGE e001(zsd_mes).
EXIT.
ELSE.
*---Data is downloaded to the application server file path
LOOP AT it_tab2 INTO wa_tab2.
TRANSFER wa_tab2 TO p_file.
ENDLOOP.
ENDIF.
*--Close the Application server file (Mandatory).
CLOSE DATASET p_file.
loop at it_tab2 into wa_tab2.
write : / wa_tab2-f1,wa_tab2-f2,wa_tab2-f3.
endloop. -
Upload data from Excel to Internal table in ECC
Hello SDN,
Here I am facing a problem for uploading the data from excel sheet to internal table in ECC6.0
Main problem is we don't have any FM ALSM_EXCEL_TO_INTERNAL_TABLE.
Please provide me the solution how to upload the data from excel to internal table through class. If possible please provide me the sample code so that it will be very helpful for me.
Waitingfor your valuable response.
Thanks & Regards,
Kumar.Hi,
you can use OLE to acces (not only) excel, but this will only work in dialog processing.
regards,
Hans -
Upload data from excel to oracle table
Hi,
if i'm user and using an application and i want to upload data from excel to oracle table on button click . Is it possible by using sql loader.
If yes then please clarify it .
is it possible from client end.
thanks
kamYes it is possible using SQL*LDR, External tables and ORCL Export Utility. Though I didn't try Export Utility to load the external files.
SQLLdr sysntax:
Create a control file.
It looks like this
Load data
Infile 'source.dat'
Into Table tablename
Fields terminated by ',' optionally enclosed by '"'
{code}
then use sqlldr command from your OS.
{code}
sqlldr userid/password@sid control = filename.ctl, data = source.dat, log = logname.log, bad = badname.log, discard = discardname.discard
{code} -
Hi,
I need to export data from excel to ADF table and edit the data and finally send it back to database.
Would you kindly let me know how to proceed in this?
Many thanks in advance
RegardsThis depends on your excel file structure.
You can use ADF Desktop Integration or
something like this(for simple excel files):
for excel -> adf table
http://technology.amis.nl/2010/09/16/adf-11g-import-from-excel-into-an-adf-table/
For adf table -> excel:
http://www.baigzeeshan.com/2010/04/exporting-table-to-excel-in-oracle-adf.html
http://adfreusablecode.blogspot.com/2012/07/export-to-excel-with-styles.html
Dario -
In SRM How to upload data from Excel to Internal Table
Hello Experts,
As seen the Function Module 'ALSM_EXCEL_TO_INTERNAL_TABLE' does not exists in SRM.
Is there any alternative to upload the data direct from excel to Internal table using any other FM. As seach did't get any relevant FM.
Please advice..
Thanks..did u try this
TEXT_CONVERT_XLS_TO_SAP
in this manner
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_line_header = 'X'
i_tab_raw_data = lt_raw
i_filename = p_path
TABLES
i_tab_converted_data = gt_output
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
this FM works on DOI
so
SAP document about DOI:
http://help.sap.com/saphelp_nw2004s/helpdata/EN/e9/0be775408e11d1893b0000e8323c4f/frameset.htm
SAP Demo Program about DOI: SAPRDEMOEXCELINTEGRATION.
the fm you mentioned works on OLE
so you could refer,
SAP document about OLE:
http://help.sap.com/saphelp_46c/helpdata/EN/59/ae3c98488f11d189490000e829fbbd/frameset.htm
Also you can refer this post
Download of SRM Contracts in Excel - Unit of Measurement Missing
Let me know if this works ..
Regards
Manthan.
Edited by: Manthan_R on Feb 23, 2010 12:18 PM -
To upload data from excel to internal table
hi
in excel sheet it contains 4 tabs.to upload data from excel to internal table i have used this fm
text_convert_xls_to_sap .but error wil comeing.that error in tables parameter.iternal table does not contain data.ple help me.(v 6.0) ple give me one example with codingHello,
Take a look on this: [ABAP - Upload data from Excel to Sap using OO|https://wiki.sdn.sap.com/wiki/x/xOw].
Regards. -
Exporting data from table to Excel in a particular format using BSP.
Hello all,
I am creating a application in BSP wherein i have to export data to excel sheet.
I am able to do that but the output in excel sheet is not formatted. it is displaying the data in a single
column. For example, the internal table which i am exporting to excel contains fields "product
name", "area name", country name", "values". all these should be displayed in different columns.How
can i achieve this functionality.A sample code will be of great help..
Below is the code i hav written for exporting to excel :
data: l_len type i,
l_string type string,
app_type type string,
file_content type xstring,
file_mime_type type string.
create OBJECT cached_response TYPE cl_http_response EXPORTING add_c_msg = 1.
cached_response->set_data( file_content ).
cached_response->set_header_field(
name = if_http_header_fields=>content_type
value = file_mime_type ).
LOOP AT itab_xls INTO wa_xls.
CONCATENATE L_STRING wa_xls-product_name
wa_xls-area_name
wa_xls-landx
CL_ABAP_CHAR_UTILITIES=>CR_LF INTO L_STRING SEPARATED BY SPACE.
ENDLOOP.
APP_TYPE = 'APPLICATION/MSEXCEL; charset=utf-16le'.
data: l_xstring type xstring.
call function 'SCMS_STRING_TO_XSTRING'
exporting
text = l_string
MIMETYPE = 'APPLICATION/MSEXCEL; charset=utf-16le'
IMPORTING
BUFFER = l_xstring.
Add the Byte Order Mark - UTF-16 Little Endian
concatenate cl_abap_char_utilities=>byte_order_mark_little
l_xstring
into l_xstring in byte mode.
cached_response->set_data( l_xstring ).
cached_response->set_header_field( name = if_http_header_fields=>content_type
value = 'APPLICATION/MSEXCEL; charset=utf-16le' ).
*Set the filename into the response header
cached_response->set_header_field( name = 'Content-Disposition'
value = 'attachment; filename=gkb_excel.xls' ).
*Set the Response Status
cached_response->set_status( code = 200 reason = 'OK' ).
*Set the Cache Timeout - 60 seconds - we only need this in the cache
*long enough to build the page and allow the IFrame on the Client to request it.
cached_response->server_cache_expire_rel( expires_rel = 60 ).
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_32 = guid.
CONCATENATE runtime->application_url '/' guid '.xls' INTO url.
cl_http_server=>server_cache_upload( url = url
response = cached_response ).
Can anyone help me with some solution.
Thanks in advance.
Gurmahima.the issue is here
LOOP AT itab_xls INTO wa_xls.
CONCATENATE L_STRING wa_xls-product_name
wa_xls-area_name
wa_xls-landx
CL_ABAP_CHAR_UTILITIES=>CR_LF INTO L_STRING SEPARATED BY SPACE.
ENDLOOP.
instead do the following
LOOP AT itab_xls INTO wa_xls.
CONCATENATE L_STRING wa_xls-product_name ','
wa_xls-area_name ','
wa_xls-landx ','
CL_ABAP_CHAR_UTILITIES=>CR_LF INTO L_STRING .
ENDLOOP.
and then change the file name extension from xls to csv. it should open properly in excel.
Note that this is only excel csv file. if you want a proper excel excel file, then
option one: build a html table with your data into a string and pass it to excel
option 2: build excel xml using your data into a string and pass it to excel.
Regards
Raja -
How to export the data from table to excel sheet
hi experts i have some problem am trying to export the data fro table to Excel sheet in the view controller i have created one button wit public void onActionCLEAR(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionCLEAR(ServerEvent)
//wdContext.nodeBapi_Salesorder_Getlist_Input().
//wdContext.nodeBapi_Salesorder_Getlist_Input().invalidate();
//@@end
//@@begin javadoc:onActionExporToExcel(ServerEvent)
/** Declared validating event handler. */
//@@end
public void onActionExporToExcel(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
//@@begin onActionExporToExcel(ServerEvent)
try{
FileOutputStream fos=new FileOutputStream("Test.xls");
PrintStream ps=new PrintStream(fos);
ps.println("<html><body><table border=1>");
int size=wdContext.nodeBapi_Salesorder_Getlist_Input().size();
Iterator attributes=wdContext.getNodeInfo().iterateAttributes();
ps.println("<tr>");
while(attributes.hasNext()){
ps.println("<th>");
DataAttributeInfo attrName=(DataAttributeInfo)attributes.next();
ps.println(attrName.getName());
ps.println("</th>");
ps.println("</tr>");
for(int i=0; i<wdContext.nodeBapi_Salesorder_Getlist_Input().size();i++)
attributes=wdContext.getNodeInfo().iterateAttributes();
ps.println("<tr>");
IWDNodeElement ele=wdContext.getElementAt(i);
while(attributes.hasNext()){
ps.println("<td>");
DataAttributeInfo attrName=(DataAttributeInfo)attributes.next();
ps.println(""+ele.getAttributeAsText(attrName.getName()));
ps.println("</td>");
ps.println("</tr>");
ps.println("</table></body></html>");
ps.flush();
ps.close();
fos.close();
catch(Exception e){
wdComponentAPI.getMessageManager().reportException(e.getMessage(), false);
finally{
//return("Test.xls") ;
//@@end
}h action and i have return the code
its running sucessfully but am not able to perform the action plz help meHi,
You shouldn't use DataAttributeInfo as it is an internal object, if I'm correct.
Use IWDAttributeInfo instead of DataAttributeInfo and it should work
(See also API doc of IWDNodeInfo.iterateAttributes() at http://help.sap.com/javadocs/nwce/ce711sp02/wdr/com.sap.wdr/com/sap/tc/webdynpro/progmodel/api/IWDNodeInfo.html#iterateAttributes())
Cheers,
Robin -
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
Maybe you are looking for
-
Please help! I have moved files onto my nokia via ...
I dwnloaded some themes for an Ericsson and the file is .thm now since i have lost the cable for the ericsson i just copied the .thm files onto the nokia, i've tried in all the different folders and what not and when i look onto the phone to send via
-
Hi Guys, The user wants to block multiple vendors in SAP like say some 1500. How is this possible. Please advise.. thanks srikanth
-
Where is the firefox tab?
I just downloaded firefox 4 and listened to tutuorial. There is no firefox tab at the top left of my browser page as demonstrated in the video. How come? How can I install it to use the demonstrated features?
-
Outlook 2013 & Adobe Reader XI. Can't open attachments.
Default mail client is set to Outlook. Word documents open ok. Microsoft took remote control of my computer & said problem is with Adobe.
-
can some body help me? yesterday I format my iphone and it have been more than 24 hours a litlle circle moving