Mirror of Oracle documentation

Converted for search and offline reading. Authoritative source: Oracle. Diagrams and some complex tables are simplified — check the PDF when in doubt.

19 Sales Audit

The purpose of Sales Audit is to accept transaction data from point-of-sale (POS) and order management (OMS) solutions and move the data through a series of processes that culminate in “clean” data. Data that Sales Audit finds to be inaccurate is brought to the attention of the auditors who can use the features in Sales Audit to correct the exceptions.

Sales Audit uses several batch-processing modules to:

  • Import POS/OMS transaction data sent from the store to the Sales Audit database

  • Produce totals from user-defined totaling calculation rules that a user can review during the interactive audit

  • Validate transaction and total data with user-defined audit rules that generate errors whenever data does not meet the criteria

  • Create and export files in formats suitable for transfer to other applications

  • Update previously exported data with adjustments received from external systems

The term store day is used throughout this chapter. Store day describes all transactions that occur in one business day at one store or location. Because retailers need the ability to audit transactions on a store-by-store basis for a defined period of time, store day data is maintained separately, beginning with the initial import of data from the POS/OMS system.

The following diagram illustrates how data flows within Sales Audit and between Sales Audit and other applications.

Note

All integrations are not depicted in this diagram.

  • Customer Engagement Promotion Service (CePromoBatch.ksh) calls the ORCE webservice to retrieve promotion information, if using that solution to create promotions.

Import Processing Programs

  • Processing to Allow Re-Upload of Deleted Transactions (saimptlogtdup_upd) fetches deleted transactions for a store day and modifies the tdup files remove deleted transactions in order to facilitate the saimptlog/saimptlogi uploads of deleted transactions again.

  • Complete Transaction Import Processing (saimptlogfin) executes a number of import cleanup processes.

  • Create RTLOG Files (sacreatertlog) creates RTLOG files from data populated by the Selling Solutions. The Selling Solutions invoke the Sales Service (ReST) to populate transaction data in the staging tables.

Sales Audit Processing Programs

  • Calculate Totals Based on Client Defined Rules (satotals) totals transactions based on calculation definitions that you create using the online Totals Calculation Definition.

  • Evaluate Transactions and Totals based on Client Defined Rules (sarules) audits transactions for retailer-defined audit rules.

  • Prevent Duplicate Export of Total Values from ReSA (sapreexp) tracks all changed totals for the store day since the last export by comparing the latest prioritized version of each total defined for export with the version that was previously sent to each system.

  • Generate Next Sequence for Escheatment Processing (saescheat_nextesn) gets the next free sequence for use in the saescheat process.

  • Pre/Post Helper Processes for ReSA Batch Programs (saprepost) facilitates multithreading by allowing general system administration functions (such as table deletions or mass updates) to be completed after all threads of a particular Sales Audit program have been processed.

  • Purge Aged RTLOG Data (sartlogdatapurge) drops the partitions from the history and reject tables used by the Sales Service to load RTLOG files.

  • Purge Aged Store/Day Transaction, Total Value and Error Data from Sales Audit (sapurge) removes aged data from Sales Audit.

  • Purge the Invalid In-progress Sales Bucket (sainprogresspurge) deletes records from in-progress staging tables for the Store Days that have been closed and for which all the sales data has been exported to Merchandising.

There are also some background jobs that can be run as an alternative to some of these audit processing programs. These include:

  • Calculate Totals Based on Client Defined Rules (sa_totals_calc_job)

  • Evaluate Transactions and Totals based on Client Defined Rules (sa_rules_eval_job)

  • Purge Exported Sales Audit Transactions (saexpsim_export_purge_job)

  • Purge Into History Tables (b8d_sa_purge)

Lastly, there are two programs that are used for migrating totals and rules between environments:

  • Extract Totals and Rules (sa_rules_total_extract)

  • Migrate Totals and Rules (sa_rules_total_upload)

Export Process

Another key function of Sales Audit is to export audited data to other solutions. This includes Merchandising, Invoice Matching, within the Merchandising suite of solutions, but also commonly includes exports to store inventory (SIM/SIOCS), Oracle Retail Insights Cloud Service (ORI), and external financials institutions.

Depending upon the application, exported data consists of either transaction data or totals, or both. The process of exporting transaction data varies according to the unit of work selected in the Sales Audit system options. There are two units of work, transaction or store day. If the unit of work selection is transaction, Sales Audit exports transactions as soon as they are free of errors. If the unit of work selection is store day, transactions are not exported until all errors for that store day are either overridden or corrected.

Full Disclosure and Post-export Changes

If you modify data during the interactive audit that was previously exported to Merchandising, Sales Audit export batch modules re-export the modified data in accordance with a process called full disclosure. Full disclosure means that any previously exported values are fully backed out before the new value is sent.

Export Programs

See the Merchandising Operations Guide Volume 2 for details on the following export programs:

  • Download from Sales Audit to Account Clearing House (ACH) System (saexpach)

  • Download of Escheated Vouchers from Sales Audit for Payment (saescheat)

  • Export DSD and Escheatment from Sales Audit to Invoice Matching (saexpim)

  • Export from Sales Audit to Oracle Retail Analytics (saexpdw)

  • Export Inventory Reservation/Release for In Store Customer Order & Layaway Transactions from Sales Audit (saordinvexp)

  • Export of Revised Sale/Return Transactions from Sales Audit to SIM (saexpsim)

  • Export of Revised Sale/Return Transactions from Sales Audit to SIM in a Direct Database integration (saexport_sales_to_sim)

  • Export of POS Transactions from Sales Audit to Merchandising (saexprms)

  • Export to Universal Account Reconciliation System from Sales Audit (saexpuar)

  • Extract of POS Transactions by Store/Date from Sales Audit for Web Search (ang_saplgen.ksh)

  • Post User Defined Totals from Sales Audit to General Ledger (saexpgl)

Calculate Totals Based on Client Defined Rules (sa_totals_calc_job)

Module Name sa_totals_calc_job Description Calculate Totals based on Client Defined Rules Functional Area Sales Audit, Totals Module Type Admin - Ad hoc Module Technology Background Processing Catalog ID N/A Wrapper Script b8dwrap.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

