Kocak Solutions Logo
Back to overview

WWI templates in SAP Product Compliance: 5 pitfalls and how to avoid them

Hidden coding, reused group numbers, shifting G positions: five common mistakes in SAP WWI templates and how to avoid them reliably.

Isometric illustration: WWI template as a document with visible layout and a hidden coding layer beneath it, surrounded by warning symbols

With SAP WWI (Windows Wordprocessor Integration), SAP Product Compliance generates safety data sheets, labels and transport documents from specification data. In many companies, the WWI templates behind them have grown over years: several countries, many languages, adjustments for every new regulation. Most errors do not happen when a template is built, but when an existing one is changed in small ways. Here are the five pitfalls we run into most often in practice.

What is SAP WWI?

WWI is the reporting technology of SAP Product Compliance. It is based on a report template: a Word document that contains the layout and fixed text, plus placeholders, called symbols, for the variable content. Templates are maintained and released in SAP (transaction CG42).

During report generation, a WWI server, a Windows machine running Microsoft Word, fills the symbols with data from the specification: characteristic values, phrases, identifiers and parameters from the calling application. Which countries and languages a report is created for is defined by the generation variant. The result is a finished document, for example a safety data sheet, which can be released and sent to customers via SDS shipping.

The logic of a template, meaning which data appears where and under which conditions, lives entirely in the WWI coding. That is exactly where the following pitfalls lie.

1. The WWI coding is invisible

A WWI template is a Word document. The visible text is layout and fixed output; the actual logic sits in the document as hidden text: symbols, repeating groups and conditions. That leads to two traps:

  • A plain text export does not help. It mixes coding and output text. Anyone analysing a template has to look at the hidden and visible parts separately.
  • Word splits symbols into several pieces internally, for example through spelling and revision markers. A symbol such as <11BRG229(...)> is often not stored in one piece, so a text search simply does not find it.

A third trap concerns formatting: if the coding has the same black font as the output text, you can no longer see where coding ends and output begins, even with hidden text displayed. Paragraphs between two tables that contain nothing but coding are particularly tricky. If the paragraph mark is formatted as hidden too, the whole paragraph disappears from the finished document, and the second table attaches directly to the first. A fixed convention helps: always format coding in a distinct colour and keep a visible paragraph between two tables.

The reverse applies when comparing two template versions: differences in styles and document settings are almost always technical noise with no effect on the output.

2. Group numbers and comments are not a reliable guide

Repeating groups (BRG/ERG), conditions (BIF/EIF) and named groups (BNG/ENG) carry numbers. These numbers are not unique: the same number, such as BRG229, often appears several times in one template for quite different purposes. Anyone who looks for a block by its number alone can easily change the wrong place.

The *** … *** comments are not a reliable guide either. They are often missing or describe an earlier state. Only two things can be relied on:

  • Determine block boundaries by the tag pairs. Every BRG, BIF and BNG needs its counterpart in the correct nesting. If one is missing, generation fails.
  • Identify blocks by their content, that is, by the value assignment type in the group call or the phrase key in the condition.

3. Country logic in WWI templates is not where you expect it

A value assignment type named after a country does not make it a country filter. In practice, such a block often runs for every country, because no validity area check precedes it.

Real country logic sits elsewhere:

  • in conditions that compare validity areas or ratings,
  • in method calls whose name contains a country code,
  • in type G repeating groups, which group by validity area and language.

To capture a template’s country dependency completely, check all three, plus the rating and usage in the generation variant (transaction CG2B). Anything that cannot be resolved from the template alone, such as the logic of custom methods, belongs on the list as an open point rather than being guessed.

4. Type G repeating groups: positions shift silently

This is the pitfall with the most unpleasant consequences. In a repeating group, the value after the semicolon is a restriction, for example (G;5-*) or (G;10-16). This number is not a key but a sequence number within the result set. For type G groups, that set is the list of validity area and language combinations in the generation variant.

NotationMeaning
;*all entries
;1the first entry only
;5-*from the fifth entry to the last
;10-16the entries at positions 10 to 16

If a combination is added, removed or reordered in the generation variant, every position after it shifts. The template then prints content for the wrong countries or languages, without any change to the coding and without an error message.

The robust alternative is named filters, which bind to content instead of positions:

<11BRG125(G,T:REGION,L:DE;*)>   German only, validity area type REGION
<11BRG357(G,A:ADR,L:*;*)>       validity area ADR, all languages

Nesting matters too, as the SAP Help on repeating groups also describes: if a G group sits inside another repeating group, the system only takes the language into account, not the validity area. As a rule of thumb, the G group belongs on the outside.

In practice, this means:

  1. Every change to the generation variant is also a template change. Afterwards, check all templates with position restrictions in the preview (CG42).
  2. Document the order of the combinations and do not change it in passing.
  3. In the medium term, replace position restrictions with named filters.

5. Duplicated document bodies and the limits of INCLUDE

Some templates contain the same output section several times, for example in constructs for several countries on one package. That is structure, not unnecessary redundancy, but it has a consequence: every functional change has to be made in every copy. If one is forgotten, the output differs by country.

Moving the shared part into a <20INCLUDE> seems obvious. But the call takes exactly three arguments: template name, version and document type. Parameters cannot be passed. If two copies differ only by a filter in the group calls, they cannot be replaced by one and the same include.

This order has worked well in practice:

  1. First check whether copies can be removed by merging loops, for example 2;1 and 2;2-* into 2;*.
  2. Only consider an include for the copies that remain afterwards and differ solely in their position in the document.

Bonus tip: switching by language

The standard function C14NX_CURRENT_LANGU_ISO2_GET can provide the current report language as a symbol. In a condition, the template can then switch content, for example to a right-to-left layout for Arabic and left-to-right for all other languages.

Checklist before every change to a WWI template

  • Hidden coding analysed separately from the visible text and set off in colour?
  • A visible paragraph between two tables, no hidden paragraph mark?
  • Block to change identified by tag pairs and content, not by number or comment?
  • All copies of the same output section found and adjusted?
  • Country logic checked: conditions, methods, G groups, generation variant?
  • Position restrictions in G groups checked against the current generation variant?
  • Result checked for several countries and languages in the preview (CG42)?

Conclusion

Well-maintained WWI templates pay off with every content update and every new regulation: changes are faster and the risk of wrong output drops. How content updates and templates fit together is shown in our article on the steps of a 3E content update.

Nobody has dared to delete a paragraph mark in your template for years? Find out more about our SAP WWI service. Or talk to a senior consultant in a free 30-minute initial call about where a review or revision could start.

Further reading


As of December 2026. The examples show standard SAP WWI syntax. The SAP documentation and the release of your system are authoritative.

SAP Product Compliance that holds up in production — let’s talk.

30 minutes, free, with a senior consultant: you get an initial assessment of what the SAP standard covers and where customizing or custom development is needed. And if we are not the right fit, we tell you — and name who is.