RIL RP9 Database and Custom Programming Guide
RIL RP9 Database and Custom Programming Guide
USA 1-800-738-2457
International +1-916-605-7200
www.retailpro.com
RIL (or RP9) Database and Custom Programming Guide
USA 1-800-738-2457)
International +1-916-605-7200
www.retailpro.com
Trademarks
Retail Pro and the Retail Pro logo are registered trademarks and/or registered service marks in the United
States and other countries. Oracle and Oracle 11g are registered trademarks and/or registered service marks
of Oracle Corporation. All rights reserved. Other parties’ trademarks or service marks are the property of
their respective owners and should be treated as such.
Date Description
12/01/2011 Added Tender Types and info on Tender Type 12 (Foreign Currency).
05/08/2012 Updated INVN_SBS with text1-text10 and other new fields.
07/27/2012 Removed XML Files info. XML File information can be found in the
Retail_Pro_9_XML_Files.pdf document
02/22/2022 Updated copyright date.
Table Of Contents
About this Guide ...............................................................................................................................................2
Introduction ........................................................................................................................................................4
About the Database and Custom Programming Guide .............................................................4
Key Benefits of Oracle11g ......................................................................................................................4
Restrictions on Accessing Oracle Tables and Views ....................................................................7
Database FAQs ...........................................................................................................................................7
Adding Custom Buttons for Outside Applications .................................................................... 31
Custom Programming Guide .................................................................................................................... 34
About Custom Programming in Retail Pro 9 ............................................................................... 34
Retail Pro Schema .................................................................................................................................. 36
Key Performance Statistics ......................................................................................................................... 47
Average Daily Inventory ...................................................................................................................... 47
Turn ............................................................................................................................................................. 47
GMROI ........................................................................................................................................................ 48
Sell Thru % ................................................................................................................................................ 52
Days of Supply ........................................................................................................................................ 52
Index ................................................................................................................................................................... 53
Introduction
About the Database and Custom
Programming Guide
This document provides overview and detailed information for custom programmers
and database administrators who are using Retail Pro 9.
The first section of the` documentation explains how to install the Retail Pro server
and clients, basic database concepts, and how to use custom programming to
retrieve data from Retail Pro.
For example, custom programmers will learn how to:
▪ Populate a Microsoft Excel® spreadsheet with selected Retail Pro data.
▪ Create custom reports using Microsoft Access®.
▪ Incorporate Retail Pro data into a Microsoft Word® mail merge document.
All examples use an ODBC connection to access the Retail Pro database.
Scalability
Oracle11g utilizes a multi-tiered architecture, so program components can be
distributed across multiple machines. For example, one server might host the
database and perform data access functions, another server might host a reporting
server and perform business analytic functions, and a workstation might run Retail
Pro and print reports. As your business grows, Oracle11g allows for easy scalability
by distributing the system across multiple servers as necessary.
Analytical Power
The database is designed to quickly and efficiently calculate analytical and
aggregated information in the database without taking up extra disk space from
storing values. Average daily values are easily accessed and transformed into
statistical information. For example, using the Stock Ledger feature, you can quickly
view the inventory on hand values for any store at any point in history.
Reliability and Security
The data that is generated during day-to-day operations must be protected at all
costs. Oracle11g has built-in safeguards to protect data against unplanned system
failure, storage failure, site failure or, human error.
Security was a primary consideration in all aspects of the design of our database
engine. Oracle11g addresses security vulnerabilities by securing transmitted data,
encrypting sensitive information, restricting user access at the record level, and
providing a single point of entry to authorized applications.
Data Integrity
Oracle11g contains several built-in mechanisms to protect data integrity. In addition,
information is stored relationally, which allows much more flexibility and efficiency in
maintaining data. For example, an item's historical data will remain linked even if
item information, such as the description, is changed.
Interoperability and Open Architecture
Retail Pro is probably not the only system in your retail environment. The Oracle 11g
database is designed to maximize interoperability, the ability of one computer
application to communicate with another application. In addition, Oracle 11g is built
with an open architecture, which allows open access to the Retail Pro database for
custom application development or custom reporting.
Low Administration
Perhaps the most important reason why Island Pacific has chosen to embed the
Oracle 11g database is that it virtually eliminates database administration. Through
its built-in utilities, the database can be tuned, backed up or rebuilt, dramatically
reducing the level of maintenance needed.
Database FAQs
What is SQL?
Structured Query Language, developed in the 1970s.
What is PL/SQL?
Procedural language for SQL. Allows you to control the flow of operations as with any
development language such as Visual Basic, C, PowerBuilder, Delphi etc.
What is DML?
Data manipulation language used to Select, Insert, Update and Delete data.
What is a table?
The basic storage object in a database.
What is a standard view?
A standard view is a stored SQL statement that can be accessed by a user in the
same manner as they would access a table. When a view in queried, Oracle will
execute the stored SQL and return the result set to the user.
What is an object view?
An object view is similar to a standard view in the way that it is a stored SQL
statement but it also contains built in relationships between data that would have to
be manually formulated if you were using a standard view.
What is a stored procedure?
A stored procedure is a block of PL/SQL code stored in the database that can be used
by other applications. A stored procedure can be packaged into an Oracle package so
that procedures and functions can be grouped together. A stored procedure can
optionally return data back to the calling application.
Controllers
Each installation of the Retail Pro 9 database is called a controller and is assigned an
identifying number.
Retail Pro requires you to assign a Controller when you restart your computer after
installing Retail Pro.
The Controller enables Retail Pro to track the origin of a document, as well as the
location of edits made to that document after its initial creation. The originating
Controller remains on that document and can not be updated or changed.
The Controller, combined with other key identifiers such as Subsidiary, Store, and
Workstation, identify each part of your company down to the individual workstation.
Controllers vs. Stations
The Controller field replaces the Station Number, which is used in earlier versions
of Retail Pro, as the key field for identifying the origin of documents.
Each workstation in Retail Pro 9 is assigned to a controller. This is different from 8
Series, where each workstation is assigned to a station.
Assigning a Controller
Typically, you specify a Controller (as well as Subsidiary and Workstation) when you
restart your computer after installing a new Retail Pro® installation.
Note: You can specify the controller in the Workstation Preferences > General later,
but you will not be able to create documents or customers until you specify the
identifiers.
Within a subsidiary, you can use a Controller only once. You can assign up to 999
Controllers per subsidiary/store combination.
Planning Controllers
Before installing Retail Pro, plan your Controllers so that there is no uncertainty
about which Controller will be assigned which workstations.
Additional Tracking Fields
Retail Pro uses these additional fields to track document history:
▪ Orig Controller
▪ Orig Global Store Code
▪ Orig Store
▪ Orig Station
1. Select Tools > Update Delta from the top menu of the Home Screen.
Alternatively, select Merchandise > Audit from the Home Screen to access the
Audit area., and then click Update Delta. A confirmation dialog displays.
2. Click Yes to confirm the build. The Oracle Logon dialog displays.
1. Set up a new task for Techtoolkit.exe in Schedule Editor. Assign any of the
command line parameters listed below:
Abbreviations
The following table lists common abbreviations that are used in the database schema
and in the XML files. This information is useful for 3rd-party developers who are
using the XML files to develop reports and other 3rd-party applications.
Word Abbreviation
Accounts Payable AP
Accounts AR
Receivable
Acknowledge Ack
Address Addr
Adjustment Adj
Allocation Alloc
Alternate Alt
Amount Amt
Application App
Approved Approv
Attribute Attr
Audit Audt
Authorize Auth
Automatic Auto
Average Avg
Calendar Cal
Check Chk
Commission Comm
Company Cmp
Component Cmpnt
Configuration Cfg
Count Cnt
Currency Curr
Word Abbreviation
Customer Cust
Database DB
Default Deflt
Definition Def
Delete Del
Denomination Denom
Deposit Depst
Description Desc
Dictionary Dict
Discontinued Discon
Discount Disc
Document Doc
Driver's License DL
Employee Empl
Error Err
Excluded Excl
Expiration Exp
Extended Ext
Field Fld
Fields Flds
Filter Fltr
First Fst
Foreign Currency FC
Function Func
Word Abbreviation
Gift GCSC
Certificate/Store
Credit
Global Glob
Group Grp
History Hist
Import Imp
Included Incl
Information Info
Inspected Insp
Instructions Instr
Internal Int
Invoice Invc
Language Lang
Last Lst
Length Len
Level Lvl
Location Loc
Maximum Max
Message Msg
Minimum Min
Movement Mov
Movement Note MN
Number No
On Hand OH
Operating System OS
Order Ord
Original Orig
Word Abbreviation
Package Pkg
Parameters Params
Pattern Ptrn
Payment Pmt
Percent Perc
Permission Perm
Physical PI
Inventory
Position Pos
Preference Pref
Processed Proc
Purchase Purch
Purchase Order PO
Quantity Qty
QuickBooks QB
Rebate Reb
Received Rcvd
Reference Ref
Region Rgn
Repair Rpr
Repair Order RO
Repository Rp
Required Req
Resolved Resolv
Responsible Resp
Sales Order SO
Word Abbreviation
Salesperson SPIF
Incentive Fee
Schedule SC
Security Sec
Sequence Seq
Size Siz
Source Src
Statistic Stat
Sublocation Subloc
Subsidiary Sbs
Supplemental Suppl
Target Trgt
Trademark TM
Transaction Trx
Transfer Trans
Transit Trans
Value Val
Vendor Vend
Verified Verif
Voucher Vou
Wait List WL
With Tax WT
Workstation WS
Layout Options
Option Comments
Place all schema The performance advantage of hardware striping far
objects on one outweighs any disadvantage caused by combining data and
or more large index, or any other schema types.
RAID 10 arrays
Place redo logs Place each log thread on a separate RAID 1 pair. This allows
on RAID 1 or sequential read optimization algorithms on the storage array
RAID 10 arrays to be activated.
An alternative is to include redo log files with the main RAID
10 disk set. This is useful where log write activity is low, or
where there are a limited number of disks.
Place archive Both for performance and availability reasons, archive logs
log files on should be physically separated from other data types.
RAID 1, RAID
10, or RAID 5
disks
RAID Levels
Oracle can take advantage of each type of RAID configuration. RAID levels are
described below.
Importing Documents
You can import any document in xml format into Retail Pro using the Enterprise
Communication Manager (ECM). This enables you to import documents from outside
or legacy systems into Retail Pro. When importing documents, make sure to include
the required fields for that document type.
Important! To import the Invoice.xml file, the INVN_BASE_ITEM section is required.
To import documents into Retail Pro:
1. Add the transaction information to the appropriate xml file. For example, add
sales transaction information to the Invoice.xml file. (Make sure the file includes
INVN_BASE_ITEM)
2. Place the file in the ECM\Polling\[Station]\In\Recvd directory.
3. Perform a Process In operation using the Enterprise Communications Manager
(ECM).
Flag Field Must Be Set to "0" for Receipts to Update On-Hand Quantity
If importing items into Retail Pro, be sure to set the Flag field in the Inventory.xml
file to “0”. If you don’t set the Flag field to “0” in the Inventory.xml file, receipts that
are imported into Retail Pro will not update the item’s on-hand quantity.
Importing Items
You can import items in xml format into Retail Pro using the Enterprise
Communication Manager (ECM). This enables you to import items from outside or
legacy systems into Retail Pro 9.
This section explains how to import new items into the Retail Pro v9 database from
an external system and how to perform updates.
If you are importing a receipt (Invoice.xml) or other document, and the items on the
document do not exist in the target inventory, ECM will create those items and mark
them with a status of Inactive.
To import new items into Retail Pro:
Important!: Do not leave a required field blank or use empty quotation marks (“ “)
Bit Function
0 Skip Committed flag
1 Skip Inventory flag (i.e. Non-inventory item)
2 Non-editable flag. An example of this would be the CMS flag,
used in v9 but not used in v8.
3-7 Reserved for future use.
The following table lists the integer value that should be entered in the Flag field to
achieve the desired setting.
Integer Description
Value
0 All flags deselected (0000 0000). An item with this setting
would be included in Committed, would not be a non-
inventory item, and would be editable.
1 Enables the Skip Committed flag (0000 0001)
2 Enables the Non-Inventory flag (0000 0010)
3 Enables both the Skip Committed and Non-Inventory flags.
(0000 0011)
4 Enables the CMS flag (0000 0100)(
5 Enables the CMS and Skip Committed flag (0000 0101)
6 Enables the CMS flag and the Non-Inventory flag (0000
0110)
7 Enables the CMS flag, Non-Inventory flag, and the Skip
Importing Employees
Security Information for New Employees Imported into Retail Pro 9
When you import new employees into Retail Pro 9 via the Employees.xml file, you
must import the employees without password or security settings. After the basic
information for the employee is added, you must go into Employee Mgmt > Groups
to assign passwords, security rights, and privileges.
Security information is stored in the <SECURITY_SETTINGS> area of the XML file. A
sample of which is shown below:
<SECURITY_SETTINGS sig1="80095CC838C28504CBB5E89A20985A10FFF9187F">
<EMP_SBSS>
<EMP_SBS sbs_no="1" access_all="1" stores="0-1"/>
</EMP_SBSS>
<CMS_USER user_id="97" user_name="USER2" sbs_no="1" active="1" password="C498F7B745"
sysadmin="0" sig2="49E5E008F0B1F5E306701BE393602844A2FFA5B">
<USER_GROUPS>
</USER_GROUPS>
</CMS_USER>
<SIGNATURE sig3="D9FBBA855F6D5BFFB73E2C08134377B9FB11AAFC"/>
</SECURITY_SETTINGS>
These are not required fields. If you are importing new employees into Retail Pro 9,
do not enter values in these fields for the new employees. When you assign
password and security information, the fields will be populated by the system.
2. In the Usermenu.txt file, enter information for each button in the following
format:
[1]
UpdateUserMenu [Application_Name], app1.exe
[2]
UpdateUserMenu [Application_Name], app2.exe
3. Save the file to the \Programs\ folder of the Retail Pro 9 Maintenance Pack.
4. Run the Maintenance Pack.
Result: The Maintenance Pack updates the Usermenu.ini file.
5. After running the Maintenance Pack, start Retail Pro, and then click Tools.
Buttons that link to the programs added via the Usermenu.txt file will be
displayed. Select a button to launch the application.
2. Right-click the TNSNames.ora file and select Open With ..., and then select
Notepad.
Result: The file opens in Notepad.
3. Add code for each additional database, similar to the illustration below.
Warning: The syntax of this file is important to Oracle. Do not add extra space
characters or rearrange the format of the TNS entry.
1. Right-click in an empty area of the desktop, and select New > Shortcut. The
Create Shortcut Wizard displays.
2. Type or browse to the location of Retail Pro 9 (RPRO9.exe), and then click Next.
3. Type a name for the shortcut, and then click Finish.
5. Select the Shortcut tab. Modify the Target field to point to the appropriate server,
and then click OK.
6. Repeat for each database to which you want to connect.
7. To access a particular database, double-click the shortcut for that database.
▪ Incorporate Retail Pro data into a Microsoft Word mail merge document.
All examples use an ODBC connection to access the Retail Pro database (see
Creating an ODBC Connection to Retail Pro for instructions).
Views
Views provide a standardized interface to the underlying database and are vital to
the custom development process. Developers do not need to understand all the
referential integrity relationships of the relational database.
Once the complexity of the underlying database structure is abstracted via views,
custom applications rely on the Oracle standard view interface. Because the interface
to the database stays the same, applications do not require modification (or re-
compilation) when the database structure changes.
What is a Standard View?
A standard view (or view) is a tailored presentation of the data contained in one or
more tables or other views. A view takes the output of a query and puts it in a table
format. Therefore, a view can be thought of as a stored query or a virtual table. You
can use views in most places where a table can be used.
For example, the Invoice table has several columns and numerous rows of
information. If you want users to see only five of these columns or only specific
rows, then you can create a view of that table for other users to access.
http:\\www.microsoft.com/data/download 26sp2.htm.
Entering Username and Password
You may be prompted for a username and password the first time you connect to
Retail Pro from within an application (Microsoft Access, Microsoft Excel, Microsoft
Query, etc.). Refer to the Database Name and Reportuser User Account tables for
connection information.
General Examples
To help custom developers, the following examples are provided to show the various
methods of accessing Retail Pro views. Examples are provided for illustrative
purposes only. In addition to these general examples, you can also examples for
Microsoft Excel, Microsoft Access, and Microsoft Word.
Refer to the View Descriptions section for more information.
3. Click OK.
1. To start, click Clear Worksheet. Then, enter a SQL statement (or use the default
SQL statement and click Execute Query.
If you wanted to use Microsoft Query Designer to write a SQL query, select Run
MS Query to launch the Microsoft Query Designer. This allows you to design a
new query that can be used to populate the Excel worksheet. The example
application does not support this functionality but you can refer to the MS Query
and MS Excel documentation for instructions on how to do this. For more
information, select the Help button. You can copy and paste the SQL statement
created in MS Query into the example application’s SQL Entry Window. When you
select the Help button, the on-line help instructions are displayed in a pop-up
dialog box.
2. After entering a SQL query and clicking Execute Query, the worksheet will be
populated with the Retail Pro data returned from the query.
2. Before running the next query, clear the worksheet by clicking Clear Worksheet.
1. Copy the Microsoft Word file and the query file to any folder on your hard drive.
2. Double-click on FormLetterExample.doc.
3. When prompted, select ‘Find datasource…’ and open to Customer A-List.dqy.
4. You are prompted again to connect to the datasource each time the mail merge
document is opened. Select Yes.
5. You are not prompted the next time that you run the example.
6. Word will connect to the data source and retrieve the data.
Once the data is retrieved Word will automatically merge the customer data into the
form letter where the mail merge fields have been defined.
Turn
Turn (also called Turnover) is a measure of how fast you are moving items through
the door to customers. The advantages of having a high Turn rate include:
▪ Increased sales volume Fresh merchandise sells better and faster than
old, shopworn merchandise.
▪ Less risk of obsolete stock and markdowns When inventory is selling
quickly, merchandise isn't in the store long enough to become obsolete. As a
result, markdowns are reduced and gross margins increase.
▪ More money for market opportunities When Turn is high, money
previously tied up in inventory is freed to buy more merchandise.
▪ Decreased operating expenses An increase in Turn may mean that a
lower level of inventory is supporting the same level of sales, which translates
to lower inventory carrying costs.
However, an excessively high Turn rate can hurt retailers in the following ways:
▪ Lowered sales volume If customers can’t find the size or color they seek—
or even worse, if they can’t find the product line at all—a sale is lost.
▪ Increased cost of goods sold By buying smaller quantities, the buyer can’t
take advantage of quantity and freight discounts.
▪ Increased operating expenses A buyer spends about the same amount of
time meeting with vendors and writing orders whether the order is large or
small. It also takes about the same amount of time, for both large and small
orders, to print invoices, receive merchandise, and pay invoices.
GMROI
GMROI reports the gross profitability of an item — the number of margin dollars
returned in one year for each dollar invested in inventory stock. An easy way to think
of GMROI is: “For every dollar I put into this item, I will get X amount back, on an
annual basis.”
GMROI helps retailers:
Put inventory dollars into merchandise that gives the greatest return on their
investment.
Identify low-profit merchandise that can be culled from the inventory mix.
Improving GMROI
Gross margin is the value of sales minus the cost of goods sold. To increase gross
margin, you must either increase sales revenue or reduce the cost of the
merchandise.
The obvious way to increase sales revenue is simply to increase prices.
Unfortunately, in a competitive environment, that is not so simple.
Here are three possible strategies to employ to increase GMROI:
▪ Raising Prices
▪ Careful Use of Markdowns
▪ Reducing Cost of Goods Sold
Raising Prices
A common rule of thumb is to avoid price increases on products that are known
value items or those that your competitors focus on for price comparisons.
Reducing Markdowns
Reducing markdowns is another strategy for improving GMROI. To do this, track the
Sell Through % by store.
Suppose Store A is selling faster than plan and will sell out early. Store B is selling
slower than plan but a markdown may help it along. Store C is doing really poorly
and even a large markdown may not be enough to clear the problem. In this case,
consider moving merchandise from Store C to Store A, where it can still sell at full
price.
GMROI Example
Here is an example of how GMROI works.
You purchase 1 pen on Jan. 1 from your vendor for $0.10 The pencil has a selling
price of $1.00 and stays in your inventory the entire year until, finally, on Dec. 31,
someone comes into your store and buys it. The Annualized Profit (Margin $) is 90
cents ($1.00 - $0.10 = $0.90). The Average Daily Cost is 10 cents (its Cost on Jan 1
was $0.10, on Jan.2 was $0.10 … all the way to Dec. 31).
When we divide the annualized profit by the average daily cost, we get a GMROI of
9.
$0.90
(Annualized Profit) =9
$0.10
(Average Daily Cost)
If instead you buy 12 pens on Jan. 1 (for $1.20) and sell all 12 on Dec. 31, (for
$12.00), the annualized profit increases, but the average daily cost increases at the
same rate, so GMROI stays the same.
$10.80
(Annualized Profit) =9
$1.20
(Average Daily Cost)
However, if you buy 12 pens on Jan. 1 and sell one pencil at the end of every month,
the annualized profit is still $10.80 ($12.00 - $1.20), but the Average Daily Cost
drops to $0.60.
$10.80
(Annualized Profit) = 18
$0.60
(Average Daily Cost)
Suppose that you don’t want to pay storage costs throughout the year, so you buy
only one pen at the beginning of every month and then sell it on the last day of
every month. Your annualized profit is still $10.80 but the average daily cost drops
to $0.10. This increased profitability is shown in the increase of GMROI to 108.
Annualized Profit
($10.80) = 108
Average Daily Cost
($0.10)
Stock/Sales
Stock/Sales is the ratio (for a specified period) of stock available for sale to what was
sold.
If Stock/Sales is higher than usual, it means merchandise isn’t selling as quickly as
anticipated. To correct the imbalance, retailers will have to cut back on orders or
mark down merchandise to avoid becoming overstocked.
Sell Thru %
Sell Thru % is the percentage of items available for sale (for a specified period) that
were actually sold, in other words, the inverse of Stock/Sales. The lower the
Stock/Sales ration, the higher the Sell Thru %. For example, if you had 1,500 units
available at the beginning of the period and sold 500, the Sell Thru % would be
33.33.
Days of Supply
The Days of Supply (DOS), tells you the number of days until you sell out your
remaining stock of the item.
Days of Supply (DOS) tells you the number of days remaining until you sell out your
remaining stock of an item.
This statistic helps retailers decide when to reorder merchandise. For example, if a
vendor requires a lead time of one week for reorders of a certain item, and the
remaining days of supply is 10, a retailer needs to start making a purchase order
soon or risk selling out of an item.
Index
A Flag field .......................................................... 26
Abbreviations ................................................ 12 G
Average Daily Inventory (ADI)................. 45 GMROI .............................................................. 46
C I
Controllers ......................................................... 9 Importing documents................................. 21
Custom buttons............................................ 29 Importing employees ................................. 28
Custom programming Importing items ............................................ 24
creating ODBC connection.................. 34 Items
general examples .................................... 36 importing items into Retail Pro.......... 24
Microsoft Access example ................... 38 M
Microsoft Excel example ...................... 40 Multiple databases from single
Microsoft Word example ..................... 43 workstation ................................................ 30
restrictions on accessing tables and O
views .......................................................... 7 Oracle 11g......................................................... 4
Custom programming ............................... 32 S
D Schema ............................................................. 34
Database Sell Thru % ...................................................... 50
file layout ................................................... 17 Stock/Sales ..................................................... 49
terminology ................................................. 7 T
Database ............................................................ 4 Turn ................................................................... 45
Days of Supply .............................................. 50 U
F Usermenu.ini .................................................. 29
File layout ....................................................... 17