This background job is composed of two steps processing. It will have a threading assignment and a business logic processing.

Thread assignment program will filter eligible records from the Sales Audit Store/Day table for all stores wherein auditing status is “Re-Totaling/Auditing Required”. Totaling provides the values against which auditors can compare receipts. These comparisons find data errors that could be the result of either honest mistakes or fraud. Finding these mistakes during the sales auditing process prevents these errors from being passed on to merchandising and data warehouse systems. Totaling also provides quick access to other numeric figures about the day’s sales transactions.

Totaling in Sales Audit is dynamic. Sales Audit automatically totals transactions based on calculation definitions that the retailer’s users create using the online Totals Calculation Definition Wizard. In addition, the retailer is able to define totals that come from the POS but that Sales Audit does not calculate. Whenever users create new calculation definitions or edit existing ones, they become part of the automated totaling process the next time that this program runs. These records are chunked and Thread ID is assigned for each. They will be stored temporarily in a staging table.

The Business logic program will process all records from the staging table. Using bulk processing, this program will process the records for totals build-up and calculation by calling SA_BUILD_TOTAL_SQL.PROCESS_CALC_TOTALS for each store day captured. It will free up and clean the staging table afterwards. There is a STOP ON NEXT feature in bulk processing (through a loop) where Administrators can stop this batch with a flip of this indicator.

Restart/Recovery

N/A

Key Tables Affected

Table 19-1 Key Tables Affected

TableSelectInsertUpdateDelete
RMS_BATCH_STATUSYesNoNoNo
B8D_PROCESS_CONFIGYesNoNoNo
JOB_AUDIT_LOGSNoYesNoNo
B8D_SA_TOTALS_CALC_STGYesYesNoYes
SA_STORE_DAYYesNoYesNo
SA_TOTALNoYesNoNo
SA_TOTAL_HEADYesNoNoNo
SA_ERRORNoYesNoYes
SA_ERROR_WKSHTNoYesNoYes
SA_POS_VALUENoYesNoNo
SA_POS_VALUE_WKSHTNoYesNoNo
SA_SYS_VALUENoYesNoNo

Table 19-1 (Cont.) Key Tables Affected

TableSelectInsertUpdateDelete
SA_SYS_VALUE_WKSHTNoYesNoNo
SA_ERROR_REVNoYesNoNo
SA_EXPORTED_REVNoYesNoNo
SA_EXPORTEDNoNoNoYes

Design Assumptions

N/A

Calculate Totals Based on Client Defined Rules (satotals)

Module Name satotalssqlb.pls/satotalssqls.pls Description Calculate Totals based on Client Defined Rules Functional Area Sales Audit, Totals Module Type Business Processing Module Technology PL/SQL Catalog ID RSA16 Wrapper Script rmswrap_plsql.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

This module produces totals from user-defined total calculation rules. Totaling is integral to the sales auditing process. Totaling provides the values against which auditors can compare receipts. These comparisons find data errors that could be the result of either honest mistakes or fraud. Finding these mistakes during the sales auditing process prevents these errors from being passed on to merchandising and data warehouse systems. Totaling also provides quick access to other numeric figures about the day’s sales transactions.

Totaling in Sales Audit is dynamic. Sales Audit automatically totals transactions based on calculation definitions that the retailer’s users create using the online Totals Calculation Definition Wizard. In addition, the retailer is able to define totals that come from the POS, but that Sales Audit does not calculate. Whenever you create new calculation definitions or edit existing ones, they become part of the automated totaling process the next time that this process runs.

Restart/Recovery

The logical unit of work for this program is a SA_STORE_DAY record. Each record has a unique STORE_DAY_SEQ_NO value that represents a store and day. Records are committed to the database when a store/day is successfully processed. This program achieves inherent restart/ recovery due to the fact that store/day records that are processed will be updated to an

audit_status of T for Totaled and will not be fetched by the driving cursor when the program restarts.

Design Assumptions

N/A

Complete Transaction Import Processing (saimptlogfin)

Module Name saimptlogfin.pc Description Complete Transaction Import Processing Functional Area Oracle Retail Sales Audit Module Type Admin Module Technology ProC Catalog ID RSA38 Wrapper Script batch_saimptlogfin.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

The saimptlogfin program creates the balances (over or under) by store, register, or cashier and populates it in the SA_BALANCE_GROUP table. It also cancels post voided transactions and vouchers and validates missing transactions.

If the consignment rate review process is used, then this batch also marks eligible consignment sales and return transaction as ‘Pending for Rate Review’ so that they can identified by the subsequent rate review process.

It marks the store day record in the Sales Audit import log as partially or fully loaded. This will unlock the store day records after all store transactions are imported. This will also close the store day for the previous day for an online store, if there was no DCLOSE transaction received for it.

Restart/Recovery

N/A

Design Assumptions

N/A

Create RTLOG Files (sacreatertlog)

Module Name Description Functional Area

sacreatertlog.ksh Create RTLOG files Oracle Retail Sales Audit

Module Type Integration Module Technology Ksh Catalog ID Wrapper Script batch_sacreatertlog.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

The purpose of this module is to create the RTLOG files using the data from the SVC_RTLOG_DATA_LAOD table (populated by Selling Solutions, through a REST call) after successful validation. The records will be deleted from the mentioned table at the end of the batch processing.

This will decrease QUANTITY from the SA_INPROGRESS_SALES table and decrease IN_PROGRESS_SALES_QTY from the ITEM_LOC_SOH table (for a SALE type transaction only) if there is any validation failure. This also populates the history ( SVC_RTLOG_DATA_LOAD_HIST ) and reject tables ( SVC_RTLOG_DATA_REJECT ).

Performance Considerations

The process for creating RTLOG files will be called in chunks. Maximum chunk size used is defined in the table RMS_PLSQL_BATCH_CONFIG .

Design Assumptions

N/A

Restart/Recovery

N/A

Tables Affected

TABLESELECTINSERTUPDATEDELETE
SVC_RTLOG_DATA_LOADYesNoNoYes
SVC_RTLOG_DATA_STAGINGYesYesYesYes
SVC_RTLOG_DATA_LOAD_HISTYesYesNoNo
SVC_RTLOG_DATA_REJECTNoYesNoNo
SA_INPROGRESS_SALESNoNoYesNo
ITEM_LOC_SOHNoNoYesNo

