List of Use Cases Implemented by the BB802 Call Stack¶
The BB802 call stack, comprising programs BB802A, BB802B, BB802E, BB802F, BB802P, BB802H, BB802I, BB802G, and BB800E, implements a Customer Order and Invoice Inquiry system. The system retrieves and displays data for customer orders, invoices, canceled orders, and related details, with additional functionality to display accessorials and marks. Below is a list of distinct use cases derived from these programs, focusing on their data processing and inquiry capabilities:
- Retrieve Open Order Header Data:
- Description: Queries and aggregates open order header data from
BBORDHinto theBB802Wwork file for inquiry display. - Program: BB802A
-
Purpose: Supports inquiries for open orders, providing header-level details like customer, order number, ship-to, and salesman.
-
Retrieve Open Order Detail Data:
- Description: Queries and aggregates open order detail data from
BBORDDandBBORDH(viaBB802BQF) into theBB802Wwork file. - Program: BB802B
-
Purpose: Provides detailed order information, including products, quantities, and locations, for open order inquiries.
-
Retrieve Sales History Header Data:
- Description: Queries and aggregates sales history header data from
SA5SHPinto theBB802Wwork file. - Program: BB802E
-
Purpose: Supports inquiries for invoiced orders, providing header-level details like invoice number, ship date, and tracking number.
-
Retrieve Sales History Detail Data (Standard):
- Description: Queries and aggregates sales history detail data from
SA5FILDandSA5SHP(viaBB802FQF) into theBB802Wwork file. - Program: BB802F
-
Purpose: Provides detailed invoice information, including products and quantities, for standard sales history inquiries.
-
Retrieve Sales History Move Detail Data:
- Description: Queries and aggregates sales history move detail data from
SA5MOVDandSA5SHP(viaBB802PQF) into theBB802Wwork file when product move flag (P$PMOV = 'Y') is set. - Program: BB802P
-
Purpose: Supports inquiries for move-specific sales history, focusing on product movement details.
-
Retrieve Canceled Order Header Data:
- Description: Queries and aggregates canceled order header data from
BBCNHandBBCNOR(viaBB802HQF) into theBB802Wwork file. - Program: BB802H
-
Purpose: Supports inquiries for canceled orders, including cancel reasons, at the header level.
-
Retrieve Canceled Order Detail Data:
- Description: Queries and aggregates canceled order detail data from
BBCND,BBCNH, andBBCNOR(viaBB802IQF) into theBB802Wwork file. - Program: BB802I
-
Purpose: Provides detailed information for canceled orders, including products and quantities.
-
Enrich Work File with Ship-To Location Data:
- Description: Updates the
BB802Wwork file with city and state data from theSHIPTOfile based on ship-to codes. - Program: BB802G
-
Purpose: Enhances inquiry data with geographic details for display.
-
Display Customer Order or Ship-To Accessorials and Marks:
- Description: Queries and displays accessorials and marks data for customer orders (from
BBORA1,BBORDH) or ship-to records (fromBBSHSA1,SHIPTO) using a subfile interface. - Program: BB800E
- Purpose: Provides detailed inquiry for accessorials and marks, supporting both order-specific and ship-to-specific data.
Function Requirement Document¶
Customer Order and Invoice Inquiry Function¶
Purpose¶
The Customer Order and Invoice Inquiry function retrieves and aggregates data for open orders, canceled orders, sales history (including move details), and accessorials/marks for customer or ship-to inquiries, consolidating data into a work file for processing and optionally displaying accessorials/marks details.
Inputs¶
- Company Code (
p$co, 2 digits): Identifies the company. - Customer or Order Number (
p$csor, 6 digits): Specifies the customer or order to query. - Ship-To Code (
p$ship, 3 digits): Specifies the ship-to location (optional, '000' for order-level inquiries). - File Group (
p$fgrp, 1 character): 'G' or 'Z' to select the appropriate library. - Product Move Flag (
p$pmov, 1 character): 'Y' to include sales history move details, else 'N'.
Outputs¶
- Consolidated Inquiry Data: Aggregated data in the
BB802Wwork file, including order, invoice, and canceled order details with city/state. - Accessorials/Marks Data: Detailed accessorials and marks for orders or ship-to records (if requested).
Process Steps¶
- Validate Inputs:
- Verify
p$co,p$csor,p$ship, andp$fgrpare provided and valid. -
Exit with error if parameters are missing or invalid.
-
Apply File Overrides:
-
Use
p$fgrp('G' or 'Z') to override file libraries (e.g.,GBBORDH/ZBBORDH,GSA5SHP/ZSA5SHP). -
Aggregate Open Order Header Data:
- Read
BBORDHrecords matchingp$coandp$csor. -
Write to
BB802Wwith fields: company, customer, order number, ship-to, purchase order, salesman, carrier, freight details, andw1oori = 'O'. -
Aggregate Open Order Detail Data:
- Read
BB802BQF(joiningBBORDDandBBORDH) for matching records. -
Write to
BB802Wwith additional fields: location, product, container, quantity, unit of measure, andw1oori = 'O'. -
Aggregate Sales History Header Data:
- Read
SA5SHPrecords matchingp$coandp$csor. -
Write to
BB802Wwith fields: invoice number, ship date, tracking number, andw1oori = 'I'. Update tow1oori = 'B'if matching order exists. -
Aggregate Sales History Detail Data:
- If
p$pmov = 'Y', readBB802PQF(joiningSA5MOVDandSA5SHP); else, readBB802FQF(joiningSA5FILDandSA5SHP). -
Write to
BB802Wwith additional fields: location, product, container, quantity, unit of measure, order process, andw1oori = 'I'. Update tow1oori = 'B'if matching order exists. -
Aggregate Canceled Order Header Data:
- Read
BB802HQF(joiningBBCNHandBBCNOR) for matching records. -
Write to
BB802Wwith fields: cancel reason, andw1oori = 'C'. -
Aggregate Canceled Order Detail Data:
- Read
BB802IQF(joiningBBCND,BBCNH, andBBCNOR) for matching records. -
Write to
BB802Wwith additional fields: location, product, container, quantity, unit of measure, cancel reason, andw1oori = 'C'. -
Enrich with Ship-To Location:
- For each
BB802Wrecord, readSHIPTOusing:w1co,w1cust,w1shipforw1shipbetween001–899or900–998(if no order-specific record).w1co,w1ord#,999forw1ship ≥ 900if order-specific record exists.
-
Update
BB802Wwithw1dstc(city) andw1dsts(state). -
Retrieve Accessorials/Marks (Optional):
- If
p$ship = '000', readBBORA1andBBORDHfor order accessorials/marks. - If
p$ship ≠ '000', readBBSHSA1andSHIPTOfor ship-to accessorials/marks. - Return data for display or further processing.
- If
Business Rules¶
- Data Scope: Queries open orders (
BBORDH,BBORDD), sales history (SA5SHP,SA5FILD/SA5MOVD), canceled orders (BBCNH,BBCND,BBCNOR), and accessorials/marks (BBORA1,BBSHSA1) based onp$coandp$csor. - Uniqueness: Ensures no duplicate
BB802Wrecords using keys (w1co,w1cust,w1ord#,w1inv#). - Origin Indicator:
w1oori = 'O': Open order.w1oori = 'I': Invoice (sales history).w1oori = 'C': Canceled order.w1oori = 'B': Combined order and invoice (updated inBB802E,BB802F,BB802P).- Ship-To Logic:
- For
w1shipbetween001–899, use customer-specific ship-to (w1co,w1cust,w1ship). - For
w1shipbetween900–998, prefer order-specific ship-to (w1co,w1ord#,999) if available, else customer-specific. - Product Move: If
p$pmov = 'Y', processSA5MOVDinstead ofSA5FILDfor sales history details. - Accessorials/Marks:
- Order-level (
p$ship = '000'): Retrieve fromBBORA1and validate withBBORDH. - Ship-to level (
p$ship ≠ '000'): Retrieve fromBBSHSA1and validate withSHIPTO,ARCUST. - File Overrides: Use
p$fgrp('G' or 'Z') to select library (e.g.,GBBORDHvs.ZBBORDH). - Data Integrity: Clear
BB802Wrecords before writing to prevent residual data.
Calculations¶
- No explicit calculations are performed; the function aggregates and maps data fields directly.
- Date fields (e.g.,
w1sdat,w1indt) are copied as-is (e.g.,borqd8,shimdy). - Quantities (
w1qty) and totals (w1tolo,w1inva,w1lovo) are copied from source files without manipulation.