SAP Business One Print Layout Designer - tutorial featured image

Publications

SAP Business One Print Layout Designer: Customize Invoices and Audit Layouts with SQL

Hector Pincheira

Hector Pincheira

CIO | CTO
Digital Strategy & Technology Innovation

items

The invoice left the system without the customer's purchase order number. Accounts payable rejected it, the collection cycle restarted from zero and the money sat floating for another thirty days. Nobody had changed a process, nobody had made a typing error: the problem lived in a print template that had stayed the same since go-live. Enter SAP Business One Print Layout Designer, the tool that decides what information actually travels outside your company.

The designer, moreover, comes included in your license. It requires no installation, it does not depend on an outside consultant for minor changes and, even so, it is the first thing companies leave untouched for years. That neglect has a price, and it is paid in days of collection.

SAP Business One Print Layout Designer - printed document reviewed on the desk
The printed document is the only part of the ERP your customer sees.

Why you need to master SAP Business One Print Layout Designer

Your ERP produces hundreds of documents a month and, in fact, almost none of them stay inside. The invoice reaches the customer's payables desk, the delivery note travels with the truck, the purchase order lands in the inbox of a supplier who decides whether to take you seriously. The layout is therefore not an aesthetic matter: it is the exact point where your information becomes someone else's information.

When the document does not carry what the recipient needs, the recipient does not guess. They send it back, they call, or they simply leave the paper at the bottom of the pile. Each of those bounces costs days. Besides, every minor change outsourced to a partner costs billable hours for something you can solve in twenty minutes.

There is also a second reason, less obvious. The fields you add to the layout end up disciplining data entry: if the customer's purchase order number gets printed, someone makes sure to fill it in. This way, the print design pushes data quality up, instead of waiting for data quality to appear on its own.

PLD or Crystal Reports: when to use each

It helps to understand, first, that SAP Business One ships with two print engines. PLD is native, lightweight, lives inside the client and needs no additional installation. Crystal Reports, on the other hand, is more powerful, handles subreports, charts and complex logic, but adds an external dependency and a learning curve that not every team wants to pay for. My rule of thumb: if the change is adding fields, moving blocks, adjusting totals or translating labels, PLD wins on speed; if you need a statement of account with charts or a document that consolidates several sources, switch to Crystal Reports.

Prerequisites for working with SAP Business One Print Layout Designer

  • Print layout designer authorization for your user (Administration → System Initialization → Authorizations → General Authorizations).
  • A test database. Never practice on production, even if the change looks harmless.
  • Knowing which engine the document uses: PLD and Crystal coexist, and the default layout can belong to either one.
  • A printed copy of the current document, marked up by hand with what is missing and what is left over.
  • Read-only access to the database to run the audit queries you will see further down.

If your version offers exporting and importing layouts from the management window, use it to keep a copy outside the system before you start. Otherwise, your backup is the duplicate you will make in step 2.

Tutorial: customize your invoice with SAP Business One Print Layout Designer step by step

Step 1: open the designer from the right document

First, open any A/R invoice. Then select Tools → Print Layout Designer. The window then lists every layout associated with that object: SAP's standard ones and the ones your company has created. Context matters, because the designer only shows you the fields from the tables of the document you entered from.

Step 2: duplicate the standard layout (never edit the original)

Next, select the standard layout closest to what you need and use the duplicate option. And rename it with a convention that survives staff turnover: INV_Customer_2026 says more than New invoice 3. SAP layouts are read-only by design, and that restriction has saved you more times than you think.

Step 3: understand the areas before moving a pixel

A layout is divided into areas and each one repeats with a different logic:

  • Page header: printed on every sheet. Logo, company data, document number.
  • Repetitive area: once per document line. Item code, description, quantity and price live here.
  • Repetitive area header and footer: column titles and page subtotals.
  • End of report: totals, taxes, amount in words, signatures.
  • Page footer: numbering, legal text, contact details.

The classic mistake, in fact, is putting the grand total inside the repetitive area. The system duly obeys and prints it once per line. It looks awful.

Step 4: add the missing field

Insert a field of type Database, choose the table and then the field. For the invoice header, the table is A/R Invoices (OINV); for the lines, the detail table (INV1). Then add a text field to act as a label and align the two. For example, if you need to print the customer's purchase order, the OINV field you are looking for is the customer reference number, the one your sales team fills in sometimes.

Step 5: calculate with formula fields and respect the order of the IDs

Formula fields, meanwhile, operate on other fields using their identifiers, of the form F_012. Here comes the trap that has cost me dearly more than once: PLD evaluates fields in ID order, so a formula that references a field with a higher ID returns blank or zero, with no warning, no error, nothing. If your subtotal comes out empty and you swear the formula is right, check the IDs before checking the formula. (Yes, it is an awkward design decision; we have been living with it for years.)