Create Store Day for Expected Transactions (sastdycr)

Module Name sastdycr.pc Description Create Store Day for Expected Transactions Functional Area Oracle Retail Sales Audit Module Type Business Processing Module Technology ProC Catalog ID RSA15 Wrapper Script rmswrap.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

The sastdycr batch program will create store/day, import log, and export log records. This program should run prior to uploading the sales data from POS/OMS for a given store/day. Store/days will be created for any open store expecting sales.

This program will also create Store/days a few days prior to the actual business date for the online stores, based on SA_SYSTEM_OPTIONS.CREATE_STORE_DAY_PRIOR.

This will be taken into consideration only when the program is executed without any date input.

Restart/Recovery

The logical unit of work in this program is store. Records are committed to the database when the commit counter is reached. The commit counter is defined by the value of INCREMENT_BY on the ALL_SEQUENCE table for the sequence SA_STORE_DAY_SEQ_NO_SEQUENCE.

Design Assumptions

N/A

Evaluate Transactions and Totals based on Client Defined Rules (sa_rules_eval_job)

Module Name sa_rules_eval_job Description Evaluate Transactions and Totals based on Client Defined Rules Functional Area Oracle Retail Sales Audit Module Type Admin - Ad hoc Module Technology Background Processing Catalog ID N/A Wrapper Script b8dwrap.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

This background job is composed of two steps processing. It will have a threading assignment and a business logic processing.

Thread assignment program will filter eligible records from the Sales Audit Store/Day table for all stores wherein auditing status is “Totaled”. Evaluating rules is integral to the sales auditing process. Rules make the comparisons between data from various sources. These comparisons find data errors that could be the result of either honest mistakes or fraud. Finding these mistakes during the sales auditing process prevents these errors from being passed on to merchandising and data warehouse systems.

Rules in Sales Audit are dynamic. Aside from basic data validations rules are not predefined in the system. Retailers have the ability to define through the online Rule Definition Wizard. Errors uncovered by these rules are available for review on-line during the interactive audit process. After users modify existing rules or create new ones, they become part of the rules the next time that this program runs. These records are chunked and Thread ID is assigned for each. They will be stored temporarily in a staging table.

The Business logic program will process all records from the staging table. Using bulk processing, this program will process the records for auditing evaluation by calling SA_AUDIT_RULES_SQL.PROCESS_AUDIT_RULES for each store day captured. It will free up and clean the staging table afterwards. There is a STOP ON NEXT feature in bulk processing (through a loop) where Administrators can stop this batch with a flip of this indicator.

Restart/Recovery

N/A

Key Tables Affected

Table 19-2 Key Tables Affected

TableSelectInsertUpdateDelete
RMS_BATCH_STATUSYesNoNoNo
B8D_PROCESS_CONFIGYesNoNoNo
JOB_AUDIT_LOGSNoYesNoNo
B8D_SA_RULES_EVAL_STGYesNoYesYes
SA_STORE_DAYYesNoYesNo
SA_RULE_HEADYesNoNoNo
SA_RULE_LOC_TRAITYesNoNoNo
SA_ERROR_WKSHTNoYesNoYes
SA_ERROR_TEMPNoYesNoNo
SA_ERRORNoYesYesYes
SA_TOTALNoNoYesNo

Table 19-2 (Cont.) Key Tables Affected

TableSelectInsertUpdateDelete
SA_TRAN_HEADNoNoYesNo
SA_TRAN_ITEMNoNoYesNo
SA_TRAN_DISCNoNoYesNo
SA_TRAN_TENDERNoNoYesNo
SA_TRAN_TAXNoNoYesNo

Design Assumptions

N/A

Evaluate Transactions and Totals based on Client Defined Rules (sarules)

Module Name sarules.pc Description Evaluate Transactions and Totals based on Client Defined Rules Functional Area Oracle Retail Sales Audit Module Type Business Processing Module Technology ProC Catalog ID RSA17 Wrapper Script batch_sarules.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

Evaluating rules is integral to the sales auditing process. Rules make the comparisons between data from various sources. These comparisons find data errors that could be the result of either honest mistakes or fraud. Finding these mistakes during the sales auditing process prevents these errors from being passed on to merchandising and data warehouse systems.

Rules in Sales Audit are dynamic. Aside from basic data validations, rules are not predefined in the system. Retailers have the ability to define them through the online Rule Definition Wizard. Errors uncovered by these rules are available for review online during the interactive audit process. After you modify existing rules or create new ones, they become part of the rules the next time that sarules.pc runs.

Restart/Recovery

The logical unit of work for this program is a SA_STORE_DAY record. Records are committed to the database when the commit_max_ctr defined for SARULES on the

RESTART_CONTROL table is reached. This program achieves inherent restart/recovery due to the fact that store/day records that are processed will be updated to an audit_status of A (audited), H (HQ errors pending), or S (store errors pending) and will not be fetched by the driving cursor when the program restarts.

Design Assumptions

N/A

Extract Totals and Rules (sa_rules_total_extract)

sa_rules_total_extract.ksh

Module Name sa_rules_total_extract.ksh Description environment. Functional Area Oracle Retail Sales Audit Module Type Admin - Ad hoc Module Technology ksh Catalog ID Wrapper Script rmswrap_shell_out.ksh

Extracts totals and rules, along with their related information from a source environment.

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

This program is one of a set of processes, along with Rules and Totals Upload, that migrates customer-defined totals and rules from a source environment into the destination environment. For example, this may be used to extract totals and rules set up in a pre-production environment to production prior to final cutover. When these programs are run, existing totals and rules information are extracted from the source environment, and then uploaded into the destination environment, overlaying the totals and rules previously configured in the target environment.

This program is the first step in the two-step process: The latest version of all totals and rules will be extracted from the source environment and written out to flat files.

