get_stuck_orders โ€” Stuck Open Sales Orders

The open sales orders sitting unfulfilled too long โ€” the aging backlog.

This is a Named SQL Query (SAP /SQLQueries) โ€” dynamic aggregate SQL returning per-query rows, not a fixed Service Layer entity.

Stuck-orders report โ€” the individual open sales orders sitting unfulfilled too long, so you can chase the aging backlog. Returns one row per open sales order with card_code, card_name, doc_num, doc_date, days_open (as-of date minus doc_date), open_value (the order total), and stuck (true once days_open exceeds the threshold), most stuck first. An order is “open” when it still has undelivered quantity.

This report is a Named SQL Query (SAP /SQLQueries) โ€” a dynamic aggregate over the order header, not a fixed-shape entity read.

Try these prompts

  • “stuck orders”
  • “which orders are stuck?”
  • “open orders older than 60 days”
  • “stuck orders for C001”

ื ืกื• ื’ื ื‘ืขื‘ืจื™ืช

  • “ืื™ืœื• ื”ื–ืžื ื•ืช ืชืงื•ืขื•ืช?”
  • “ื”ื–ืžื ื•ืช ืคืชื•ื—ื•ืช ืžืขืœ 60 ื™ื•ื”
  • “ื”ืฆื’ ื”ื–ืžื ื•ืช ืฉื ืชืงืขื•”

Arguments

ArgRequiredMeaning
card_codeoptionalOne customer, e.g. C001. Omit for all customers.
daysoptionalThe stuck threshold in days โ€” an order past this many days open is flagged stuck. Default 30.
as_of_dateoptionalCompute days_open as of this date (YYYY-MM-DD). Omit for today.

Example result

One order is badly stuck. Order 2003 (Acme Corp, $7,500) has been open 165 days โ€” well past the 30-day threshold.

Result columns

ColumnTypeMeaning
card_codetextThe ordering customer’s SAP code.
card_nametextThe ordering customer’s name.
doc_numnumberThe sales order’s document number.
doc_datedateWhen the order was placed.
days_opennumberDays from doc_date to the as-of date.
open_valuenumberThe order’s total value โ€” the money sitting unfulfilled.
stucktexttrue once days_open passes the threshold. The row holds a boolean; the closed type set has none, so it is declared text โ€” a flag to read, not a magnitude to plot.

Charts

  • bar: x=doc_num, y=days_open, title=“Days open by order”
  • bar: x=doc_num, y=open_value, title=“Value tied up by order”
  • get_order_backlog โ€” item-level shortage against on-hand stock (not the individual orders).
  • get_order_to_cash_cycle โ€” the average order-to-cash cycle time per customer.