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 reply
Deep,
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.
Similar Messages
-
How can one read a Excel File and Upload into Table using Pl/SQL Code.
How can one read a Excel File and Upload into Table using Pl/SQL Code.
1. Excel File is on My PC.
2. And I want to write a Stored Procedure or Package to do that.
3. DataBase is on Other Server. Client-Server Environment.
4. I am Using Toad or PlSql developer tool.If you would like to create a package/procedure in order to solve this problem consider using the UTL_FILE in built package, here are a few steps to get you going:
1. Get your DBA to create directory object in oracle using the following command:
create directory TEST_DIR as ‘directory_path’;
Note: This directory is on the server.
2. Grant read,write on directory directory_object_name to username;
You can find out the directory_object_name value from dba_directories view if you are using the system user account.
3. Logon as the user as mentioned above.
Sample code read plain text file code, you can modify this code to suit your need (i.e. read a csv file)
function getData(p_filename in varchar2,
p_filepath in varchar2
) RETURN VARCHAR2 is
input_file utl_file.file_type;
--declare a buffer to read text data
input_buffer varchar2(4000);
begin
--using the UTL_FILE in built package
input_file := utl_file.fopen(p_filepath, p_filename, 'R');
utl_file.get_line(input_file, input_buffer);
--debug
--dbms_output.put_line(input_buffer);
utl_file.fclose(input_file);
--return data
return input_buffer;
end;
Hope this helps. -
How can I read the EXCEL file while Program is running in background.
Hi all Expert,
How can I read the EXCEL file while Program is running in background.
Thanksyou need to place ur excel file on application server and follow this thread: Reading an Excel file from the application server?
loots of information if you can search forum.. thanks -
How can i import an excel file into formscentral?
how can i import an excel file into formscentral?
Thanks for asking. This is not something we currently support but you can add or vote on feature ideas:
http://forums.adobe.com/community/formscentral?view=idea
If you need to add a new idea click "Create an idea" under "Actions" in the top right.
Perry -
How can I read a Excel file?
How can I read an Excel file and compare if the cells type are numeric or not??
i hope you can can give me a hand..
thanksIf you want to use plsql try utl_file supplied package to read the excel file -> http://psoug.org/reference/utl_file.html
And you can use a function like this to understand if the column is number or not ;
CREATE OR REPLACE FUNCTION is_number (
char_in VARCHAR2)
RETURN BOOLEAN
IS
n NUMBER;
BEGIN
n := TO_NUMBER(char_in);
RETURN TRUE;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END is_number;
DECLARE
x BOOLEAN;
BEGIN
IF is_number('ABC') THEN
dbms_output.put_line('TRUE');
ELSE
dbms_output.put_line('FALSE');
END IF;
END;
/ -
Uploading excel file into internal table
Hi,
Any function module is there to upload an excel file into internal table in CRM 7.0 system?
Thanks.Hi Ginger,
If u have access to ECC R/3 make use FM 'TEXT_CONVERT_XLS_TO_SAP' source code which is existing to convert to Excel to Internal table. It will work in CRM also.
As of Now I don't have access to SAP S/m. Mean while u can try as above said.
Regards,
Lokesh B -
How can I read an excel file .xls from an forms 6i
Hi
I have forms6i and webutil don t work with this version, can I read an excel file from forms6i.
Thank uHi hosoriol,
You can refer an excel as an external table first using the steps below and then you can start reading from it.
If you want to update the excel file then create an view and create instead of triggers for it.
Steps
h3. 1.[Create an external table for the excel file |http://www.adp-gmbh.ch/ora/misc/ext_table.html|Click here to view detailed description]
h4. 1. Create a directory in Oracle where you have kept the xls file
create or replace directory ext_dir as '/home/rene/ext_dir';h4. 2. grant read, write on directory ext_dir to scott;
h4. 3. creating the external table
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;
Note_
If you want to update the excel file then create a view and then create the instead of triggers to do the update, delete or insert.[Creating views on external tables | http://www.dba-oracle.com/oracle_news/2005_9_1_updating_external_tables.htm]
h3. 2. Use the data block wizard and connect to the corresponding schema and create a database block.
Kindly click Correct or Helpful if it helps Thanks :-) -
How to transfer data from excel files into z-tables
Please help me with a code which transfers data from excel file to z-table.
Thanks in advance
ShuvirHi Daniel,
Export Data
Purpose
Use this procedure to export SAP data to a local file such as Microsoft Excel.
Menu Path
Use the following menu path to begin this process:
· SystemèListèSaveèLocal File
Helpful Hints
When reviewing fields, R = Required, O = Optional and C = Conditional.
Procedure
1. Start the transaction using the menu path or transaction code.
Whatever Data You Want to Export
2. Select SystemèListèSaveèLocal File. This works well for any data in SAP. This is the only option for the top-level (first page) of a report.
In a drill-down view within a report the Local File button on the toolbar may be used and has the same options.
Choose File Format
3. Click .
4. Click to continue. If prompted for a format after choosing Spreadsheet, select Excel Table to get an Excel file that can be modified more easily.
Choose File Save Location Step 1
5. Click to the right of the Directory field to choose a different location.
Choose File Save Location Step 2
6. Click or browse your computer to locate the directory where you want to save your file.
7. Complete the following field:
· File name:
You must add the proper file extension to the name of your file (.xls for Excel, .rtf for Rich Text, .html for HTML). The file extension tells your computer what program to open the file with. If you do not have the file extension at the end, you may not be able to open it.
8. Click to continue.
Generate File in Location and Format Selected
9. Click to create the file in the location and format selected. In this example the file was named "example.xls" and saved on the desktop.
Result
You have completed the export process.
thanks
karthik -
Uploading data from a particular column of a particular sheet from an excel file into internal table
Hi,
I have to upload data in the first coulmn of 7th sheet of an excel file.
Can anyone please help me on this.
This link works perfectly fine for excel files without Macros.
Read multiple sheets of an Excel file into SAP through ABAP - Code Gallery - SCN Wiki
But my excel file has some macros.
And after the macro enable/disable popup is cleared, the system freezes.
Can someone pease help me on this abd tell me an approach different from the one in the above link?Welcome to SCN
Please search before you post next time:BDC, upload data from multi excel sheets -
Uploading excel file into internal table with field length more than 255
I am trying to upload the data from an excel file through function module 'TEXT_CONVERT_XLS_TO_SAP'.
I have tested by changing the field type from string, and char2000.
But it is accepting only 255 chars from the cell content.
How to get the total content of the field if it is more than 255 char.hi,
you can use any of the following procedures:
For uploading data from excel to internal table refer standard report RC1TCG3Z in se38 :
or
You can use the FM 'ALSM_EXCEL_TO_INTERNAL_TABLE' itself. Please check if you have done it this way . But, this FM can be a little time consuming if the excel has large data, so you can use the FM u2018GUI_UPLOADu2019.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file1
i_begin_col = l_b1
i_begin_row = l_c1
i_end_col = l_b2
i_end_row = l_c2
TABLES
intern = lt_data
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
MESSAGE e018 DISPLAY LIKE 'i'.
ENDIF.
*---Removing the first heading fields from the file.
IF NOT lt_data[] IS INITIAL.
LOOP AT lt_data INTO lwa_data WHERE row = '0001'.
DELETE lt_data.
CLEAR lwa_data.
ENDLOOP.
*---Inserting the data from file the internal table
LOOP AT lt_data INTO lwa_data.
CASE lwa_data-col.
WHEN 1.
wa_file_wicopa-serial = lwa_data-value.
WHEN 2.
wa_file_wicopa-blart = lwa_data-value.
WHEN 3.
wa_file_wicopa-bldat = lwa_data-value.
WHEN 4.
wa_file_wicopa-budat = lwa_data-value.
ENDCASE.
AT END OF row.
APPEND wa_file_wicopa TO gt_file_wicopa.
CLEAR wa_file_wicopa.
ENDAT.
CLEAR lwa_data.
ENDLOOP.
ENDIF.
ENDIF.
or
DATA: it_test TYPE STANDARD TABLE OF alsmex_tabline WITH HEADER LINE.
DATA :v_start_col TYPE i VALUE '1',
v_start_row TYPE i VALUE '1',
v_end_col TYPE i VALUE '256',
v_end_row TYPE i VALUE '65536',
v_text TYPE repti.
* Funtion Module to upload values from excel to the Internal table
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 = it_test
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.
Or
You can use FM u201CTEXT_CONVERT_XLS_TO_SAPu201D.
DATA : i_raw TYPE truxs_t_text_data.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
i_tab_raw_data = i_raw
i_filename = p_path
TABLES
i_tab_converted_data = itab
EXCEPTIONS
conversion_failed = 1
OTHERS = 2
hope it will help u
regards
rahul -
Upload openoffice excel file into internal table
Hi Everyone,
I have a requirement where in we need to upload vendor master data into SAP.
The data is available in excel format. But the excel sheet was created in openoffice s/w and client is not allowing
us to install MS-Office so that we cut and paste the data by creating anexcel file.
Now there is an option of saving the excel file in openoffice s/w as MS-Excel 95 format with .xls extension.
But since we are saving this in openoffice enivoronment the FM ALSM_EXCEL..... data is not improting this excel file into
Did somebody faced this issue before. Pls share the approach to solve this issue.
Regards,
VinayHi !
you can use the Function module TEXT_CONVERT_XLS_TO_SAP to upload xcel file to internal table
please go through the code below.
REPORT zupload_excel_to_itab.
TYPE-POOLS: truxs.
PARAMETERS: p_file TYPE rlgrap-filename.
TYPES: BEGIN OF t_datatab,
col1(30) TYPE c,
col2(30) TYPE c,
col3(30) TYPE c,
END OF t_datatab.
DATA: it_datatab type standard table of t_datatab,
wa_datatab type t_datatab.
DATA: it_raw TYPE truxs_t_text_data.
At selection screen
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
CALL FUNCTION 'F4_FILENAME'
EXPORTING
field_name = 'P_FILE'
IMPORTING
file_name = p_file.
*START-OF-SELECTION.
START-OF-SELECTION.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = it_datatab[] "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
END-OF-SELECTION.
END-OF-SELECTION.
LOOP AT it_datatab INTO wa_datatab.
WRITE:/ wa_datatab-col1,
wa_datatab-col2,
wa_datatab-col3.
ENDLOOP.
hope this will help you.
Regards,
Kiran -
How can I Export the Image file into Oracle Table
<tt>
Hi Folks,
I have one requirement with me, but i can't able to find the solution for that, so kindly any one give a suggestion for my requirement.
Let me explain my requirement in detail.. I have one table called SIGN this table contain customer signature image as well as the image of the customer. The SIGN have the following columns
</tt>
CREATE TABLE SIGN
ID VARCHAR2(50 BYTE) NOT NULL, "This column containing the Customer ID"
IMAGE_C_FLAG CHAR(1 BYTE) NOT NULL, "This column containing the whether ID belong to Signature or Photo"
IMAGE BLOB, NOT NULL, "This Column Containing the Image "
ENTERED_C_BY VARCHAR2(10 BYTE)
The SIGN having the following values
ID C I IMAGE
23900033 Y S (BLOB)
23900034 Y S (BLOB)
23900035 Y S (BLOB)
23900036 Y S (BLOB)
23900042 Y S (BLOB)<tt>
I want to export those Image from Table into my machine local folder with the extension of .JPEG(C:\IMAGE)
How can i do that in oracle... please kindly any one give the solution for this..
This is my Oracle server version
BANNER
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Prod
PL/SQL Release 10.1.0.2.0 - Production
CORE 10.1.0.2.0 Production
TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
NLSRTL Version 10.1.0.2.0 - Production
Thanks in Advance
Arun
</tt>Hi Arun,
Please view the below links. Hope these helps you as there are also of similar discussion.
Insert Picture (image) using oracle forms
Insert Picture (image) using oracle forms
insert image to atable in forms builder
Re: insert image to atable in forms builder
Thanks,
Balaji K. -
How can I import .doc word files into Pages from Word 2008 for Mac?
I find that if I try to insert a .doc document from the earlier version of Word for the Mac, it works fine, but if I try to insert a doc which has been saved in "compatibility mode" as a .doc in Word 2008, Pages doesn't recognise it. I didn't even know there was any difference in these two kinds of .doc
Does anyone know a workaround?I can open them as I go using an intermediate app (Word for choice as presumably it preserves more of the formatting than TextEdit), then I can just copy and paste the text into my Pages doc. In my particular case this is tolerable, but I have a friend who I assist sometimes who I know has a lot of these docs and so I wanted to find a solution for him before he asked me!
It just seems quite different from what Apple appear to be offering... I started this thread really to see if anyone knew the cause of this anomaly, which seems to be a fairly small bug in Pages. Anyway I think I will not get any joy trying to understand the difference between the two kinds of .doc documents (in OS9 I would have guessed it was the 8-character file signature that differed, but I don't think this works in OSX) so I will stop wasting bandwidth and set this to "answered". -
Upload long text from excel file into internal table
I need to upload service master(T-code : AC02) data alongwith long text.Now i have data in excel as: Service no(ASMD-ASNUM) and corresponding long text for it.
I am facing problem in getting entire lontext from excel into my internal table.It only takes till 255 characters i think.Any help in this regard woulg be highly appreciable.hi,
what is the maximum length of your long text.
and you can try with more than 255 chars. in the internal table it will take , if you want check it.
i'm in 4.7 ,5.0 version, what about you ..
please check , you can upload even more than 255.
try
regards
vijay -
Uploading EXCEL file into Internal Table Using GUI_UPLOAD
Can any one please give me an example use of FM "GUI_UPLOAD" which to upload a EXCEL file????? (not .txt)
Use the forum search option [GUI_UPLOAD FOR EXCEL|https://forums.sdn.sap.com/search.jspa?threadID=&q=GUI_UPLOADFOREXCEL&objID=c42&dateRange=all&numResults=15&rankBy=10001]) or sdn wiki/code gallery ([UPLOAD EXCEL|https://wiki.sdn.sap.com/wiki/dosearchsite.action?searchQuery.queryString=upload+Excel&searchQuery.spaceKey=conf_global]) - Same question already answered many time
GUI_UPLOAD doesnt perform such conversion (Excel, Word, PDF) and wont give you a suitable result, use one of the FM mentioned above or [office integration|http://help.sap.com/saphelp_47x200/helpdata/en/21/b53138e1ba11d2bdbe080009b4534c/frameset.htm] or OLE or convert your Excel sheet to a simpler format : txt, csv, xml.
Regards,
Raymond
Maybe you are looking for
-
Shopping cart approved PR created but PO not created
Hi, we are using SRM4.0 classic scenario with self service procurement business scenario.and my user is getting the problem with PO not receiving in SRM. only backend PR has been created.but he is asking about the PO. when i checked SC only PR has
-
I just received my iPod Touch 64G. FYI - you probably want to give this product a skip. I am using the latest version of iTunes with my iPod 5G, no problems. I hooked up my new Touch and iTunes failed, saying reload Quicktime. After several iteration
-
Who understand the concept of EBS USER and LINUX USER
When we login the EBS, we will use a user(user1), and then we create a file to the server. When we use TELNET to login the server, we can see the file is created by another user(user2). How to understand both two users, and how to be relationship bet
-
Music is duplicated in two separate accounts. How do we separate them?
-
Internet Explorer 10 and 11 not saving cookies when Roaming Profile used.
Hi, We are using Citrix Xenapp 6.5 with roaming profile and IE9. I have tried to upgrade to IE10 and IE11 on a test Xenapp server, when we log off Windows and log back on again any website settings stored in cookies were lost. The cookies is stored i