The following information is extracted from the source environment:

  • Parm Type

  • Realm Type

  • Location Traits

  • Parm with the highest sequence number

  • Realm with the highest sequence number

  • VR Head

  • VR Realm

  • VR Parms

  • VR Links

  • Total Header - latest revision for the total

  • Total Header Translation - latest revision for the total

  • Total Location Traits - latest revision for the total

  • Total Restrictions - latest revision for the total

  • Total Usage - latest revision for the total

  • Rule Header - latest revision for the rule

  • Rule Header Translation - latest revision for the rule

  • Rule Location Trait - latest revision for the rule

  • Rule Components - latest revision for the rule

  • Rule Component Restrictions - latest revision for the rule

  • Rule Errors - latest revision for the rule

Restart/Recovery

N/A

Design Assumptions

N/A

Generate Next Sequence for Escheatment Processing (saescheat_nextesn)

Module Name saescheat_nextesn.pc Description Generate Next Sequence for Escheatment Processing Functional Area Oracle Retail Sales Audit Module Type Admin Module Technology ProC Catalog ID RSA25 Wrapper Script N/A

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

This batch program gets the next free sequence for use in the saescheat.pc process. This routine goes and gets a block of numbers when starting, and parcels them out as needed. Once they are all used up, it gets another block and returns a pointer to the string containing the next available number or NULL if an error occurs. This process is executed as part of the saexcheat.pc processing.

Restart/Recovery

NA

Design Assumptions

N/A

Get Reference Data for Sales Audit Import Processing (sagetref)

Module Name sagetref.pc Description Get Reference Data for Sales Audit Import Processing Functional Area Oracle Retail Sales Audit Module Type Integration Module Technology ProC Catalog ID RSA00 Wrapper Script batch_sagetref.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

This program will fetch all reference information needed by SAIMPTLOG.PC for validation purposes and write this information out to various output files. The following files are produced:

  • Items - contains a listing of all items in the system.

  • Wastage - contains information about all items that have wastage associated with them.

  • Reference Items - contains reference items, or below transaction-level items.

  • Primary Variant - contains primary variant information.

  • Variable Weight UPC - contains all variable weight Universal Product Code (UPC) definitions in the system.

  • Store/Days - contains all of the valid store/day combinations in the system.

  • Codes and Code Types - contains all code types and codes used in field level validation.

  • Error Codes and Descriptions - contains all error codes, error descriptions, and systems affected by the error.

  • Store POS Mappings

  • Tender Types

  • Merchants

  • Partners

  • Suppliers

  • Sales Audit Employees

  • Banners

  • Currency Codes

  • Promotions

  • Warehouses

  • Inventory Statuses

These files will be used by the automated audit to validate information without repeatedly hitting the database.

When running sagetref.pc, retailers can either create and specify the output files, or create only the output that they desire. For example, a retailer interested in only creating a more recent employeefile would simply place a hyphen (-) in place of all the other parameters, but still specify an employeefile name. This technique can be applied to as many or as few of the parameters as retailers wish. Note, however, that the item-related files (itemfile, refitemfile, wastefile, and primvariantfile) contain significant interdependence. Thus, item files must all be created or not created together.

In the list of reference data files above, standard UOM is part of the itemfile. To obtain the value, Sales Audit converts the selling Unit of Measure (UOM) to the standard UOM during batch processing. This conversion enables Sales Audit to later export the standard UOM to the systems that require its use.

Restart/Recovery

N/A

I/O Specification

Integration Type Download from Merchandising File Name Determined by runtime parameter Integration Contract IntCon000113 (itemfile) IntCon000114 (wastefile) IntCon000115 (refitemfile) IntCon000116 (primvariantfile) IntCon000117 (varupcfile) IntCon000118 (storedayfile) IntCon000119 (promfile) IntCon000120 (codesfile) IntCon000121 (errorfile) IntCon000122 (storeposfile) IntCon000123 (tendertypefile) IntCon000124 (merchcodesfile) IntCon000125 (partnerfile) IntCon000126 (supplierfile) IntCon000127 (employeefile) IntCon000128 (bannerfile) IntCon000129 (promfile) IntCon000130 (whfile) IntCon000131 (invstatusfile)

File Name: Item File

The ItemFile file name (Itemfile) is not fixed; it is determined by a runtime parameter.

Table 19-3 Itemfile - File Layout

Field NameField TypeDefault ValueDescription
ItemChar(25)N/AItem number
DeptNumber(4)N/ADepartment ID
ClassNumber(4)N/AClass
SubclassNumber(4)N/ASubclass ID
Standard UOMChar(4)N/AStandard Unit of Measure
Catchweight IndChar(1)N/ACatch weight indicator
Class vat IndChar(1)N/AClass Vat Ind

File Name: Waste Data File

The Waste Data File file name (wastefile) is not fixed; it is determined by a runtime parameter.

Table 19-4 wastefile - File Layout

Field NameField TypeDefault ValueDescription
ItemChar(25)N/AItem number
Waste typeChar(6)N/AWaste type
Waste pctNumber(12,4)N/AWaste pct

File Name: Reference Item Data

The Reference Item Data file name (ref_itemfile) is not fixed; it is determined by a runtime parameter.

Table 19-5 Ref_itemfile - File Layout

Field NameField TypeDefault ValueDescription
Ref ItemChar(25)N/AReference Item number
ItemChar(25)N/AItem number

File Name: Primary Variant Data File

The Primary Variant Data File file name (prim_variantfile) is not fixed; it is determined by a runtime parameter.

Table 19-6 prim_variantfile - File Layout

Field NameField TypeDefault ValueDescription
LocationNumber(10)N/ALocation number

Table 19-6 (Cont.) prim_variantfile - File Layout

Field NameField TypeDefault ValueDescription
ItemChar(25)N/AItem number
Prim VariantChar(25)N/APrimary variant

File Name: Variable Weight UPC Definition File

The Variable Weight UPC Definition File file name (varupcfile) is not fixed; it is determined by a runtime parameter.

Table 19-7 varupcfile - File Layout

Field NameField TypeDefault ValueDescription
Format IdChar(1)N/AFormat ID
Format descChar(20)N/AFormat description
Prefix lengthNumber(1)N/APefix Length
Begin item digitNumber(2)N/AItem digit begin
Begin var digitNumber(2)N/AVar digit begin
Check digitNumber(2)N/ACheck digit
Default prefixNumber(1)N/ADefault prefix
PrefixNumber(1)N/APrefix

