How-toInfor LN / BaanSales Control / Purchase Control

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

Question
baan open order report

Also searched as

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

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.

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.

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

  1. 1Decide 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).
  2. 2Open 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.
  3. 3Filter 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.
  4. 4Add 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.
  5. 5For 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.
  6. 6In 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.
  7. 7For 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).
  8. 8Save the result as a favorite filter or a Baan/LN report layout so the same selection can be rerun next week.

Where Baan keeps the data

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

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.

-- 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

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

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.

Try it here, free

Baan Purchase Order Template

Open full tool

A printable purchase order layout modeled on what Baan and Infor LN print, with header, line table and terms. Use it as a reference when rebuilding the PO report.

Common 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.

How an ERP-grounded AI assistant handles this

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.

Frequently asked questions

Is there a standard open order report in Baan?

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?

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?

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?

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.

Related

Error fix

DB Error 100 in Infor LN and Baan: Record or End of Set Not Found

DB error 100 in Infor LN and Baan is a not-found condition from the database layer: a read, find or next-record operation found no record matching the key, or reached the end of the result set. It is often harmless control flow in well-written 3GL code, but it becomes a visible error when a script does not test for it.

How-to

How to Add Users in the Baan / Infor LN GUI (Including Admin Access)

In Baan and Infor LN you create a user in the User Data session (ttaad2100m000), set the user type, language, company and login details, base it on a user template, and then give the user roles through the authorization management system. You need a user with administrator rights in the Tools (tt) package to do it, and in LN 10 the identity may also have to exist in Infor OS.

Error fix

Baan Error 10054 (and Error 206): What It Means and How to Fix It

Error 10054 is not a Baan-specific code: it is the Windows Sockets error WSAECONNRESET, meaning the other side of the connection (the bshell on the BSE server or something in between) closed or dropped the connection abruptly. Fix it by finding out who closed the socket: the bshell crashed or was killed, a firewall or load balancer cut an idle connection, or the server ran out of resources. Error 206 is a separate database or file level code that you read from the log, not guess.

How-to

Baan IV to Infor LN migration checklist

Moving from Baan IV to Infor LN is a re-implementation, not an in-place upgrade, because the two products differ in data model, session technology and, for LN Enterprise Edition, the underlying runtime. The checklist centers on inventorying customizations, converting master data, rebuilding logic rather than porting it, and running a real parallel test before cutover.

Error fix

Infor LN bshell Process Stuck at 100% CPU: How to Diagnose and Fix It

A bshell process pinned at 100% CPU on the Infor LN application server almost always means one session is stuck in a 4GL loop, scanning an unindexed table, or waiting on a database lock. End the session from the Sessions Monitor first, then kill the OS process only if that fails, and check for a blocking database transaction before assuming it is a bug.

Error fix

Infor LN Not Authorized to Run This Session: How to Fix It

Infor LN refuses to open a session with a not authorized message when the logged-in user's assigned role does not include that session, or when the session is blocked for the company they are logged into. Grant the session through Common > Authorization Management > Roles, or check the user's role and company context, and the session opens on retry. In most cases this is a permissions configuration issue, not a bug.

AI for ERP

AI for Legacy Baan IV/V: Capture the Knowledge Before It Walks Out the Door

Use AI to capture knowledge from ageing Baan IV/V systems, document undocumented customisations, and de-risk a future migration to LN or CloudSuite.

AI for ERP

A Private LLM Grounded on Your ERP Data

How a private LLM answers questions on your ERP data: RAG plus text-to-SQL, role-based permissions inherited from the ERP, and where each fits.

Stuck on Infor LN / Baan?

Talk to engineers who work inside Infor LN / Baan every week, and who build private AI that answers these questions from your own ERP data.

Keep exploring

Free tools

ERP fixes and how-tos

Runs with your ERP

Guides

AI on your ERP

Integrations

Comparisons

Software