cancel
Showing results for 
Search instead for 
Did you mean: 

zip uploaded documents from user

Former Member
0 Kudos

We have some documents that the user occasionally uploads to a quotation in ISA for individual line items. I need to take these documents, zip them to save memory and pass them along to a 3rd party document management system.

Does anyone know if there is any functionality in either the Java side of ISA or R/3 (or CRM) to zip files? I've looked for function modules on the R/3 - CRM side and haven't found anything. I'm new to Java and ISA and I am not very familiar with what is available there.

Thanks,

Brent

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Brent,

I've had to deal with plenty ZIP stuff on the SAP Portal but my requirements where a little different (BUT I hope it helps you somehow...)...you see suppliers uploading data into our SAP system often had slow lines and connection timeouts would occur etc. So what I did was I allowed them to ZIP their Excel files etc on their side and then upload them via the Portal...thereafter I would unzip them in code and pump them into SAP...here is some sample code to show you the libraries I used...may help you...

....

import java.io.File;

import java.io.IOException;

import java.io.InputStream;

import java.util.Enumeration;

import java.util.zip.ZipFile;

import java.util.zip.ZipEntry;

import java.util.zip.ZipException;

....

public InputStream unzip(File file) throws ZipperException{

....

ZipFile zf = new ZipFile(file);

....

Enumeration e = zf.entries();

ZipEntry ze = (ZipEntry)e.nextElement();

return zf.getInputStream(ze);

....

}

So what you can do is once you get the file on the server side you can use the objects in the "java.util.zip.*" package to zip the file and then use some "file manipulating" objects to then move this zip file to another directory etc on the document management systm side.

I could also help you do a similar thing if you where working with BSP's and ABAP but you asked for Java advice....

Let me know what you end up doing

Chow

Lynton

Former Member
0 Kudos

Many thanks for your reply Lynton,

I've been reading the documentation on the java.util.zip package and that seems to make the most sense for this application. I did stumble over some ABAP functionality but for this requirement, I think it's cleaner to upload the files to the server, use the java functionality to zip them and pass them off to the 3rd party stuff via some, yet to be provided API. Then all we'll need to do is retrieve the url for the document and store it somewhere on the sales document for retrevial later.

Thanks again for the help

Regards,

Brent