SAP, MS Office, PDF, Web Automation & more

SAP, MS Office, PDF, Web Automation & more — Konrad Chmielinski
Engineering Blog · Konrad Chmielinski

End-to-end process automation across every surface an enterprise runs on — from SAP transactions and Excel workbooks to email workflows and web portals.

RPA Engineering SAP · Excel · PDF · Email AA A360 · Python · Selenium Katowice, PL · Remote OK

Enterprise automation is not about one system — it is about connecting all of them. A single business process might read data from SAP, consolidate it across Excel workbooks, generate a PDF report, send it by email, and upload the result to a web portal — all in sequence, all without a human in the loop. Building that chain reliably is the real job.

Over 4+ years I have built and maintained production automation across every surface type that enterprises actually run on. This post covers the full platform stack in depth — SAP, MS Office, email, PDF, web, and specialist portals.

SAP automation

the enterprise core

SAP is the operational backbone at ArcelorMittal — HR, finance, procurement, and logistics all live there. Automating SAP means navigating transaction codes, reading and writing field values, executing reports, and handling session state across long-running bot runs. I work with two distinct approaches depending on what access is available.

SAP GUI Scripting simulates user interaction at the GUI layer — opening transactions, filling fields, clicking buttons, reading output screens. It works across all SAP modules without requiring any special access beyond a normal user account. The tradeoff is fragility: screen layouts must be consistent, and session timeouts need explicit recovery logic.

PyRFC / BAPI calls bypass the GUI entirely and call SAP function modules directly via the Remote Function Call interface. This is significantly faster and more robust for high-volume data operations, but requires RFC access to be granted by SAP basis — which is not always available. Where it is, I prefer it strongly over GUI scripting.

GUI layer
SAP GUI Scripting
Python-driven session management, transaction navigation, field-level data entry and extraction. Works universally across SAP modules.
Direct calls
PyRFC / BAPI
Direct SAP function module calls via RFC. Faster and more robust than GUI scripting for bulk data operations.
RPA layer
AA A360 SAP package
Automation Anywhere native SAP actions for complex multi-transaction flows within orchestrated enterprise workflows.
Reporting
SAP report extraction
Automated execution of SAP standard and custom reports, extraction to file, and handoff to downstream processing pipelines.
# SAP GUI scripting session pattern with timeout recovery
import win32com.client

sap = win32com.client.GetObject( “SAPGUI” )
app = sap.GetScriptingEngine
conn = app.Children(0)
session = conn.Children(0)

session.findById( “wnd[0]/tbar[0]/okcd” ).text = “/nPA30”
session.findById( “wnd[0]” ).sendVKey(0)
# Navigate to HR master data transaction
At ArcelorMittal (Global HRS): four bots automate HR contract generation — reading structured data from financial and entity documents, navigating SAP HR transactions, and performing data entry for employee contracts across global business units. Session timeout recovery and transaction error handling are production-critical for overnight unattended runs spanning multiple time zones.

MS Office — Excel, Word, Outlook

the universal business layer

Regardless of how modern an organisation’s core systems are, the business layer almost always runs on Excel, Word, and Outlook. Automating here means handling the full lifecycle of each format — reading, transforming, generating, and distributing — often across files that were built incrementally over years with no consistent structure.

Excel is the most common automation surface I encounter. I work with it at every level: pure Python libraries (openpyxl, xlrd, xlsxwriter) for headless processing, pandas for data transformation and consolidation, and win32com for cases where Excel formulas, pivot tables, or VBA-dependent formatting must be preserved. Multi-sheet workbooks with inconsistent column headers, merged cells, and embedded charts are routine production inputs — not edge cases.

# Multi-sheet, multi-file Excel consolidation (AM global forecasting)
import pandas as pd
from pathlib import Path

frames = []
for f in Path( “bu_reports/” ).glob( “*.xlsx” ):
  xls = pd.ExcelFile(f)
   for sheet in xls.sheet_names:
    df = xls.parse(sheet, header=2) # headers not always row 1
    df[ “source_unit” ] = f.stem
    frames.append(df)
master = pd.concat(frames, ignore_index= True )

Word document generation is a key output layer for HR and compliance workflows. I use python-docx to generate contracts, reports, and formal documents from structured templates — populating placeholders, inserting tables, and applying consistent formatting. For complex documents that require preserving native Word formatting, win32com drives Word directly.

openpyxl pandas Excel I/O xlrd / xlsxwriter win32com (Excel / Word) python-docx VBA (migration source) AA A360 Excel package Template-based generation Multi-sheet consolidation Pivot table automation
VBA to Python migration (ArcelorMittal): migrated two legacy VBA bots to Python to comply with new company standards — reverse-engineering years of undocumented macro logic embedded across multiple modules, rewriting in maintainable Python with proper error handling, and integrating with modern CI/CD pipelines while preserving identical output for downstream stakeholders.

Email automation — inbound & outbound

trigger, parse, respond, dispatch

Email is both a trigger and a delivery mechanism in many enterprise automation workflows. I work with email in both directions — monitoring inboxes for incoming requests that kick off a process, and dispatching structured output at the end of a pipeline to the right recipients with the right attachments.

