Skip to content

leriart/SapCap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SapCap

SapCap (SAP Capture) is a GUI tool for automating the capture, mapping, and digitization of data from PDFs directly into SAP GUI

Features

  • Interactive PDF Viewer — Navigation, zoom, rectangular selection of areas for data extraction.
  • Visual Mapping — Define extraction areas (absolute rectangle, anchor-based, or regex per page) and assign them to profile fields.
  • Smart Search — Automatically locate sections in the PDF using anchor text.
  • Digitization — Extract data from multiple PDFs using reusable mapping profiles.
  • Advanced Fuzzy Matching — Smart fuzzy string matching for materials/codes with stop-word handling, alphanumeric code detection, and type penalties.
  • Name ↔ ID Database — Load Excel/CSV files to auto-complete IDs from names.
  • SAP Execution — Automate SAP transactions via COM, including table filling, navigation, status bar handling, and retries.
  • Automatic Renaming — Rename digitized PDFs by extracting IDs from the SAP status bar.
  • Exportable Profiles — Save/load JSON profiles with fields, tables, sequences, mappings, conditions, and quick buttons.
  • Drag & Drop — Drag PDFs directly onto the interface.
  • Themesttkbootstrap UI (default theme: superhero).

Requirements

  • OS: Windows (requires win32com.client for SAP GUI)
  • SAP GUI installed and configured
  • Python: 3.11+
  • Dependencies: See requirements.txt

Installation

# Clone
git clone https://github.com/yourusername/SapCap.git
cd SapCap

# Create virtual environment
python -m venv venv
.\venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run
python SapCap.py

How to Use

1. Profile

  • Go to the Profile tab and define fields, tables, and SAP step sequences.
  • Save the profile as JSON (Ctrl+S).

2. PDF

  • On the Main tab, load one or more PDFs.
  • On the PDF tab, select extraction areas in the viewer and assign them to profile fields.

3. Digitize

  • Click Digitize to extract data from mapped PDFs.
  • The extracted data appears in the Data tab.

4. Execute in SAP

  • With data ready, click Execute SAP to automate SAP GUI filling.

5. Name ↔ IDs (Optional)

  • Load an Excel/CSV file with two columns (Name, ID) to auto-complete IDs.

Full Guide

Project Structure

SapCap/
├── SapCap.py              # Main application source code
├── requirements.txt       # Python dependencies
├── pyproject.toml         # Project metadata
├── SapCap.spec            # PyInstaller spec file
├── build_exe.py           # Helper script for building
├── README.md              # This file
└── LICENSE                # MIT License

Data directories (auto-created at runtime)

~/SAPAutomation/
├── Profiles/     # JSON profile files
├── PDFs/         # Input PDFs
├── Exports/      # Data exports
├── Templates/    # Profile templates
└── Databases/    # TXT/CSV/XLSX databases

Core Dependencies

Package Purpose
ttkbootstrap Modern themed UI
PyMuPDF PDF reading and extraction
pandas Data handling and Excel/CSV
fuzzywuzzy Fuzzy string matching
python-Levenshtein Fuzzy matching speed-up
Pillow PDF page rendering
pywin32 COM Automation for SAP GUI
tkinterdnd2 File drag & drop

License

MIT — see LICENSE.


Created by Leriart — SAP automation made easy.

About

SapCap (SAP Capture) is a GUI tool for automating the capture, mapping, and digitization of data from PDFs directly into SAP GUI

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Contributors

Languages