Hello,
We are experiencing problems to open attached ZIP files in SAP purchasing documents (Purch Reqs & POu2019s) that are stored in our Content Server.
The currently allowed document types according to ArchiveLink configuration are PDF, DOC; XLS, PPT, TIF, and ZIP. There are no problems while opening any document type, but for ZIP files.
The problem appears when we call standard SAP Bapi ARCHIVOBJECT_GET_URI from a customized function module (ZMM_LINK_DOCUMENTS_CS) in an external application to get the ZIP file from content server, and convert it into a binary coding, that can be read from our external application. System is not able to open Zip file.
Could you help us?
Thanks in advance,
Angel.
Request clarification before answering.
Hi,
please try following:
there is a class called cl_abap_zipper. Its very handy to use. Try to get the files in the zip within this
class.
If you may get the content of the zip file in form of an internal table based on the knowledge provider structure sdokcntbin, the following coding may help:
on_initialization:
data:
file_content_binary type sdokcntbin,
file_content_binaries
type table of sdokcntbin.
bytes_rest type i.
bytes_rest = file_size.
describe field file_content_binary-line length line_length in byte mode.
loop at file_content_binaries assigning <file_content_binary>.
move <file_content_binary>-line to data.
if bytes_rest <= 0. "mismatch between line values and size
exit.
endif.
if bytes_rest >= line_length.
call method server->response->append_data( data = data
length = line_length ).
else.
call method server->response->append_data( data = data
length = bytes_rest ).
endif.
bytes_rest = bytes_rest - line_length.
endloop.
Best regards,
Stefan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
Thanks for your faster reply.
I think, i can this code in BSP page, but, with this funcion I only return the URL generate to asp application. This application call to Content Server and explorer navigator show the file (.tiff, .doc).
To zip show file, have I create a new bsp page?.
Thanks in advance,
Angel.
Hi Angel,
send me more Details and i can deliver you a code snippet.
Best regards,
Stefan
PS: don't hesitate to contact me via stefan.riedel-seifert @ infoserve.endress.com
(condense this to get the right address)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Stefan,
We have a Bapi ZMM_LINK_DOCUMENTS_CS that has how input parameters a document number (ebeln, Banfn).
With this parameters we call function ARCHIVOBJECT_GET_URI with corresponding bus (bus2105 or bus2012). This function module retruns a URL and we return this URL to .NET aplication.
This morning i have looking new parameter for ContentServer.dll and I have seen downloadAs parameter. If you add this parameter with downloadAs = .ZIP then explorer opens zip fily correctly.
Thanks for all.
Angel.
Hi,
I am having the same issue with Excel file. I have also added downloadAs=.XLS parameter to my URL. Please look into the URL below:
Let me know what I am missing.
Thanks,
| User | Count |
|---|---|
| 7 | |
| 5 | |
| 4 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.