File Name: Valid Store/Day Combination File

The Valid Store/Day Combination File file name (storedayfile) is not fixed; it is determined by a runtime parameter.

Table 19-8 storedayfile - File Layout

Field NameField TypeDefault ValueDescription
StoreNumber(10)N/AStore number
Business dateChar(8)N/ABusiness date in YYYYMMDD format
Store day seq noNumber(20)N/AStore day sequence number
DayNumber(3)N/ADay
Tran no generatedChar(6)N/AGenerated transaction number
POS data expectedChar(1)N/AIf system_code is POS, then Y;
otherwise N
Currency rtl decNumber(1)N/ACurrency rtl dec
Currency codeChar(3)N/ACurrency code
Country idChar(3)N/ACountry ID
Vat Include IndChar(1)N/AVat Include Indicator

File Name: Codes File

The Codes File file name (codesfile) is not fixed; it is determined by a runtime parameter.

Table 19-9 codefile - File Layout

Field NameField TypeDefault ValueDescription
Code typeChar(4)N/ACode type
CodeChar(6)N/ACode ID
Code seqNumber(4)N/ACode sequence

File Name: Error Information File

The Error Information File file name (errorfile) is not fixed; it is determined by a runtime parameter.

Table 19-10 errorfile- File Layout

Field NameField TypeDefault ValueDescription
Error codeChar(25)N/AError code
System CodeChar(6)N/ASystem Code
Error descChar(255)N/AError description
Rec solutionChar(255)N/AError rectify solution

File Name: Store POS Mapping File

The Store POS Mapping File file name (storeposfile) is not fixed; it is determined by a runtime parameter.

Table 19-11 storeposfile- File Layout

Field NameField TypeDefault ValueDescription
StoreNumber(10)N/AStore
POS TypeChar(6)N/APoint Of Sale type
Start Tran No.Number(10)N/AStart transaction number
End Tran No.Number(10)N/AEnd transaction number

File Name: Tender Type Mapping File

The Tender Type Mapping File file name (tendertypefile) is not fixed; it is determined by a runtime parameter.

Table 19-12 tendertypefile - File Layout

Field NameField TypeDefault ValueDescription
GroupChar(6)N/ATender type Group

Table 19-12 (Cont.) tendertypefile - File Layout

Field NameField TypeDefault ValueDescription
IdNumber(6)N/ATender type ID
DescChar(120)N/ATender type description

File Name: Merchant Code Mapping File

The Merchant Code Mapping File file name (merchcodesfile) is not fixed; it is determined by a runtime parameter.

Table 19-13 merchcodesfile - File Layout

Field NameField TypeDefault ValueDescription
Non Merch CodeChar (6)N/ANon-Merchant Code

File Name: Partner Mapping File

The Partner Mapping File file name (partnerfile) is not fixed; it is determined by a runtime parameter.

Table 19-14 partnerfile - File Layout

Field NameField TypeDefault ValueDescription
Partner TypeChar(6)N/APartner Type
Partner IdChar(10)N/APartner ID

File Name: Supplier Mapping File

The Supplier Mapping File file name (supplierfile) is not fixed; it is determined by a runtime parameter.

Table 19-15 supplierfile - File Layout

Field NameField TypeDefault ValueDescription
SupplierNumber(10)N/ASupplier ID
Sup statusChar(1)N/ASupplier status
Supplier ParentNumber(10)N/ASupplier Parent ID

File Name: Employee Mapping File

The Employee Mapping File file name (employeefile) is not fixed; it is determined by a runtime parameter.

Table 19-16 employeefile - File Layout

Field NameField TypeDefault ValueDescription
StoreNumber(10)N/AStore ID
POS IdChar(10)N/APoint Of Sale ID
Emp IdChar(10)N/AEmployee ID

File Name: Banner Information File

The Banner Information File file name (bannerfile) is not fixed; it is determined by a runtime parameter

Table 19-17 bannerfile - File Layout

Field NameField TypeDefault ValueDescription
StoreNumber(10)N/AStore ID
Banner dataNumber(4)N/ABanner ID
Stockholding IndChar(1)N/AStockholding Indicator
Customer Order
Loc Ind
Char(1)Customer Order Location Indicator

File Name: Currency Information File

The Currency Information File file name (currencyfile) is not fixed; it is determined by a runtime parameter.

Table 19-18 currencyfile - File Layout

Field NameField TypeDefault ValueDescription
Currency CodeChar(1)N/ACurrency Code

File Name: Promotion Information File

The Promotion Information File file name (promfile) is not fixed; it is determined by a runtime parameter.

Table 19-19 promfile - File Layout

Field NameField TypeDefault ValueDescription
PromotionNumber(10)N/APromotion ID
ComponentNumber(10)N/AThis contains the Offer ID value from
Pricing.

File Name: Warehouse Information File

The Warehouse Information File filename (whfile) is not fixed; it is determined by a runtime parameter.

Table 19-20 whfile - File Layout

Field NameField TypeDefault ValueDescription
WarehouseNumber(10)N/AWarehouse ID
Physical
Warehouse
Number(10)N/APhysical Warehouse ID
Customer Order
Loc Ind
Char(1)N/ACustomer Order Location Indicator

File Name: Inventory Status Information File

The Inventory Status Information File file name (invstatusfile) is not fixed; it is determined by a runtime parameter.

Table 19-21 invstatusfile - File Layout

Field NameField TypeDefault ValueDescription
Inventory StatusChar(10)N/AInventory Status

Design Assumptions

N/A

A Note about Primary Variant Relationships

Depending upon a retailer’s system parameters, the retailer designates the primary variant during item setup (through the front-end) for several reasons. One of the reasons is that, in some cases, an item may be identified at the POS by the item parent, but the item parent may have several variants.

The primary variant is established through a form at the item location level. The retailer designates which variant item is the primary variant for the current transaction level item. For more information about the new item structure in Merchandising, see the Oracle Retail Merchandising System User Guide.

In the example shown in the diagram below, the retailer has established their transaction level as an Item Level 2.

