Back to Blog
engineering||10 min read

SAP Hybris Impex When None of Us on the Team Can Read It

AR
Aral Roca

Creator of Kitmul

A workstation with code on screen and a developer reviewing an SAP Hybris Impex import script
A workstation with code on screen and a developer reviewing an SAP Hybris Impex import script

I'm currently embedded as an external on a team that uses the Hybris Management Console — HMC for short — to administer a SAP Commerce environment. Every few days the shared environment gets refreshed from production, which is exactly what you want for most of the data, and exactly what you don't want for half-finished configuration that hasn't made it to prod yet. A content type you registered on Tuesday, a workflow tweak from Wednesday, a test user you needed for a demo — gone by Friday morning. Everyone on the team has been through this loop enough times that they've stopped being surprised.

Impex is the natural answer. If you can describe a configuration change as an Impex file, you can replay it after every refresh, commit it to the repo, code-review it, and treat it like the rest of the platform. That is the official playbook and it is the right one.

The problem is more human than technical. Nobody on the team reads Impex fluently. The format predates most of the languages the team writes every day, the tooling around it is sparse, and a pull request that is sixty lines of semicolon-separated text doesn't exactly invite careful review. So people would rather click through the HMC, accept that the work will evaporate in a few days, and move on. Knowing this fixes itself with tooling, not with a training session, I spent a week building the eight browser tools this post is about.

What Impex is, in one paragraph

Impex is a plain-text scripting format SAP Commerce uses to insert, update, or remove rows in the platform's type system. Every Hybris object — Product, Catalog, Category, PriceRow, User, Customer, Order — is a Java-defined type, and Impex is how you push data at those types without writing Java. A file is a sequence of "blocks," each with a header line declaring a mode and type (INSERT_UPDATE Product;code[unique=true];name) followed by semicolon-separated data rows (;P-0001;My Product). Comments start with #. Macros start with $. Qualifier paths go inside parentheses: catalogVersion(catalog(id),version). The official Impex interpreter reference is the authoritative spec.

That is the entire language. It is genuinely small. What makes it hard to read is not the grammar; it's that it's a tabular format displayed in a text editor, without column alignment, without syntax highlighting, without any of the affordances you'd want for reviewing a spreadsheet.

Why HMC plus a periodic refresh forces this conversation

There is a recurring pattern in SAP Commerce projects: you have one production-like environment shared across product, QA, and engineering. To keep it close to reality, someone runs a refresh from production on a schedule — weekly, bi-weekly, overnight. That refresh is non-negotiable; it's how bugs get reproduced. But it means every configuration change that lives only in HMC has a half-life.

There are three ways out and only one of them scales.

Option one: stop doing the refresh. You immediately drift from production, QA starts missing real bugs, the refresh comes back, and you've lost a month.

Option two: ask people not to click in HMC. This is a social contract that lasts about a sprint. The tool is there, it works, deadlines exist.

Option three: every change goes into version control as an Impex file and is replayed after each refresh. This is the answer the platform has always wanted you to pick. It's also the one that requires your team to be comfortable reading and writing Impex, which brings me back to the opening of this post.

The eight tools

Retail catalog shelves; Impex is the plumbing behind every product tile you see in a SAP Commerce storefront
Retail catalog shelves; Impex is the plumbing behind every product tile you see in a SAP Commerce storefront

Everything below runs locally in your browser. Nothing is uploaded. The parser is a ~550-line TypeScript module that handles quoted fields, escaped semicolons, line continuations, macros, modifier blocks, and multi-block files. If you find real-world Impex this parser can't handle, I'd like to see it.

Impex Table Editor

This is the one that does the heavy lifting on my team. Paste a block, get a spreadsheet-style grid, edit cells inline, add or remove rows, copy the regenerated Impex back out. When the person writing the change doesn't read Impex but does read Excel, this is the bridge. It is also the tool I reach for first when I need to make a ten-row change without scrolling through semicolons.

If nothing else in this post sticks, the table editor is the one to bookmark.

Impex to CSV Converter

Turns any Impex block into CSV, one header per column. Useful when someone from content wants to see the current state of a catalog section in a spreadsheet without waiting for an engineer.

CSV to Impex Converter

The reverse: a CSV (often pasted from Google Sheets) becomes an Impex script, with the type name and unique column selected explicitly. Product people can draft the change in Sheets, the engineer converts it and commits. The review diff stays reviewable.

Impex to JSON and JSON to Impex

JSON is the lingua franca of everything that isn't Impex. If you're scripting a migration, generating Impex from a source of truth, or diffing two versions, a structured representation is easier than regexing semicolons. Each block becomes {mode, type, headers, rows}, macros are first-class, and the two tools round-trip so you can edit the JSON and convert back. A swap button at the top of each page flips the direction.

Impex Validator / Linter

Reports missing type names, unknown modifiers, duplicate unique keys across data rows, undefined macros, and column-count mismatches. None of these are exotic errors — they are all things SAP's interpreter will accept and then silently produce a bad import for. Adding this as a CI check on .impex files is the single highest-leverage change a team using Impex in version control can make.

Impex Macro Expander