Step 6: set the default layout

A layout that is not assigned does not exist. So, from the layout management window, mark yours as the default for the document. Every user who prints that invoice then gets your version without having to choose anything. SAP also allows finer assignments by user or by business partner, which helps when a large customer demands its own format.

SAP Business One Print Layout Designer - document template design on the desk
Designing a layout is deciding what information deserves to take up space on the page.

SQL queries to audit your layouts

Layouts are stored in two tables: RDOC holds the header of each template and RITM stores its elements. This way you can answer questions the interface does not answer well, such as how many custom templates you have piled up in ten years of operation.

Full layout inventory

SQL Server

-- Layout inventory: custom vs. standard, with element count
SELECT
    T0.DocCode                                  AS [Code],
    T0.DocName                                  AS [Layout name],
    (SELECT COUNT(*) FROM RITM T1
      WHERE T1.DocCode = T0.DocCode)            AS [Elements],
    CASE WHEN T0.DocCode LIKE '%USR%'
         THEN 'Custom' ELSE 'SAP standard' END AS [Source],
    CASE WHEN T0.QString IS NOT NULL AND DATALENGTH(T0.QString) > 0
         THEN 'Query layout' ELSE 'Document layout' END AS [Type]
FROM RDOC T0
ORDER BY 4 DESC, 1

SAP HANA

-- Layout inventory: custom vs. standard, with element count
SELECT
    T0."DocCode"                                AS "Code",
    T0."DocName"                                AS "Layout name",
    (SELECT COUNT(*) FROM RITM T1
      WHERE T1."DocCode" = T0."DocCode")        AS "Elements",
    CASE WHEN T0."DocCode" LIKE '%USR%'
         THEN 'Custom' ELSE 'SAP standard' END AS "Source",
    CASE WHEN T0."QString" IS NOT NULL AND LENGTH(T0."QString") > 0
         THEN 'Query layout' ELSE 'Document layout' END AS "Type"
FROM RDOC T0
ORDER BY 4 DESC, 1

Layouts created by users carry USR inside the code; SAP's do not. Run the query, sort by source and templates will show up that nobody remembers asking for. That, in the end, is the starting point of any cleanup.

Broken or incomplete layouts

When a copy between databases is done halfway, you are left with a header in RDOC and no elements in RITM. The symptom is a blank page when printing; the cause, on the other hand, is hard to find from the interface.

SQL Server

-- Declared layouts with no associated element
SELECT T0.DocCode AS [Code], T0.DocName AS [Layout name]
FROM RDOC T0
WHERE NOT EXISTS (SELECT 1 FROM RITM T1 WHERE T1.DocCode = T0.DocCode)
ORDER BY T0.DocCode

SAP HANA

-- Declared layouts with no associated element
SELECT T0."DocCode" AS "Code", T0."DocName" AS "Layout name"
FROM RDOC T0
WHERE NOT EXISTS (SELECT 1 FROM RITM T1 WHERE T1."DocCode" = T0."DocCode")
ORDER BY T0."DocCode"

Issued documents that were never printed

Every marketing document stores a print flag. A valid, posted and never printed invoice, for example, is usually an invoice that was never sent. And an invoice that never arrived does not get paid.

SQL Server

-- Invoices from the last 3 months that never went through the printer
SELECT
    T0.DocNum                    AS [Number],
    T0.DocDate                   AS [Date],
    T0.CardCode                  AS [Customer],
    T0.CardName                  AS [Legal name],
    T0.DocTotal                  AS [Total],
    DATEDIFF(DAY, T0.DocDate, GETDATE()) AS [Days since issue]
FROM OINV T0
WHERE T0.Printed = 'N'
  AND T0.CANCELED = 'N'
  AND T0.DocDate >= DATEADD(MONTH, -3, GETDATE())
ORDER BY T0.DocDate

SAP HANA

-- Invoices from the last 3 months that never went through the printer
SELECT
    T0."DocNum"                  AS "Number",
    T0."DocDate"                 AS "Date",
    T0."CardCode"                AS "Customer",
    T0."CardName"                AS "Legal name",
    T0."DocTotal"                AS "Total",
    DAYS_BETWEEN(T0."DocDate", CURRENT_DATE) AS "Days since issue"
FROM OINV T0
WHERE T0."Printed" = 'N'
  AND T0."CANCELED" = 'N'
  AND T0."DocDate" >= ADD_MONTHS(CURRENT_DATE, -3)
ORDER BY T0."DocDate"

User-defined fields: the bridge between your data and the paper

The user fields show up in the designer just like native fields, as long as they belong to the document's table. Before opening the layout it pays to know what you have available, because the designer's dropdown list is long and not very friendly.