Inbound email processing involves monitoring a shared mailbox, parsing subject lines and body content to classify the request type, extracting attachments for downstream processing, and routing the email to the appropriate workflow branch. At ArcelorMittal Luxembourg, incoming client inquiry emails triggered the entire AI offer generation pipeline — the bot read the email, retrieved matching historical orders, generated a personalised proposal via GPT-4o, and dispatched the reply automatically.

Outbound email dispatch is the final step of many pipelines — sending run summary reports to process owners, distributing generated PDF reports to stakeholders, alerting on exceptions, and delivering automated client responses. I use Microsoft Graph API as the primary email channel (OAuth2, no SMTP credentials required), with win32com Outlook automation as a fallback for on-premise environments.

Primary API
Microsoft Graph API
OAuth2-authenticated mail send and receive. Read shared mailboxes, parse attachments, send with attachments. No SMTP credentials needed.
Fallback
win32com Outlook
Drive Outlook directly via COM automation for on-premise environments without Graph API access.
Legacy / simple
smtplib / imaplib
Standard Python email libraries for lightweight send/receive where modern API access is not available.
Parsing
email / mailparser
Subject, body, and attachment parsing from raw MIME messages. Classification logic to route to correct workflow branch.
Inbox monitor
Graph API poll
Parse & classify
subject / body / attach
Route
workflow branch
Process
pipeline execution
Dispatch reply
Graph API send
At ArcelorMittal Luxembourg (AI Offer Generation): the entire pipeline was email-triggered. Incoming client inquiry → Graph API read → attachment and body parsing → historical order retrieval → GPT-4o inference → personalised proposal generation → automated email reply via Graph API. No human in the loop from trigger to dispatch.

PDF automation

extraction & generation

PDF automation splits cleanly into two directions. Extraction means reading structured data out of existing documents — research reports, invoices, contracts, identity documents. Generation means producing formatted, submission-ready output from data — compliance reports, HR documents, run summaries.

Extraction
pdfplumber / pdfminer
Layout-aware text and table extraction from digital PDFs. Used for structured field extraction from research and financial documents.
Extraction
PyPDF2 / pypdf
Metadata reading, page splitting and merging, lightweight text extraction from machine-readable PDFs.
Generation
ReportLab / FPDF2
Programmatic PDF generation from structured data. Used for compliance reports, HR documents, and pipeline output summaries.
Scanned PDFs
Azure OCR + Pillow
For image-based PDFs: rasterise pages with Pillow, pass to Azure OCR for text extraction before structured processing.

Web & portal automation

portals, scraping, authenticated flows

Web automation covers authenticated internal portals, external data sources, and specialised industry systems. At ING, bots interacted with IRIS — a financial security monitoring portal — loading data, retrieving records, and generating output files for the KYC compliance pipeline. At ArcelorMittal, the compliance reporting workflow automated SARA and REX , two workplace safety portals used for collecting incident documentation — downloading records, uploading processed data, copying information between systems, and generating regulatory report files.

None of these portals expose a public API. All interaction is engineered through the browser layer using Selenium with explicit wait strategies, session management, and retry logic to handle the inevitable timeouts and page state changes that occur in long unattended runs.

Selenium (XPath / CSS selectors) BeautifulSoup Python requests + session handling IRIS (ING financial security portal) SARA (AM safety reporting) REX (AM accident documentation) AA A360 browser actions File download / upload automation Explicit wait strategies Session refresh logic

Desktop & GUI automation

legacy Windows apps

For legacy Windows applications with no web layer and no API, I use UIAutomation (Windows accessibility tree) as the primary approach — robust to resolution and DPI changes — with PyAutoGUI as a last resort for applications that expose no accessibility interface. At ING, I built and delivered a GUI bot on SAIO, ING’s proprietary RPA platform, and ran training sessions to promote wider team adoption.

UIAutomation PyAutoGUI SAIO (ING proprietary) Automation Anywhere A360 Windows accessibility tree Screen element detection

RPA platforms

what I use and where
Platform Employer Experience Primary use
Automation Anywhere A360 ArcelorMittal BCoE 2+ years Bot development, orchestration, scheduling, credential vault
Automation Anywhere A11 ArcelorMittal BCoE Legacy maintained Legacy bot maintenance and migration to A360
SAIO ING Hubs Poland 1+ year GUI bot development, team training, internal process automation
UiPath Certification Foundation certified RPA Developer Foundation v2021.10
Python standalone Both employers 5+ years Lightweight bots, ETL scripts, migration target for legacy VBA

Full stack

everything I use
SAP GUI Scripting PyRFC / BAPI Automation Anywhere A360 / A11 openpyxl / pandas / xlsxwriter python-docx Microsoft Graph API win32com (Excel / Word / Outlook) Selenium + XPath pdfplumber / ReportLab UIAutomation SAIO BeautifulSoup PyAutoGUI smtplib / imaplib Azure OCR + Pillow PyPDF2 / pypdf FPDF2 Jenkins CI/CD Git Pydantic

About the Author

Leave a Reply

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

You may also like these