Automating Library Batch Retrieval in OpenEdge ABL: Building a Production Workflow.
Automating work order creation, trip number assignment, and picklist generation in a Library Automation System.
Introduction
In a Library Automation System (LAS) built on OpenEdge/Progress, retrieval requests go through several stages before library staff can retrieve materials. Each request is stored in BATTRN, grouped into batches (BTCs), converted into WOFILE work orders, and finally printed as retrieval picklists.
Previously, this workflow was handled manually, requiring staff to monitor incoming requests, create work orders, assign trip numbers, and print picklists individually.
To eliminate manual intervention, an OpenEdge ABL program, retbtt_auto.p, was developed to automate the complete retrieval process.
Solution Overview
The automation performs the following tasks during a scheduled execution:
- Scans BATTRN for all unprocessed retrieval requests (status = “N” and type = “REQI”).
- Groups requests by BTC.
- Groups each batch further by owner and destination using a temp-table.
- Searches for existing open work orders.
- Calculates the next available trip number.
- Validates billing configuration before creating work orders.
- Creates new WOFILE
- Creates corresponding HISTORY
- Updates request status to processed or rejected.
- Invokes p to generate retrieval picklists.
- Writes detailed execution logs for monitoring and troubleshooting.
The automation is designed to run unattended through a cron schedule.
Challenges and Fixes
1. Preventing Duplicate Trip Numbers
The initial implementation assigned fixed trip numbers based on whether an open work order existed.
This approach worked only when a maximum of one open work order was present. Once multiple work orders existed for the same customer and destination, duplicate trip numbers were generated.
The solution was to determine the highest existing trip number and assign the next available value.
ASSIGN l-max-trip = 0.
FOR EACH TT-WO
WHERE tt-wf-cus = tt-btt-own
AND tt-hi-ret-dlv = tt-btt-destination NO-LOCK:
IF tt-hi-ret-trip > l-max-trip THEN
l-max-trip = tt-hi-ret-trip.
END.
ASSIGN s-hi-ret-trip = l-max-trip + 1.
2. Removing an Incorrect Date Restriction
The temporary work order table originally loaded only work orders created within the last seven days.
Although intended as an optimization, this excluded older open work orders from trip number calculations, allowing duplicate trip assignments.
Removing the date restriction ensured that trip calculations always considered every open work order.
3. Clearing Temp-Tables Between Batches
When multiple BTCs were processed during a single execution, records from previous batches remained in TT-BATCH.
This caused incorrect owner and destination groupings during later iterations.
The issue was resolved by clearing the temp-table before processing each batch.
EMPTY TEMP-TABLE TT-BATCH.
4. Resolving the E443 Error
After work order creation, the following runtime error appeared:
WORKORDER:? IS NOT ON FILE. (E443)
The work order had been created successfully, but pckret.p expected the shared variable s-hi-ret-wo.
Only s-pick-wo had been assigned, leaving s-hi-ret-wo with an unknown value (?).
Assigning both shared variables resolved the issue.
ASSIGN
s-pick-wo = wf-wo-num
s-hi-ret-wo = wf-wo-num.
5. Diagnosing Zero Processed Records
During testing, scheduled executions completed successfully but reported:
Total WO/Items processed in this run: 0
The issue was not with the automation logic. The initial FOR EACH BATTRN query returned no matching records because:
- requests had already been processed (btt-status = “D”), or
- the request type differed from the expected REQI
Verifying the underlying data quickly identified the root cause.
Trip Number Strategy
Trip numbers are maintained independently for each customer and destination.
| Scenario | Customer | Destination | Trip |
| No open WOs exist | XA | AJ | 1 |
| One open WO at trip 1 | XA | AJ | 2 |
| Open WOs at trip 1 and 2 | XA | AJ | 3 |
| Different destination | XA | GO | 1 (fresh) |
| Different customer | XH | AJ | 1 (fresh) |
This approach prevents conflicts while maintaining separate trip sequences for different customer and destination combinations.
Result
The completed automation now executes as a scheduled cron job and performs the entire retrieval workflow without manual intervention.
Key capabilities include:
- Automated processing of multiple BTC batches
- Dynamic grouping by owner and destination
- Collision-free trip number assignment
- Billing validation before work order creation
- Automatic rejection of invalid requests
- Automatic picklist generation through p
- Comprehensive timestamped logging for auditing and troubleshooting
By automating the complete workflow, the solution reduces manual effort, improves consistency, and provides a reliable process for handling library retrieval requests in an OpenEdge ABL environment.
Recommended links
- Progress OpenEdge – Introduction to ABL
Good for explaining what ABL is and how it is used for business applications.
Introduction to ABL – Progress OpenEdge Documentation - ABL Reference
Useful as a technical reference for ABL syntax, statements, functions, temp-tables, and other language features used in your automation.
ABL Reference – Progress OpenEdge Documentation - OpenEdge Programming Interfaces
Relevant because your workflow interacts with database data and external processes.
OpenEdge Programming Interfaces – Progress Documentation - ABL Syntax Reference
Particularly useful for readers who want to understand the ABL syntax used in examples such asFOR EACH,ASSIGN, and temp-table processing.
ABL Syntax Reference – Progress Documentation - Learn about ABL – Basic ABL Guided Journey
Good beginner-friendly reference if your article is intended for developers who are new to OpenEdge ABL.
Learn about ABL – Progress OpenEdge
Abotts Partners with singapore based tech giant to help migrate their public sector customer from Sybase to SQL server.
Abotts partners with NYPL to integrate with their partner libraries.
Upworks Inc partners with ABOTTS to build their Oracle Cloud Infrastructure (OCI) and migrate their custom applications to OCI.
Abotts Inc Partners with Gnorth consulting to deploy exadata and ODA for a large public sector customer.