Skip to content

List of Use Cases Implemented in the Call Stack

The call stack (BB114P.ocl36 → BB110E → BB114 → BB114SC → BB114S → BB114O → BB1143 → BB110) implements several use cases related to processing and printing customer order confirmations and proforma invoices within a Customer Orders system on an IBM midrange system. Each use case reflects a distinct business function, derived from the program interactions, file manipulations, and output generation. Below are the identified use cases:

  1. Interactive Order Confirmation Inquiry:
  2. Description: Allows users to interactively query and view open order headers, filter by criteria (e.g., company, customer, order number, date), and select orders for confirmation processing.
  3. Programs Involved: BB114P (initiates), BB110E (busy screen), BB114 (main inquiry and subfile).
  4. Key Features: Dynamic filtering, subfile display, prompting for field values, and selection for further processing (e.g., option 6 for confirmation).

  5. Customer Order Confirmation Generation:

  6. Description: Builds work files for a selected order to generate a customer order confirmation, preparing data for printing or further processing.
  7. Programs Involved: BB114 (triggers via option 6), BB114SC (file overrides), BB114S (builds work files).
  8. Key Features: Segregates order records (header, detail, miscellaneous) into work files (BBPROH, BBPROD, etc.) based on sequence numbers.

  9. Proforma Invoice Printing:

  10. Description: Processes order data, sorts it by specified criteria, and prints proforma invoices (with Spoolflex conversion to PDF, no emailing).
  11. Programs Involved: BB114P (initiates), BB114O (sorting and printing), BB1143 (preprocessing sort fields), BB110 (main printing).
  12. Key Features: Sorting by company/order/sequence, specialized grouping for customer-owned products or packaging plants, and output to LIST4 printer file with post-processing (splitting, PDF conversion).

  13. Picking Ticket Printing for Customer-Owned Products (e.g., Viscosity EDI856):

  14. Description: Generates picking tickets tailored for customer-owned products, with specific sorting and formatting (e.g., by product or size/container).
  15. Programs Involved: BB114O (initiates), BB1143 (sort preprocessing), BB110 (prints to LIST or LIST2).
  16. Key Features: Custom sorting (product or size-based), adjusted layouts to avoid off-page printing, and Viscosity-specific formatting.

  17. Picking Ticket Printing for Packaging Plant (PP/PKGP):

  18. Description: Produces picking tickets for packaging plant orders, with unique sorting and product descriptions.
  19. Programs Involved: BB114O, BB1143, BB110 (prints to LIST2).
  20. Key Features: Sorting by product or size/container, right-justified brand, and packaging plant-specific descriptions.

  21. Order Confirmation Printing:

  22. Description: Prints order confirmations for manual selection, including detailed order information and notes.
  23. Programs Involved: BB114O, BB1143, BB110 (prints to LIST3).
  24. Key Features: Outputs confirmations with status (e.g., on-hold), weights, freight, and export compliance notes.

  25. Spool File Post-Processing for Proforma Invoices:

  26. Description: Splits, converts, and archives spool files for proforma invoices into PDF-like electronic documents, with specific naming and output queue handling.
  27. Programs Involved: BB114O (calls SFASPLIT, FFAEDOC, SFACOPY).
  28. Key Features: No emailing, moves output to designated queues (e.g., PROFOROQSV), and uses standardized naming.

Function Requirement Document: Proforma Invoice Generation

Proforma Invoice Generation Function Requirements

Purpose

Generate proforma invoices for customer orders, producing formatted spool files (converted to PDF) without emailing, based on input order data, with sorting, grouping, and detailed calculations for printing.

Inputs

  • Company Number (2-digit decimal): Identifies the company.
  • Order Number (6-digit decimal): Specifies the order to process.
  • File Group (1-character, e.g., 'G' or 'Z'): Determines library/file set (e.g., GBBPROH vs. ZBBPROH).
  • Order Data Files: Pre-populated files (e.g., BBORDR, BBPROH, BBPROD) containing order headers, details, and miscellaneous records.
  • Supporting Files: Customer (ARCUST), product (GSPROD), container (GSCNTR), and other reference data.

Outputs

  • Spool File (LIST4): Formatted proforma invoice output, routed to PROFOROUTQ or TESTOUTQ, with form type PROF, CPI 15.
  • PDF-like Electronic Document: Converted via Spoolflex, named 'ARG PROFORMA INVOICE', archived in PROFOROQSV.
  • Work Files: Populated BBPROH (headers), BBPROD (details), BBPROO/BBPROI/BBPROB (miscellaneous), BBPROM (remarks).