SQL Server

-- User-defined fields available on the invoice (header and lines)
SELECT
    T0.TableID              AS [Table],
    'U_' + T0.AliasID       AS [Field],
    T0.Descr                AS [Description]
FROM CUFD T0
WHERE T0.TableID IN ('OINV', 'INV1')
ORDER BY T0.TableID, T0.AliasID

SAP HANA

-- Campos de usuario disponibles en factura (cabecera y lineas)
SELECT
    T0."TableID"            AS "Tabla",
    'U_' || T0."AliasID"    AS "Campo",
    T0."Descr"              AS "Descripcion"
FROM CUFD T0
WHERE T0."TableID" IN ('OINV', 'INV1')
ORDER BY T0."TableID", T0."AliasID"

Then comes the hard part: filling those fields without relying on the user's memory. A formatted search solves most cases: the field fills itself on save and then prints. The query that follows brings the customer's balance to stamp at the foot of the invoice, a silent reminder that works better than three collection emails.

SQL Server

-- Formatted search: customer balance to print on the document
SELECT CAST(T0.Balance AS DECIMAL(19,2))
FROM OCRD T0
WHERE T0.CardCode = $[OINV.CardCode]

SAP HANA

-- Formatted search: customer balance to print on the document
SELECT TO_DECIMAL(T0."Balance", 19, 2)
FROM OCRD T0
WHERE T0."CardCode" = $[OINV.CardCode]
SAP Business One Print Layout Designer - invoices and calculator on the administration desk
A well-printed piece of data saves calls that nobody counts.

Variations and real-world use cases

  • A format for the demanding customer. The retailer that asks for its own column order, for example, no longer forces anyone to edit the document by hand: you design a layout and assign it to that business partner.
  • Documents in another language. Duplicate the layout, translate the text labels and then assign it to your export customers. The database fields stay untouched.
  • Query layouts. PLD also prints Query Manager results with corporate formatting, which turns a query into a presentable report without going through Excel. Combine it with parameterized queries and you have reports by period without touching the code.
  • Barcodes. Delivery notes with a barcode of the document number also speed up receiving at third-party warehouses.
  • Multi-branch. Each branch with its own legal text and its own footer, without duplicating the database.

Best practices and common mistakes in SAP Business One Print Layout Designer

  • Always duplicate. Editing a standard layout is not possible; forcing your way through with direct SQL on RDOC and RITM is the kind of shortcut that ends in a backup restore on a Friday afternoon.
  • Name with judgment. Include object, purpose and year in the layout name.
  • Watch the height of the repetitive area. If a field sticks out by one millimeter, the line gets cut off or jumps to the next page.
  • Order the IDs. Formulas are calculated in sequence, so calculated fields always go after their inputs.
  • Test with the worst document you have. The one with forty lines, three different taxes and an endless item description. A layout that survives that case survives all of them.
  • Document the change. Write down which field you added and why, because nobody else will remember. In version 9.3, if memory serves, there was still no change history for layouts, and that gap has not been fully closed.
  • Clean up once a year. Use the first query in this article, review the unused layouts and then delete them.

Official SAP Resources

The document is the product

No customer sees your ERP. They see the invoice, the delivery note, the statement of account. All the configuration, migration and training work you financed for months comes down, for the person on the other side, to one letter-size sheet. That is why it is worth making sure that sheet says exactly what it has to say, in the order someone is going to read it, and that you can change it without asking for permission or budget.

Start, then, with the simplest thing: print your current invoice, mark it up in red pen and count how many pieces of data are missing. Then open the designer and fix the three most urgent ones. It is an afternoon's work.

Want to keep going deeper into SAP Business One with practical tutorials like this one? In the Círculo Estratégico I publish step-by-step guides with queries ready for SQL Server and HANA, written for teams that need results and not theory. See you inside.

Most Read

Ballena jorobada bajo el agua con su aleta pectoral extendida: la esperanza en la tecnología y la biomimética
La ballena que volvió: la esperanza en la tecnología y la que no cabe en un tablero
SAP data in ChatGPT: an open door at the far end of a dark room
The Tab Next Door: The SAP Data in ChatGPT That Nobody Authorized
SAP Business One Purchase Price Variance - featured image of the tutorial
SAP Business One Purchase Price Variance: Detect the Inflation in Your Buying Costs
QlikSense format changeovers: actual minutes against the standard
QlikSense Format Changeovers: the Minutes Nobody Bills
QlikSense buttons and actions: executive dashboard with indicators
QlikSense Buttons and Actions: the Dashboard that Runs the Meeting
SAP Business One Internal Reconciliation - featured image of the tutorial
SAP Business One Internal Reconciliation: Clear False Open Items

RELATED ARTICLES