# Baan Open Order Report: Sales and Purchase Sessions, Filters and Tables

> Source: https://netray.co/erp-help/baan-open-order-report-sales-purchase-sessions-tables
> Publisher: Netray (netray.co), AI and integration engineering for ERP and manufacturing systems.
> Section: ERP Help

## Short answer

Baan and Infor LN have no single open order report. You get open sales orders from the Sales Control order and order-line sessions (or the Print Sales Orders session) and open purchase orders from the Purchase Control equivalents, then filter on order and line status and on outstanding quantity. For anything custom, query the order-line tables (tdsls401 and tdpur401) and compare ordered with delivered quantity.

## Kind

how-to

## System

infor-ln

## Erp

Infor LN / Baan

## Module

Sales Control / Purchase Control

## Query

baan open order report

## Alternate Queries

- baan open sales orders report
- baan open purchase orders list
- infor ln open order report session
- baan tdsls401 tdpur401 open order query

## Applies To

Baan IV, Baan 5 / ERP LN and Infor LN 10.x. Session codes and field names are listed as commonly found; confirm them in your own package VRC and Application Dictionary.

## Steps

### How to produce an open order report in Baan / Infor LN

**Items:**

Decide which side you need: open sales orders (customer demand still to ship) or open purchase orders (supplier receipts still due). They live in different packages (td Sales Control and td Purchase Control).

Open the Sales Order Lines session (commonly tdsls4101m000) or Purchase Order Lines session (commonly tdpur4101m000). Use the line-level session, not the header session, because openness is a line property.

Filter on line status so only active lines remain. Exclude closed, canceled and fully delivered lines; keep lines in the planned, approved or released states depending on your process.

Add a filter or range on delivery date to split overdue lines (date before today) from future lines, and on business partner, item or warehouse to focus the report.

For a paper or file output, run the Print Sales Orders or Print Purchase Orders session from the same menu and send it to a file or Excel print device; set the ranges to match the filter above.

In the Infor LN UI, use Export to Excel from the grid for a quick copy of the filtered lines. Check the column list first so quantity, delivery date and status are included.

For recurring or cross-system reporting, run a SQL query on the order-line tables with the outstanding quantity calculated (see the code in the sections below).

Save the result as a favorite filter or a Baan/LN report layout so the same selection can be rerun next week.

## Sections

### Where Baan keeps the data

**Body:**

Sales orders are split into a header table (tdsls400) and a line table (tdsls401). Purchase orders follow the same pattern with tdpur400 and tdpur401. Delivery schedule detail, where used, sits in separate delivery-line tables (tdsls406 and tdpur406 in LN). Openness is determined at line level: a header with five lines can be partly open.

The quantity fields you need are the ordered quantity (commonly oqua), the delivered or received quantity and the backorder quantity (commonly bqua). In Baan IV, bqua held the outstanding quantity directly. In LN the backorder logic can sit on the delivery lines, so verify the field with the Tables or Application Dictionary session before you build a report on it.

Table names carry a company number suffix in the physical database, for example tdsls401100 for company 100. Always join within one company, and remember that multi-company installations need one query per company or a UNION.

### Choosing the right filters

**Body:**

A line is open when something is still owed: quantity outstanding is greater than zero and the line has not been closed or canceled. Do not rely on the header status alone, because Baan can keep a header active while individual lines are finished.

Order type matters. Sales orders, sales schedules, service orders and returns can all appear in the same line sessions, and purchase side can include purchase schedules and subcontracting. Add an order type range so you do not mix blanket call-offs with firm orders.

Delivery date has several versions: requested, planned and promised. Pick the one your planners and customers actually use, and state it in the report title. Overdue analysis built on the wrong date is the most common reason two Baan open order reports disagree.

**Code:**

-- Sketch only: adjust field names and the company suffix to your installation
SELECT l.t_orno, l.t_pono, l.t_item, l.t_oqua,
       l.t_bqua AS outstanding_qty, l.t_ddta AS delivery_date
FROM   tdsls401100 l
WHERE  l.t_bqua > 0
  AND  l.t_clyn = 2   -- not closed; check your enumerate values
ORDER  BY l.t_ddta;

### Getting the data out

**Body:**

For one-off use, the session grid export or a print device that writes to a text file is enough. Baan print devices can write to a file, and the output can be opened in Excel. The limit is that you re-run it by hand and layout changes need a report designer.

For recurring use, an ODBC connection to the Baan or LN database, or a read replica of it, lets Excel, Power BI or a SQL tool query tdsls401 and tdpur401 directly. Keep it read-only and remember that Baan stores enumerate fields as numbers, so you need the domain descriptions to translate status codes.

On older Baan IV systems running on unsupported infrastructure, agree with your DBA on query timing, because large line-table scans during order entry hours can slow users down.

### Making the report trustworthy

**Body:**

Reconcile once against a known customer or supplier. Pick one business partner, count the open lines in the session, count them in the SQL result and fix differences in status or date filters before you share the report widely.

Add the item description, warehouse and planner so the report is actionable, and include currency and net price if finance will use it for backlog value. Remember that backlog value needs outstanding quantity times net price, not the original order amount.

## Pitfalls

- Reporting from the order header session and missing that individual lines may already be delivered or closed.
- Using ordered quantity instead of outstanding quantity, which overstates the open balance on partially delivered lines.
- Mixing company numbers or forgetting the company suffix on table names in SQL, so the query returns an empty or wrong set.
- Treating enumerate values in SQL as text when Baan stores them as numeric codes that differ between versions.
- Comparing a report by requested date with one by planned date and concluding that the data is wrong.

## Ai Angle

A grounded assistant such as ERPray (read-only, running on your own infrastructure) can answer a question like which open sales lines for customer X are overdue by asking the order-line tables directly, showing the query it ran and respecting the user's Baan or LN role. That removes the manual session filtering and the one-off Excel exports, while the Baan screens remain the system of record.

## Faq

### Is there a standard open order report in Baan?

**Answer:** Not as a single report. Baan and Infor LN offer print sessions for sales orders and purchase orders, with ranges and status filters, and you combine those filters to see only open lines. Many sites build a customized report layout or SQL query to get a clean outstanding-quantity listing.

### Which tables hold open sales and purchase order lines?

**Answer:** Sales order lines are in tdsls401 and purchase order lines in tdpur401, with headers in tdsls400 and tdpur400. Physical names include the company number, for example tdsls401100. Confirm field names in the Application Dictionary for your version.

### How do I export the open orders to Excel?

**Answer:** In the Infor LN UI use Export to Excel on the filtered line grid. In older Baan clients, print to a file device and open the text output in Excel, or connect through ODBC and query the line tables with a filter on outstanding quantity.

### Why does my open order total differ from finance?

**Answer:** Usually because of the date used (requested versus planned), including closed or canceled lines, mixing order types such as schedules, or using ordered instead of outstanding quantity. Reconcile one customer line by line to find which filter differs.

## Search terms

baan open order report, baan open sales orders, baan open purchase orders, infor ln open orders, tdsls401 table, tdpur401 table, baan backlog report, baan print sales orders, infor ln export to excel, baan sql open lines

---
Talk to an engineer: https://netray.co/contact?intent=erp_ai | Machine catalog: https://netray.co/agent/catalog.json