Process Steps

  1. Validate Input Data:
  2. Check if BBPROH exists and has records for the company/order; exit if empty.
  3. Prepare Work Files:
  4. Read BBORDR records for the specified company/order.
  5. Segregate by sequence number:
    • Seq# 000 → BBPROH (header).
    • Seq# 900-959 → BBPROM (remarks).
    • Seq# 960-962 → BBPROO/BBPROI/BBPROB (miscellaneous).
    • Others → BBPROD (details).
  6. Write records verbatim to respective files.
  7. Sort and Preprocess Data:
  8. Sort BBPROR by company, order, sequence number (header first, then marks/details).
  9. Create temporary file (QTEMP/BB1143, 554 bytes) for preprocessing.
  10. Assign sort fields for details based on:
    • Customer-owned (BOCOON = 'Y'): Group by product (BDPROD) or size (from GSCNTR); sort by product, container, or size/product.
    • Packaging plant (BORACD = 'PP', BOMLCD = 'PKGP'): Similar to customer-owned.
    • Other: Group by product or container; sort by product/container or container/product.
  11. Output extended records with sort fields (513-553) and BOORPR (554).
  12. Sort again by company, order, header priority, custom sort fields (from BB1101), sequence number.
  13. Generate Print Output:
  14. Read sorted data (BB1143S) and reference files (e.g., ARCUST, GSPROD, BBCAID).
  15. Skip orders with delete code 'E' (error).
  16. Output to LIST4:
    • Header: Order#, customer, ship-to, incoterms, route code, order status.
    • Details: Quantity, gross weight (from BB101), product descriptions (GSPROD), container types (GSCNTR1), prices (ARCUPR).
    • Freight: Description, bill-to address (internal: customer; external: processor).
    • Totals: Net quantity, gross/net weight (in LBS), price total, miscellaneous charges.
    • Notes: ARG terms, safety instructions, freight estimates, export compliance.
  17. Post-Process Spool File:
  18. Split LIST4 spool (named 'PROFORMA INV LIST4') in PROFOROUTQ.
  19. Convert to e-doc 'ARG PROFORMA INVOICE' via Spoolflex, move to PROFOROQSV.
  20. Copy spool with name 'PROFORMA NAMING EMAL' to PROFOROQSV.

Business Rules

  • Order Eligibility: Process only non-deleted orders (BODEL ≠ 'D'); skip if BOORPR = 'E' (error). Mark BOORPR = 'H' as 'ON HOLD - DO NOT SHIP'.
  • Sorting/Grouping:
  • Customer-owned (Viscosity): Group by product (BOGPBY = 'C') or size; sort by product/container or size/product/container.
  • Packaging plant: Similar to customer-owned.
  • Other: Group by product or container; sort by product or container/product.
  • BOORPR = 'C', 'S', 'R' uses sorted order; blank uses line entry order.
  • Calculations:
  • Gross weight: From BB101 (order entry).
  • Net weight: Includes product weight.
  • Extended price: Quantity × unit price (from ARCUPR, container-specific).
  • Totals: Sum net quantity, misc charges, price total.
  • Freight Handling:
  • Internal processor: Use customer address for freight bill.
  • External processor: Use freight processor address.
  • Suppress freight total amount printing.
  • Formatting:
  • Use CPI 15, form type PROF for LIST4.
  • Right-justify brand, adjust columns to avoid off-page printing.
  • Include incoterms, route code, loading location, and export compliance notes.
  • File Groups: Use file group ('G' or 'Z') to select library (e.g., GBBPROH vs. ZBBPROH).
  • Post-Processing: No emailing; archive spool files in PROFOROQSV with standardized names.

Calculations

  • Net Quantity (L2CQT): Sum of BDQTY across detail lines (non-deleted).
  • Gross Weight (L2GWT): Pre-calculated in BB101, output in LBS.
  • Net Weight (L2NWT): Sum of product weights (BDGWT) from detail lines.
  • Price Total (TOTPRCJB): Sum of extended prices (BDQTY × unit price from ARCUPR).
  • Miscellaneous Total (L2TOT): Sum of BMAMT from miscellaneous lines (Seq# 960-962, 900-959).