Output of Electronic Documents as a Structured ZIP File

by Jürgen Gotthardt

Recently, one of our customers requested help with sending electronic documents as a structured ZIP file, where the folder structure of the ZIP file corresponds to the BOM structure. You’ll see how we accomplished this in the following application.

The customer’s SAP system contains multi-levelBOMs for electronic devices, such as:


— 4.xxx-xxx Circuit board

——-6.xxx-xxx Electronic hardware component 1

——-6.xxx-xxx Electronic hardware component 2

——-6.xxx-xxx Electronic hardware component 3

——-6.xxx-xxx Electronic hardware component 4

——-6.xxx-xxx Electronic hardware component 5

Diverse electronics documents may be attached to every material number in the BOM. Our customer wanted tohave these documents put in a ZIP file where the folder structure of the ZIP file corresponds to the BOM structure.

To do this, we developed a userexit that detects the progression of the material numbers of every document and takes over this progression as parameter in the order. The output script creates the corresponding directories for each level. The documents are stored there, and then a ZIP file is created. For the actual zipping method, the output script uses the Perl Module Archive::Zip.

The result looks like this:
Verzeichnisstruktur Output of Electronic Documents as a Structured ZIP File
Notes on the structure:

  • The ZIP file2.816-192.0.zip was created for user AW03464
  • The directory at the highest position has exactly the same name as the ZIP file.
  • At the second level, there are three directories for the relevant material numbers; the second of these material numbers has an additional subdirectory, containing the found originals of the linked document info records.
  • If several document info records are linked, their originals are stored in the same directory (material number).
  • The original filename will be used as the filename (KPRO_DOCFILE).
  • The originals may represent various application types. For example, a JT and a STEP file were also created along with the PDF file.


In this way, we fulfilled our customer’s request with relatively little effort.


Leave a Reply

Your email address will not be published. Required fields are marked *

* = Required field

  • Blog Categories

  • Jürgen Gotthardt

    In his capacity as Account Manager, Jürgen Gotthardt is out and aboutconsulting on - and marketing - solutions for SAP.His main focus are the illustration and optimization of document based SAP business processes. In his personal life, his great passion is football.
    juergen.gotthardt@sealsystems.de |
    +49 6154 637-373

  • Next Events

    1. PDF Days Europe 2021

      27. September 2021 - 29. September 2021