Note

The level of the primary variant is Item Level 1, and Item Level 3 is the sub-transaction level (the refitem).

The retailer set up golf shirts in the merchandising system as its Item Level 1 above the transaction level. The retailer set up two items at level 2 (the transaction level) based on size (small and medium).

Functional Area Oracle Retail Sales Audit Module Type Admin Module Technology ProC Catalog ID RSA26 Wrapper Script rmswrap.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

This program is one of a set of processes, along with Rules and Totals Extract, that migrates customer-defined totals and rules from a source environment into the destination environment. For example, this may be used to extract totals and rules set up in a pre-production environment to production prior to final cutover. When the processes are run, existing totals and rules information are extracted from the source environment, and then uploaded into the destination environment, overlaying the totals and rules previously configured in the target environment.

This program is the second step in a two-step process: The latest version of all totals and rules will be uploaded into the destination environment.

The following information is uploaded into the destination environment:

  • Parm Type

  • Realm Type

  • Location Traits

  • Parm

  • Realm

  • VR Head

  • VR Realm

  • VR Parms

  • VR Links

  • Total Header

  • Total Header Translation

  • Total Location Traits

  • Total Restrictions

  • Total Usage

  • Rule Header

  • Rule Header Translations

  • Rule Location Trait

  • Rule Components

  • Rule Component Restrictions

• Rule Errors

The tables that this information will be uploaded into will first be cleared out of any existing data, and then the statements in the files generated by the extract process will be run to upload the information from the source environment. After the upload, the sequences for realms, parms, and VR header will be updated to set the last value on the sequence to the maximum value of the ID fields.

When the rules and totals are uploaded, they will be rebuilt in the destination environment, using existing functions.

Restart/Recovery

N/A

Design Assumptions

N/A

Pre/Post Helper Processes for ReSA Batch Programs (saprepost)

Module Name saprepost.pc Description Pre/Post Helper Processes for Sales Audit Batch Programs Functional Area Oracle Retail Sales Audit Module Type Admin Module Technology ProC Catalog ID RSA26 Wrapper Script rmswrap.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

The Sales Audit pre/post module facilitates multi-threading by allowing general system administration functions (such as table deletions or mass updates) to be completed after all threads of a particular Sales Audit program have been processed.

This program will take three parameters: username/password to log in to Oracle, a program before or after which this script must run, and an indicator of whether the script is a pre or post function. It will act as a shell script for running all pre-program and post-program updates and purges.

saprepost contains the following helper functions, which are should be individually scheduled with the related main programs.

Table 19-22 Helper Functions
Catalog IDSaprepost JobRelated Main Program
RSA47saprepost saexprms postsaexprms
RSA48saprepost saexpdw postsaexpdw
RSA39saprepost saordinvexp postsaordinvexp
RSA51saprepost saexpsim postsaexpsim
saprepost sapreexp postsapreexp

Restart/Recovery

NA

Design Assumptions

N/A

Prevent Duplicate Export of Total Values from ReSA (sapreexp)

Module Name sapreexp.pc Description Prevent Duplicate Export of Total Values from Sales Audit Functional Area Oracle Retail Sales Audit Module Type Admin Module Technology ProC Catalog ID RSA20 Wrapper Script rmswrap.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

When you modify or revise a transaction through the Sales Audit user application, numerous totals may be affected and require re-totaling. The sales audit pre-export module is designed to compare the latest prioritized version of each total defined for export with the version that was previously sent to each system. If they are the same, an SA_EXPORTED entry is created for the total for that particular system, so that the same value will not be exported twice. By determining which totals have not changed since the last export date time (SA_EXPORTED_REV), this module will then create entries on SA_EXPORTED to prohibit any third-party application from receiving multiple export revisions.

Restart/Recovery

The logical unit of work for this module is defined as a unique store/day combination. Only two commits will be done. One to establish the store/day lock (this will be done by the package) and one at the end after a store/day or store/day/total has been completely processed.

Design Assumptions

N/A

Processing to Allow Re-Upload of Deleted Transactions (saimptlogtdup_upd)

Module Name saimptlogtdup_upd.pc Description Processing to Allow Re-Upload of Deleted Transactions Functional Area Oracle Retail Sales Audit Module Type Admin Module Technology ProC Catalog ID RSA19 Wrapper Script batch_saimptlogtdup_upd.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

The purpose of this batch module is to fetch all deleted transactions for a store day and modify the tdup.dat file to remove deleted transactions, from the tdup range, in order to facilitate the saimptlog/saimptlogi batch to upload deleted transactions again. The batch will process all the store day with data status in Partially Loaded and Ready For Import and a business date that lies between the vdate minus the sa_syatem_options. day_post_sale and the vdate. The batch will not process a store day, if the tdup.dat file does not exist. The batch is designed to work only if

sa_system_options.check_dup_miss_tran is set to Y, otherwise, do nothing and come out with successful completion. Also, the batch will not terminate with an error, if the deleted transaction to be removed from tdup range does not exist in the tdup.dat file.

Restart/Recovery

N/A

Design Assumptions

N/A

Purge Aged Data from Error table of saexproc batch (saexprocsalespurge)

saexprocsalespurge.ksh

Module Name

Description Purge Aged Data from Error table of saexproc batch Functional Area Oracle Retail Sales Audit Module Type Admin Module Technology Ksh Catalog ID Wrapper Script rmswrap_shell.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

The purpose of this module is to drop the partitions from the SA_EXPROC_SALES_ERROR table populated by the saexproc batch while exporting transactions from Sales Audit to Merchandising on a direct table load, based on the number of retention days passed as a runtime parameter to the batch. If a retention days input is not provided, then a default value of 95 days is used.

Note

This feature will be made available in future releases.

Performance Considerations

The retention period for the archived data should be carefully considered. Disregarding this results in the table space size reaching its limit and an inability to accommodate additional archive records.

Design Assumptions

N/A

Restart/Recovery

N/A

Key Tables Affected

TableSelectInsertUpdateDelete
SA_EXPROC_SALYesNoNoYes
ES_ERROR

Purge Aged RTLOG Data (sartlogdatapurge)

Module Name sartlogdatapurge.ksh