Given an Impex file with $macros, produces the same file with every reference inlined. Fixed-point expansion, so macros that reference macros resolve cleanly. This is what you commit into an audit artefact. Auditors are not going to chase $macros through your repo.

Impex to SQL (Approximate)

Hybris abstracts over the database. Sometimes that abstraction leaks — a DBA asks what's actually being written, or you're reasoning about performance. This tool flattens Impex into approximate INSERT / UPDATE / DELETE in Postgres, MySQL, or ANSI-standard SQL, with INSERT_UPDATE rendered as ON CONFLICT / ON DUPLICATE KEY / MERGE depending on dialect. It is explicitly approximate; qualifier paths like catalogVersion(catalog(id),version) can't be rendered faithfully as joins without your items.xml. But for a mental model conversation, it's faster than spinning up a local Hybris and watching the query log.

A developer's laptop showing terminal output; most Impex work happens at the boundary between code and the platform console
A developer's laptop showing terminal output; most Impex work happens at the boundary between code and the platform console

The workflow I'm pushing on my team

Short version, ordered by ROI.

Impex goes both ways: dump what you did in HMC into a .impex file, or edit .impex and import to skip HMC entirely. HMC is slow for configuration — a twenty-field form is tedious the third time you touch it. For anything repetitive or bulk, writing the Impex directly and running the import is several times faster than clicking. And whatever you did have to do in HMC gets exported to .impex so it survives the next refresh.

Non-trivial edits happen in the Table Editor. Flat-editor Impex is fine for adding one column or flipping a flag. For anything with more than a handful of rows, the table editor is correct and the flat editor is not.

Run the Impex Validator before every import. This is 90% of the value of the tooling in this post. It catches duplicate unique keys, unknown modifiers, and undefined macros before SAP's interpreter silently accepts them and produces a bad import. Right now we pass it by hand over each .impex before running the import; not automated, but it catches most of the surprises.

Diffs are done on JSON. Convert both versions of a file to JSON via Impex to JSON and diff that. Row-level semicolon diffs are unreadable; structured diffs are not.

Macros are expanded in audit artefacts. Commit the compact form. When compliance asks what the deployment actually did, hand them the expanded version.

What still bites

Not every Impex problem has a browser-tool answer.

Type-system evolution is the big one. When somebody renames a field in items.xml, every Impex file referencing the old name silently starts writing to the wrong column or failing in confusing ways. No linter in the browser can catch this without access to your specific type definitions. A small project-local script that walks your .impex files and cross-references attributes against the current type system is worth a weekend. I haven't shipped one because every team has a different setup.

Performance is the other. Large Impex imports behave differently from bulk SQL loads — the interpreter validates every row, triggers platform events, and invalidates caches. If a million-row import takes six hours, the fix is almost never "tune the database." It's "split the file and import in parallel" or "disable cache eviction during the load." The SAP Commerce performance documentation covers this well.

Why I built this and not something else

The honest answer: my team (myself included) was not going to learn to read Impex by reading more Impex. Documentation didn't fix it. Pair programming didn't fix it. The bet was that handing someone a spreadsheet UI over an Impex block and saying "edit this like you'd edit anything else, the tool will write the Impex for you" might lower the barrier enough for Impex to become a format the team treats like CSV — a transport representation that happens to be how SAP Commerce wants the data, not a language they need to master.

Will this actually work? I don't know yet.

I want to be straight about where I am with this. These tools exist because my team is trying to answer a bigger question: can configuration-as-code via Impex replace clicking through HMC, long-term, for a team that isn't fluent in Impex? The tools are a bet on "yes." They are not proof.

There are a few ways this experiment could fall apart. Maybe the table editor is fine for 80% of edits but the remaining 20% — the ones involving nested qualifier paths, macros that reference other catalogs, modifier subtleties — still push people back to HMC and the discipline erodes. Maybe writing Impex is the easy part and the hard part is the CI pipeline that actually replays the scripts after a refresh, which is not what this post is about. Maybe the type system evolves faster than the tooling can keep up and the validator starts producing noise people learn to ignore. Any of these would mean "infrastructure-as-code in HMC via Impex" isn't really the right framing, and we need a different abstraction.

I'll write a follow-up in a few months once there's real data. Either these tools become the default path and configuration-as-code works the way SAP always wanted it to, or we learn something interesting about why it doesn't, and that's its own post. I don't have a strong prior either way.

If you're running SAP Commerce with the same HMC + refresh setup and you want to try something similar, the tools are free, local, and will keep working regardless of what I conclude. Bookmark the ones that fit your workflow. If you end up with your own data — positive or negative — I'd like to hear it.

For the ecosystem context: the SAP Help ImpEx documentation is the canonical reference, the SAP Commerce community forums are better than Stack Overflow for version-specific questions, and the Gartner Magic Quadrant for Digital Commerce covers where SAP Commerce sits in the broader enterprise ecommerce landscape.

More in a few months.

Share this article

Newsletter

Get Free Productivity Tips & New Tools First

Join makers and developers who care about privacy. Every issue: new tool drops, productivity hacks, and insider updates — no spam, ever.

Priority access to new tools
Unsubscribe anytime, no questions asked