Write to excel file (into AL11 directory)
Hi,
I am able to loop an internal table and write to csv file in AL11 directory.
But how to write to excel file instead of csv file. And how to format the excel file (for example, column B should be format to numeric and column E should format to date format), and are we able to put like red color on column C for example?
Thanks in advance.
Hi,
You need to add the tab inbetween all the fields of internal table and upload to application server using
OPEN DATASET
TRANSFER
CLOSE DATASET.
to add the tab inbetween the fields..you can use this code....
concatenete itb-field1 itab-field2......... into string seperated by CL_ABAP_CHAR_UTILITIES=>HORIZONTAL_TAB.
one exception whicle uploading data to the Application server you need to convert dec or currency field to char type otherwise it will give you short dump.
Similar Messages
-
How to upload and download a files into AL11 directory in ABAP
Hi,
How to upload and download a files into AL11 directory in ABAP
thanks
Moderator message: please search for available information/documentation.
Edited by: Thomas Zloch on Mar 21, 2011 9:18 AMYou should try one of these forums for an answer to your question:
http://swforum.sun.com/jive/forum.jspa?forumID=116
http://community.java.net/netbeans
http://linux.java.net -
Help Required:How Upload Excel file Into Oracle Table Using PLSQL Procedure
Please Help , Urgent Help Needed.
Requirement is to Upload Excel file Into Oracle Table Using PLSQL Procedure/Package.
Case's are :
1. Excel File is On Users/ Client PC.
2. Application is on Remote Server(Oracle Forms D2k).
3. User Is Using Application Using Terminal Server LogIn.
4. So If User Will Use to GET_FILE_NAME() function of D2K to Get Excel File , D2k Will Try to pick File from That Remote Server(Bcs User Logind from Terminal Server Option).
5. Cannot Use Util_File Package Or Oracle Directory to Place That File on Server.
6. we are Using Oracle 8.7
So Need Some PL/SQL Package or Fuction/ Procedure to Upload Excel file on User's Pc to Oracle Table.
Please Guide me wd some Code. or with Some Pl/SQL Package, or With SOme Hint. Or any Link ....
Jus help to Sort This Issue ........
you can also write me on :
[email protected], [email protected]TEXT_IO is a PL/SQL package available only in Forms (you'll want to post in the Forms forum for more information). It is not available in a stored procedure in the database (where the equivalent package is UTL_FILE).
If the Terminal Server machine and the database machine do not have access to the file system on the client machine, no application running on either machine will have access to the file. Barring exceptional setups (like the FTP server on the client machine), your applications are not going to have more access to the client machine than the operating system does.
If you map the client drives from the Terminal Server box, there is the potential for your Forms application to access those files. If you want the files to be accessible to a stored procedure in the database, you'll need to move the files somewhere the database can access them.
Justin -
How to store file into a directory?
i want to save the file(text file) into the directory which i have created using File object in the codes below. how do i do it?
public void saveString(String filename, String string)
//declare textfile to be null
PrintWriter textFile = null;
String line = null;
try {
// writes to write.txt
textFile = new PrintWriter (new FileWriter(filename,true));
line = string;
// save string in textfile
textFile.println(line);
textFile.close();
// create a directory (to store (output).xml file)
File fobj = new File("Testing");
fobj.mkdir();
catch (IOException e) {
System.out.println("Error in opening file");
System.exit(0);
}create the directory first and then create the file u want liek this
File f = new File (fobj,filename);
and then open the fiel to write like this
textFile = new PrintWriter (new FileWriter(f,true));
regards
rohan -
How to import a excel file into database?
hi all,
How can I import a excel file into database?
What I need to do first?
Thanks,
Amy1. Create a conrtol file in your disc(with notepad) ex
test_loader.ctl
LOAD DATA
INFILE='C:\Testcsv.csv'
into table test_table
FIELDS TERMINATED BY ','
TRAILING NULL COLS
(ID,COL1,COL2,COL3)
The table descrption is
scott@ORCL> desc test_table;
Name Null? Type
ID NUMBER
COL1 VARCHAR2(10)
COL2 VARCHAR2(10)
COL3 VARCHAR2(10)
scott@ORCL>
2 .Create a file testcsv.csv from your excel file you want to load with " save as" csv comma seperated value
in your hard disc c:\
3. in dos command mode write
C:\>sqlldr scott/tiger control=c:\testcsv.ctl log=c:\testcsv.log
Thats it! -
Problems appearing when exporting excel file into numbers file
Hello,
I have a Problem, need HELP!!
I have an excel file with graphics, and data are written on graphs: these data are percentages. When I export my excel file on numbers (becomes therefore a numbers file), my problem appears: When I have for example 24% on a graph, it becomes 0.24 and I can't find the way to write it 24% again.
Also I have a problem with graphics titles: when I export the excel file into numbers, graphics title are not correctly centered anymore and I cannot find the way to fix them correctly...
Thanks a lot!!!!vassi44 wrote:
I have an excel file with graphics, and data are written on graphs: these data are percentages. When I export my excel file on numbers (becomes therefore a numbers file), my problem appears: When I have for example 24% on a graph, it becomes 0.24 and I can't find the way to write it 24% again.
It seems that only sectorial charts may display percent.
Also I have a problem with graphics titles: when I export the excel file into numbers, graphics title are not correctly centered anymore and I cannot find the way to fix them correctly...
Sounds as if you are in cases where the charts are imported as a single graphic block, not as different components.
Maybe you will find explanation in:
http://discussions.apple.com/thread.jspa?threadID=1392586&tstart=0
Yvan KOENIG (from FRANCE mercredi 13 février 2008 13:08:05) -
Upload an Excel file into an Internal Table
Hi,
I want to upload an Excel file into an internal table but it doesn't work. I'd appreciate if someone could tell me what is wrong.
My excel file has the following format:
Col1 Col2
Row1 1 2
Row2 2 3
Row3 3 4
And the report code is the following one:
REPORT ZFI_PROKON_PROCESOS.
DATA: BEGIN OF itab OCCURS 0,
num1(1),
num2(1).
DATA: END OF itab.
PARAMETERS: p_file LIKE rlgrap-filename obligatory.
AT SELECTION-SCREEN.
AT SELECTION-SCREEN on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
EXPORTING
static = 'X'
CHANGING
file_name = p_file.
START-OF-SELECTION.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
FILENAME = p_file
I_BEGIN_COL = 1
I_BEGIN_ROW = 1
I_END_COL = 2
I_END_ROW = 5
TABLES
INTERN = itab
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 itab.
WRITE: / itab-num1, 10 itab-num2.
ENDLOOP.
Thanks in advance,
GerardTry function module
ALSM_EXCEL_TO_INTERNAL_TABLE
call function 'ALSM_EXCEL_TO_INTERNAL_TABLE'
exporting
filename = p_path
i_begin_col = 1
i_begin_row = 2
i_end_col = 70
i_end_row = 10000
tables
intern = i_excel
exceptions
inconsistent_parameters = 1
upload_ole = 2
others = 3.
P_PATH is file name with path.
I_EXCEL is internal table to store data.
declaration is "i_excel like structure alsmex_tabline"
then loop at i_Excel and populate your table
for eg
loop at i_excel.
case i_excel-col.
when '0001'.
i_data-compcode = i_excel-value.
when '0002'.
i_data-rcpttyp = i_excel-value.
when '0003'.
i_data-pocimpro = i_excel-value.
when '0004'.
i_data-tranno = i_excel-value.
when '0005'.
i_data-msrpo = i_excel-value.
when '0006'.
i_data-mporel = i_excel-value.
endcase.
at end of row.
append i_data.
clear i_data.
endat.
endloop. -
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 -
Open Excel File from oracle directory on a local machine
Hi,
I have an application where I generate a excel using data in a table and write excel file in oracle directory.Now my requirement is to open that file from local machine .How can i achieve it.
I am using Apex 4.2,Oracle 10g .
Thanks
Rajan.C
Edited by: Rajanjai on May 31, 2013 5:34 PMClose your question here and open here
Oracle Discussion Forums » Oracle Database » Application Express -
Loading an Excel file into a Z-Table
Hi Gurus,
Can somebody guide me how to load an excel file into a Z-Table.Hi,
You need to write a ABAP code for this....
The following is the code for loading data into an internal table:
types: begin of ttab,
rec(1000) type c,
end of ttab.
types: begin of tdat,
fld1(10) type c,
fld2(10) type c,
fld3(10) type c,
end of tdat.
data: itab type table of ttab with header line.
data: idat type table of tdat with header line.
data: file_str type string.
parameters: p_file type localfile.
at selection-screen on value-request for p_file.
call function 'KD_GET_FILENAME_ON_F4'
exporting
static = 'X'
changing
file_name = p_file.
start-of-selection.
file_str = p_file.
call function 'GUI_UPLOAD'
exporting
filename = file_str
tables
data_tab = itab
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.
delete itab index 1.
loop at itab.
clear idat.
split itab-rec at cl_abap_char_utilities=>horizontal_tab
into idat-fld1
idat-fld2
idat-fld3.
append idat.
endloop.
loop at idat.
write:/ idat-fld1, idat-fld2, idat-fld3.
endloop.
From this internal store it onto the database.....
Sharma one more thing you must have posted this question in ABAP fourum for better results....
Hope it helps,
Thanks,
Happy Life,
Aravind -
How do I convert an Excel file into a pdf?
how do I convert an Excel file into a pdf?
Hi tomduffey,
You can either use Create pdf service or Adobe Acrobat software for the purpose.
Please refer -
Using Create PDF service : https://www.acrobat.com/createpdf/en_GB/convert-excel-to-pdf-converter.html
Using Adobe Acrobat : http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/en/products/acrobat/pdfs/adobe- acrobat-xi-create-pdf-files-tutorial-ue.pdf -
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 -
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 files into Web UI
We are following the blog http://wiki.sdn.sap.com/wiki/display/CRM/CRMWebUI-UploadingdatafromExcelfiles
to upload excel files into Web UI.
The problem which we are facing is that the values are not getting populated in the text are and in the
event handler EH_ONSERVEREVENT, no values are being populated in lt_items table.
It would be great if someone could help us with this.Hi Nidhi,
I have tried the blog but due to some reason, could not get it worked out.
But, If U are ok to use CSV input files, instead of excel, U can use the standard component "GS_FILE_UPLOAD" as a popup and upload the files into the required assignment blocks. -
Acrobat 9 - we are unable to merge word and excel files into a pdf.
Acrobat 9 - we are unable to merge word and excel files into
a pdf. Any advice?To be expected if you are working in a contemporary OS and contemporary MS Office suite.
The Acrobat 9.x product family passed into End of Support mid-year of 2013.
The product isn't compatible with contemporary OSs or Office suite.
You may have to step up into the Acrobat XI product family.
Be well...
Maybe you are looking for
-
Creation Profile in Scheduling Agreement and Schedule LIne
Dear Experts, Currently I'm working on Scheduling Agreement and Schedule Line.In standard SAP gives the provision of creation profile.I've gone through the SAP help documentation but I'm not clear on that.I've few doubts on creation profile. 1. I've
-
HT201402 storage problem with ipad
why does my computer say that I have 20 gigabytes of tv shows, but then when I put them on my ipad they become 40 gigabytes of tv shows???
-
Time Capsule not registering correct IP Address
I had no issue when I was on DSL service and when I switched to a Cable modem I am getting the wrong IP Address on my TC. It should be getting a 173 address but instead is assigning to a 169. I have tried power cycling and to no avail. When I hook up
-
my nef files are.turning red in apertutre since latest update. i understand i need to uninstall this . how do i uninstall
-
I can not send e-mails from my Ipod
I have 5 e-mail account and suddenly (2-3 weeks ago), I stopped sending emails. I just can receive them.