Description Purge Aged RTLOG Data Functional Area Oracle Retail Sales Audit Module Type Admin Module Technology Ksh Catalog ID Wrapper Script rmswrap_shell.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

The purpose of this module is to drop the partitions from the history ( SVC_RTLOG_DATA_LOAD_HIST ) and reject tables ( SVC_RTLOG_DATA_REJECT ) populated by the RTLOG creation process, based on the given retention days. If retention days input is not provided then a default value of 30 days will be used.

Performance Considerations

The retention period for the archived data should be carefully considered. Disregarding this would result in the table space size reaching its limit and it would not be able to accommodate additional archive records.

Design Assumptions

N/A

Restart/Recovery

N/A

Tables Affected

TableSelectInsertUpdateDelete
SVC_RTLOG_DATA_LOAD_HISTYesNoNoYes
SVC_RTLOG_DATA_REJECTYesNoNoYes

Purge Aged Store/Day Transaction, Total Value and Error Data from Sales Audit (sapurge)

Module Name sapurge.pc Description Purge Aged Store/Day Transaction, Total Value and Error Data from Sales Audit Functional Area Oracle Retail Sales Audit

Module Type Admin Module Technology ProC Catalog ID RSA21 Wrapper Script rmswrap_out.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

This program will be run daily to control the size of the tables in the sales audit database. Older information will be deleted to ensure optimal performance of the system as a whole.

Different kinds of data need to be kept in the system for different amounts of time. Transactions, all associated transaction details, and Totals calculated or reported for a store day will be deleted when they meet the following criteria:

  • The Business Date for those transactions and totals is older than or equal to today’s date minus the days_before_purge parameter set up on the sales audit system parameters.

  • No locks exist on the store/day.

  • One of the two following statements is true for the store/day:

    • Fully loaded, and all errors either corrected or overridden (sa_store_day.audit_status is A (Audited) and sa_store_day.data_status equals F (Fully loaded)). In addition, there are no outstanding exports (records for the store/day in the sa_export_log table where sa_export_log.status equals R (Ready for export)).

    • Never loaded (sa_store_day.audit_status is U (Unaudited) and sa_store_day.data_status equals R (Ready for import)).

Flash Sales data will be deleted when it meets the following criteria:

  • Date is two years before today’s date minus the days_before_purge parameter set up on the sales audit system parameters.

  • Company open and close dates will also need to be kept for two years plus days_before_purge, so that the historical comparisons in flash sales reporting carry the appropriate weight.

Voucher data will be deleted when it meets the following criteria:

  • The redeemed date or the escheat date for the specific voucher type is before today’s date minus the purge_no_days on sales audit voucher options table for the corresponding voucher type.

The program can also take in a list of store_day_seq_no to delete. For example, the command line could be: sapurge userid/passwd 1000 1001 1002, where 1000, 1001 and 1003 are store_day_seq_nos that you want to delete. These must also meet the criteria defined above. If a store_day_seq_no is passed to this program, but does not meet the criteria, an error will be written out to the error log.

An output file will be created to store a record for each store and business date that was purged. The file name must be passed in at the command line as a parameter to sapurge.

This program will also purge the data, which is being used for Sales Audit Auditor Framwork and purging criteria based on days_before_purge value from SA_SYSTEM_OPTIONS table.

Restart/Recovery

Restart/recovery is implicit in purge programs. The program only needs to be run again to restart appropriately.

Design Assumptions

N/A

Purge Exported Sales Audit Transactions (saexpsim_export_purge_job)

Module Name Description Functional Area Module Type Module Technology Catalog ID Wrapper Script

SAEXPSIM_EXPORT_PURGE_JOB

Purge exported transactions that have passed retention days from the Oracle Retail Sales Audit to Oracle Retail Store Inventory Management interface tables.

Sales Audit Admin – Ad hoc Background Processing b8dwrap.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

This background job finds all records on interface tables SA_EXPSIM_HEAD and SA_EXPSIM_DETAIL that have passed retention days based on the Sales Audit system option expsim_export_purge_days and purge the records by dropping partitions. It gives the option to copy the data to SA_EXPSIM_HEAD_PRG_HIST and SA_EXPSIM_DETAIL_PRG_HIST before purging.

Restart/Recovery

N/A

Key Tables Affected

TableSelectInsertUpdateDelete
SA_EXPSIM_HEADYesNoNoYes
SA_EXPSIM_DETAILYesNoNoYes
SA_EXPSIM_HEAD_PRG_HISTNoYesNoNo
SA_EXPSIM_DETAIL_PRG_HISTNoYesNoNo
Table
Select
InsertUpdateDelete
SA_SYSTEM_OPTIONS
Yes
NoNoNo
RMS_BATCH_STATUS
Yes
NoNoNo
B8D_PROCESS_CONFIG
Yes
NoNoNo
JOB_AUDIT_LOGS
No
History Tables (b8d_sa_purge)
YesNoNo
Module Name
b8saprgb.pls/ b8saprgs.pls
Description
Purge records into History tables
Functional Area
Financial data
Module Type
Admin - Ad hoc
Module Technology
Background Processing
Catalog ID
N/A
Wrapper Script
b8dwrap.ksh

Purge Into History Tables (b8d_sa_purge)

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

This background job is composed of two steps processing. It will have a threading assignment and a business logic processing.

Thread assignment program will filter eligible records based on the Store/Day, Sales Audit System Options, and Period tables. These records are chunked and Thread ID is assigned for each. They will be stored temporarily in a staging table.

The Business logic program will process records from the base tables based on Store Day Sequence Number, Store, and Business Day. Using bulk processing, this program will filter the records from the tables and insert the records into the history tables. Then the inserted records will be deleted from the base tables.

The decision to insert or not to insert the records into the history tables is based on the Archive Indicator and Archive Job Indicator from the Background Process Configuration table.

1. If the both the Archive Indicator and Archive Job Indicator values are Y, then the data from the base tables are inserted into the history tables.

2. If both indicators are set to ‘N’, then the records are deleted from the base tables without inserting into the history tables.

Restart/Recovery

N/A

Key Tables Affected

