Upload an excel file in the server with a background job
I am trying to upload an excel file in the server, but i only can upload flat files, i can upload files in local with the function ALSM_EXCEL_TO_INTERNAL_TABLE, can i use this function reading an excel file in the server, or is there another possibility of uploadinging an excel file in the server with a background job ?
thanks in advance
Hi
First read the file from the server to some temporary place at presentation layer and then open it. And if required, save it to the server afterwards. To read/write files to application server you can use:
1. Statements "OPEN DATASET/CLOSE DATASET".
2. There are some FMs for server file operations, like "C13Z_FILE_UPLOAD_BINARY" and "C13Z_FILE_DOWNLOAD_BINARY".
*--Serdar
Similar Messages
-
Upload a excel file on the server
Hi
I am developing a Software and in that software in one module we have to upload the excel file on the serverand then loading in to the server Database.But i dont know howt to upload it on the server as i dont get any help from the net also...
Thanks in advance.....
Thanks
Sandeep Bhalwalhi
http://forum.java.sun.com/thread.jspa?threadID=518038&messageID=2471953love google
http://www.oop-reserch.com/index.html
http://www.google.co.in/search?hl=en&client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&hs=G2l&q=upload+file+and+store+into+database+in+jsp+with+example&btnG=Search&meta= -
Upload a csv file in application server with the specified codepage(Poland
Hi,
i want to upload a csv file in application server with the specified codepage ( for poland ) , please let me know how to use open dataset for that.?
AnuragI would upload the file with transaction CG3Z in binary mode and do the code page translation with a report: read from server an save with different name.
-
Is there a way to open Excell file from the server and display in the UI and save it back on to the
Hello there,
Is there a way to open Excell file from the server and display in the UI and save it back on to the server? (like showing xell file as a datagrid - add rows, columns etc.)Hi Mike,
Welcome you to the forum.
You may try:
SELECT * FROM MyDBNameHere.dbo.OUSR T0
Thanks,
Gordon -
Reading a file on the server with a servlet
How do you read a file with a servlet that is located on the server?
I have tried several methods: here I have one of them:
begin code
String temp;
temp = this.getServletContext().getRealPath(temp);
in = new BufferedReader(new FileReader(temp));
while(in.ready())
bodytext=in.readLine();
end code
output: can't find file
while I am 100% certain that the file is present at the location given in the String temp.
Can someone help me please?I have to make a servlet that makes a menu structure. When I press a link, he asks my servlet to read a html file on the server. Then, he writes a submenu structure combined with the body part of the html code of the html file. For now, I have made it in JavaScript, but that doesn't work like I want it to. An example of what I mean, you can find at http://www.autismevlaanderen.be/vva
It's in a foreign language(Dutch), but it's the structure that matters. -
How to list the uploaded files on the server with a jsp page
hi every body , iam stuck up with yhis problem . I a have use Random Access File to upload files to the web server , now i want the user can see the files he /she has uploaded or the the files uploaded by others . plese help me how to implement this .
Message was edited by:
joshiashutoshhi every body , iam stuck up with yhis problem . I a
have use Random Access File to upload files to the
web server ,Huh?
now i want the user can see the files he
/she has uploaded or the the files uploaded by others
. plese help me how to implement this .So get the directory using the File class the files are in and list the files inside, showing the result to the user... how difficult would that be? -
Export to excel in a webdynpro java app to store a excel file on the server
Hi Experts,
We have a requirement wherein we need to implement the export to excel functionality in a webdynpro java application.
The excel file created in this way should be stored in the server location.
I've implmented the export to excel functionality before but the file used to get stored on to my local desktop. But this time, I want the file to get stored on some portal server location.
Can anyone guide me with the steps for the same?
It would be really great if you can tell me what to change in my code for this new functionality as I've already implemented this functionality to store the file on my local desktop before.
Regards,
AnuragNot Required anymore.
-
Monitoring of File in FTP Server generated by background job in ECC system
Hi,
There is a background job in ECC system, which generates a file in FTP server. However the issue is that even if the background job is successfully executed, there are instances where the file is not generated in FTP server. Is there any way by which we can monitor such file in FTP Server?
Regards
Nishu ShahHi,
I guess this is not a solman question. Anyway, how do you perform the FTP?? custom code?
Cheers,
Diego. -
Running a Batch File on another Server with an Oracle Job
hi, i have the following code
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'test_job_bat',
job_type => 'EXECUTABLE',
job_action => '\\10.1.1.63\test\test.bat',
enabled => true,
comments => 'test bat'
END;
So i want to run a batch file, which lies on another pc in the network
The code runs, without a failure.
The bat file just contains "MD D:\bla" .
When i run the code, no bla directory is created, so it seems that the batch file never ran.
i approved read/write on the test folder. (Windows 7 machine)
any ideas?
Edited by: user1067632 on 31.05.2010 05:03
in dba_scheduler_job_run_details the job is listed as FAILED:
ORA-27370: Job-Unterprozess konnte einen Job vom Typ EXECUTABLE nicht starten
ORA-27300: BS-abhängiger Vorgang accessing execution agent mit Status: 2 nicht erfolgreich
ORA-27301: BS-Fehlermeldung: Das System kann die angegebene Datei nicht finden.
ORA-27302: Fehler aufgetreten bei: sjsec 6a
ORA-27303: Zusätzliche Informationen: Das System kann die angegebene Datei nicht finden.
Edited by: user1067632 on 31.05.2010 05:16ok sorry, i made my testjob run, the OracleJobScheduler was not started.
But now i ran into an another Problem.
Now i want to java bla.jar in my batch, and got that new error
ORA-27369: Job vom Typ EXECUTABLE nicht erfolgreich mit Exit-Code: Unzulässige Funktion.
STANDARD_ERROR="Unable to access jarfile start.jar"
anything to consider when accessing .jar files in my batch?
edit:
there was a classpath problem.
Edited by: ginkgo on 01.06.2010 04:29 -
Upload and download of excel file in the application server in background
Hi all,
i want to download the excel file from application server into internal table and after processing i have to upload to excel file in the application server in the background mode..
i mean i'll schedule the program in background.
im using FM ALSM_EXCEL_TO_INTERNAL_TABLE its working fine in fore ground but not in back ground.
what method i have to follow ?Hi Ankit,
I think this is not possible to open a Excel-File from the application server because the Excel format before Office 2007 where a binary format (Suffix: .xls). The newer Office file format (Suffix: xlsx) is a zipped XML Format. To read the binary Excel-Format you need an OLE Connection between SAP GUI and Office. But at the application server in background you doesn't have this OLE Connection.
In my opinion you have two possibilities:
1. Convert all files in the CSV format. This file format can be read with open dataset.
2. Upload the files from the presentation server in forground. There are some funktion modules in the standard which can read the xls format. But they have some limits regarding the length of cells content.
My recommendation is solution no. 1. If you know an VBA expert, he can write an Excel-macro which converts all Excel Files in the CSV-Fomat.
Regards
Dirk -
Opening the Excel file from Application server
Hi All,
I had uploaded an excel file on the application server for using it in my program .
But when i am opening the uploaded file on the Application server it shows some special characters and those are also displayed on my report output while reading the file from the application server.
Please suggest how to get rid of those special characters.
my open data set statement is
OPEN DATASET pg_out2 FOR INPUT IN TEXT MODE ENCODING NON-UNICODE.Hi ,
if it a Excel file ..
do the following..
OPEN DATASET pg_out2 "appl file
FOR INPUT IN TEXT MODE
ENCODING DEFAULT.
IF sy-subrc EQ 0.
DO.
READ DATASET p_infile INTO w_temp.
* Condition To check when cursor reaches End Of file
IF sy-subrc EQ 0.
PERFORM f_split_appl_data.
ELSE.
EXIT.
ENDIF.
ENDDO.
CLOSE DATASET p_infile.
ELSE.
MESSAGE 'Error in opening file' type 'E'.
ENDIF.
FORM f_split_appl_data .
SPLIT w_temp AT ',' INTO : wa_inputfile-plannum ...... "Split at , for excel or CSV file formats at appl files
APPEND wa_inputfile TO t_inputfile.
ENDFORM. " F_SPLIT_APPL_DATA
Prabhudas -
Socket blocking on read operation while uploading zip file to the server
I am trying to upload a zip file to the server
Client thread creates the zip file ( of the modified files) and it even completes writing the data to the socket stream.
Now if the server thread tries to read the same data from the stream, it blocks on read operation.
While downloding the zip file from the server works fine.
Thanks in advanceYou can use the URL object to upload it as multipart/form-data.
http://forum.java.sun.com/thread.jspa?threadID=579720&messageID=3997264
Or check out some of the file uploaders out there.
http://www.google.nl/search?hl=nl&q=site%3Asun.com+upload+applet&btnG=Zoeken&meta= -
Storing an Excel File in the Oracle Table through Oracle Form (10g)
Hi,
We have the below requirement in the Oracle Forms (10g).
Database: 11g
Application: R12
We need to provide an upload functionality to the user, so that he can upload an excel file into the form (from the local system), this is achived.
Now what we need to do is that we need to capture the path of the document (in the local system) and we need to store the document in a Oracle table.
Next we need to validate the records that are being loaded and the error records should be written into one more file and that file also we need to store in an Oracle table, this is because, i need to query this error file from the table later and need to send to the user as an e-mail.
Basically i started off with the below code just for the POC. but iam facing the error. Please help. I did not put this code in my form.
Create Table Email_Attachments(Id_Pk Integer Primary Key,Fname Varchar2(50),Image Blob);
Create Or Replace Directory Temp As 'C:\';
Create Or Replace Procedure Load_File(Pi_Id In Integer, Pfname In Varchar2) Is
Src_File Bfile;
Dst_File Blob;
Lgh_File Binary_Integer;
Begin
Src_File := Bfilename('TEMP', Pfname);
Insert Into Email_Attachments (Id_Pk,Fname,Image)
Values (Pi_Id,Pfname, Empty_Blob())
Returning Image Into Dst_File;
Dbms_Lob.Open(Src_File, Dbms_Lob.File_Readonly);
Lgh_File := Dbms_Lob.Getlength(Src_File);
Dbms_Lob.Loadfromfile(Dst_File, Src_File, Lgh_File);
Dbms_Lob.Close(Src_File);
Commit;
End;
begin
Load_File(1,'test.txt');
end;
ERROR
ORA-22288: file or LOB operation FILEOPEN failed
No Such file or directory
ORA-06512: at "SYS.DBMS_LOB", line 1014
ORA-06512: at "SYS.LOAD_FILE", line 10
ORA-06512: at line 2
How to capture the Path from which he has loaded the file?
How to Write the error records it to the file and store it in an Oracle table?
Will the below table be of use to me?
fnd_lobs_document
fnd_lobs
fnd_documents
Please share your ideas as to how to acheive this.
Thanks and Regards
SrinivasWhen you want to process the file, them it depends on the format. "Excel file" is a term that is used for a variety of file formats, mostly simple CSV, binary (true) XLS and XLSX.
So to get help you have to give us more information. Since the file is already in the db you might get better answers at {forum:id=75}. The forum has a FAQ that has a whole section {message:id=9360007}.
Regards
Marcus -
To upload a excel file to dB table through webdynpro ABAP
HI,
I am unable to upload a excel file directly by using func module "HR_KR_XSTRING_TO_STRING".
If file is in tab delimited then only, I am able to upload.
Suggest me if there are any other options to upload a excel file.Hi,
The below link gives you an explanation of how you can upload an excel file to web dynpro.
http://www.****************/Tutorials/WebDynproABAP/Upload/Page1.htm
Kindly read go through the below link, as this issue have been brought up before
http://forums.sdn.sap.com/thread.jspa?threadID=1831838
Thanks and regards.
Edited by: Suraj Ravindran Nair on Feb 24, 2012 6:24 AM -
Download Excel file through Web dynpro with no windows open?
Can we have a web dynpro application that just returns an Excel file in the response with no open windows? Similar to a java servlet that is used to download a Excel file?
This basically means that I cannot use wdComponentAPI.getWindowManager().createNonModalExternalWindow()
Java Servlet Code
HttpSession session = request.getSession(); // get a handle on the session id
response.setContentType("application/download");
response.setHeader("Content-Disposition", "filename=RTIS_Report.xls");
PrintWriter out = null;
out = response.getWriter();
String report = request.getParameter("REPORT");
JCO.Table lines = download(request, session, report);
for (int i = 0; i < lines.getNumRows(); i++) {
lines.setRow(i);
String content = lines.getString("LINES") + "\n";
out.write(content);
out.flush();
out.flush();
out.close();Hi,
I think you can use IWD Cached Web Resource to achieve this..
See the below code FYI..
public void downloadToExcel( )
String fileName = "Customer" + ".xls";
IWDCachedWebResource cachedExcelResource = null;
try
File f = new File("Customer.xls");
WritableWorkbook workbook = Workbook.createWorkbook(f);
WritableFont black = new WritableFont(WritableFont.createFont("Trebuchet MS"),WritableFont.DEFAULT_POINT_SIZE,WritableFont.BOLD,false,UnderlineStyle.SINGLE,Colour.BLACK);
WritableCellFormat blackFormat = new WritableCellFormat(black);
WritableFont blue = new WritableFont(WritableFont.createFont("Trebuchet MS"),WritableFont.DEFAULT_POINT_SIZE,WritableFont.NO_BOLD,false,UnderlineStyle.NO_UNDERLINE,Colour.BLUE);
WritableCellFormat blueFormat = new WritableCellFormat(blue);
WritableSheet sheet = workbook.createSheet("Customer", 0);
Label label;
String[] header={"Corporate Code","Batch ID"};
for (int i=0;i<2;i++)
label = new Label(i,0,header<i>.toString(),blackFormat);
sheet.addCell(label);
WritableCellFormat integerFormat = new WritableCellFormat(NumberFormats.INTEGER);
jxl.write.Number number;
// Reading the contents
for(int i=0;i<wdContext.nodeVn_DownloadToExcel().size();i++)
String strCorpName = wdContext.currentContextElement().getVa_CorpCode();
String strBatchID = wdContext.nodeVn_DownloadToExcel().getVn_DownloadToExcelElementAt(i).getVa_BatchID();
label = new Label(0,i+1,strCorpName,blueFormat);
sheet.addCell(label);
label = new Label(1,i+1,strBatchID,blueFormat);
sheet.addCell(label);
workbook.setColourRGB(Colour.LIME, 0xff, 0, 0);
workbook.write();
FileInputStream excelCSVFile = new FileInputStream(f);
IWDCachedWebResource cachedWebResource = null;
if (excelCSVFile!= null)
cachedWebResource = WDWebResource.getWebResource(excelCSVFile, WDWebResourceType.getWebResourceType("xls","application/ms-excel"));
cachedWebResource.setResourceName(fileName);
cachedExcelResource = cachedWebResource;
wdContext.currentContextElement().setVa_DownloadToExcel(cachedExcelResource.getURL());
workbook.close();
catch (Exception ex)
wdComponentAPI.getMessageManager().reportException("Error in Excel Download"+ex.getMessage(),false);
Regards,
Vijay
Maybe you are looking for
-
How to capture the parameter value of Concurrent Program submited
Hi, I would like to capture the Parameter value of Concurrent Program submitted through Submit Request screen based on that i want to return value. When Conc prog "Payroll Run" along with parameter like "Pay Period" which has LOV attached to it, whic
-
How can i set/alter control properties programmaticaly in manage bean?
Hi, i want to enable a selectonechoice on click of a button in adf.how can i do this using code in managebean. my jdev version is 11.1.1.5.0
-
Solution Manager Create remote monitoring entry
Hello, I need some help or clarification please. We just upgraded our Solution Manager to EHP1 spk25 and I'm trying to setup Solman to support central system monitoring. I'm on the last step to enter the moitored ABAP system in CEN through RZ21 Tech
-
Integrate CRM 4.0 and EP6 SP2
Hi, Can anyone let me know the steps to integrate CRM 4.0 with EP6 SP2 on windows 2003 server. Thanks in advance, regards, Payal
-
Should we use same datasource for Internal connection and Save Point ?
Hi, AM configuration has an internal db connection setting, adf-config.xml also has an db connection setting for Save Point, should we all set to the same database source of the system or should we create a seperate datasource which is used only for