TableSelectInsertUpdate
Delete
PERIODYesNoNo
No
SYSTEM_OPTIONSYesNoNo
No
RMS_BATCH_STATUSYesNoNo
No
B8D_PROCESS_CONFIGYesNoNo
No
B8D_SA_PURGE_STGNoYesNo
No
ALL_PART_TABLESYesNoNo
No
SA_COMMENTS_HISTNoYesNo
No
SA_CUSTOMER_HISTNoYesNo
No
SA_CUST_ATTRIB_HISTNoYesNo
No
SA_ERROR_HISTNoYesNo
No
SA_ERROR_REV_HISTNoYesNo
No
SA_EXPORTED_HISTNoYesNo
No
SA_EXPORTED_REV_HISTNoYesNo
No
SA_EXPORT_LOG_HISTNoYesNo
No
SA_FLASH_SALES_HISTNoYesNo
No
SA_HQ_VALUE_HISTNoYesNo
No
SA_IMPORT_LOG_HISTNoYesNo
No
SA_MISSING_TRAN_HISTNoYesNo
No
SA_POS_VALUE_HISTNoYesNo
No
SA_STORE_DAY_HISTNoYesNo
No
SA_STORE_VALUE_HISTNoYesNo
No
SA_SYS_VALUE_HISTNoYesNo
No
SA_TOTAL_HISTNoYesNo
No
SA_TRAN_DISC_HISTNoYesNo
No
SA_TRAN_DISC_REV_HISTNoYesNo
No
SA_TRAN_HEAD_HISTNoYesNo
No
SA_TRAN_HEAD_REV_HISTNoYesNo
No
SA_TRAN_IGTAX_HISTNoYesNo
No
SA_TRAN_IGTAX_REV_HISTNoYesNo
No
SA_TRAN_ITEM_HISTNoYesNo
No
SA_TRAN_ITEM_REV_HISTNoYesNo
No
SA_TRAN_PAYMENT_HISTNoYesNo
No
SA_TRAN_PAYMENT_REV_HISTNoYesNo
No
SA_TRAN_TAX_HISTNoYesNo
No
SA_TRAN_TAX_REV_HISTNoYesNo
No
SA_TRAN_TENDER_HISTNoYesNo
No
SA_TRAN_TENDER_REV_HISTNoYesNo
No
SA_COMMENTSYesNoNo
Yes
TableSelectInsertUpdateDelete
SA_CUSTOMERYesNoNoYes
SA_CUST_ATTRIBYesNoNoYes
SA_ERRORYesNoNoYes
SA_ERROR_REVYesNoNoYes
SA_EXPORTEDYesNoNoYes
SA_EXPORTED_REVYesNoNoYes
SA_EXPORT_LOGYesNoNoYes
SA_FLASH_SALESYesNoNoYes
SA_HQ_VALUEYesNoNoYes
SA_IMPORT_LOGYesNoNoYes
SA_MISSING_TRANYesNoNoYes
SA_POS_VALUEYesNoNoYes
SA_STORE_DAYYesNoNoYes
SA_STORE_VALUEYesNoNoYes
SA_SYS_VALUEYesNoNoYes
SA_TOTALYesNoNoYes
SA_TRAN_DISCYesNoNoYes
SA_TRAN_DISC_REVYesNoNoYes
SA_TRAN_HEADYesNoNoYes
SA_TRAN_HEAD_REVYesNoNoYes
SA_TRAN_IGTAXYesNoNoYes
SA_TRAN_IGTAX_REVYesNoNoYes
SA_TRAN_ITEMYesNoNoYes
SA_TRAN_ITEM_REVYesNoNoYes
SA_TRAN_PAYMENTYesNoNoYes
SA_TRAN_PAYMENT_REVYesNoNoYes
SA_TRAN_TAXYesNoNoYes
SA_TRAN_TAX_REVYesNoNoYes
SA_TRAN_TENDERYesNoNoYes
SA_TRAN_TENDER_REVYesNoNoYes
SA_CUSTOMERYesNoNoYes
SA_POS_VALUE_WKSHTYesNoNoYes
SA_SYS_VALUE_WKSHTYesNoNoYes
SA_ERROR_WKSHTYesNoNoYes
SA_STORE_ACHYesNoNoYes
SA_ESCHEAT_VOUCHERYesNoNoYes
SA_ESCHEAT_TOTALYesNoNoYes
KEY_MAP_GLYesNoNoYes
SA_GL_REF_DATAYesNoNoYes
SA_STORE_DAY_WRITE_LOCKYesNoNoYes

Purge the Invalid In-progress Sales Bucket (sainprogresspurge)

Module Name sainprogresspurge.ksh Description Purge the invalid in-progress sales bucket Functional Area Oracle Retail Sales Audit Module Type Admin Module Technology Ksh Catalog ID Wrapper Script rmswrap_shell.ksh

Schedule

Oracle Retail Merchandising Batch Schedule

Design Overview

The purpose of this module is to delete the records from SA_INPROGRESS_SALES and SVC_INPROGRESS_SALES tables for the Store Days which have been closed and for which all the sales data has been exported to Merchandising. With that, it will also adjust the in-progress sales quantity in ITEM_LOC_SOH corresponding to the impacted item-location combination in SA_INPROGRESS_SALES .

Performance Considerations

N/A

Design Assumptions

N/A

Restart/Recovery

N/A

Tables Affected

TableSelectInsertUpdateDelete
SA_INPROGRESS_SALESYesNoNoYes
SVC_INPROGRESS_SALESNoNoNoYes
ITEM_LOC_SOHNoNoYesNo
SA_TRAN_HEADYesNoNoNo
SA_TRAN_ITEMYesNoNoNo
SA_STORE_DAYYesNoNoNo
SA_EXPORTEDYesNoNoNo

In this guide

  • 6 Scheduled IntegrationInbound and Outbound Integration Guide · shares ES_ERROR, RESTART_CONTROL, RMS_PLSQL_BATCH_CONFIG, SA_BALANCE_GROUP
  • 5 ReSTful Web ServicesInbound and Outbound Integration Guide · shares SA_ERROR, SA_HQ_VALUE, SA_INPROGRESS_SALES, SA_POS_VALUE