You are on page 1of 30

Usage of Region Interface

An Oracle White Paper


June 2005
Usage of Region Interface

Abstract............................................................................................. 3
Overview of Regions and Zones..................................................... 3
Setting Up ..................................................................................... 6
Order Processing.......................................................................... 6
Technical Details.............................................................................. 7
WSH_REGIONS_INTERFACE....................................................... 8
WSH_REGIONS_TL_INTERFACE................................................. 8
Region Interface with examples.................................................... 10
A) First Use of Region interface ................................................ 11
Example: 1 .............................................................................. 11
Example: 2 .............................................................................. 18
B) Second use of Region Interface............................................ 28
Caution: .......................................................................................... 29
Summary......................................................................................... 29

Usage of Region interface Page 2


Usage of Region Interface

ABSTRACT
Region Interface is a powerful interface, which can be used to import the
regions available to the Oracle Shipping Regions base tables. In this
document we will try to examine the overview of the Regions, the
technical information related to Region Interface and the Usage of Region
interface to import the Region related information to be made use by the
Oracle Advanced Planning and Scheduling Suite. The region Information
imported can be used to define the intransit times for movement of goods
to these regions.

OVERVIEW OF REGIONS AND ZONES

If you have the Oracle Advanced Planning and Scheduling Suite installed,
use regions and zones to group by geographical areas and save the effort
of setting up point-to-point transit times.

You can:
• Group geographical areas into regions and set transit times from
your warehouses to the regions. For example: Create a region for
San Francisco Bay U.S.A. and specify that it consist of the cities San
Francisco, Oakland, and Berkeley.
• Set up a transit time of two days from your New York U.S.A.
warehouse to the San Francisco Bay U.S.A. region.

• Group regions into zones and set transit times from your
warehouses to the zones to encompass a larger geographic area.

The Oracle Advanced Planning and Scheduling Suite use this origin-
destination information to plan and schedule shipment departure dates,
arrival dates, and sourcing.

Region and zone terms are:


• Region: A geographical area, for example, a group of cities, states,
provinces, or a country. Region information is hierarchical (postal
codes belong to cities which belong to provinces which belong to

Usage of Region interface Page 3


countries), standard (defined by political and geographical boards),
and is usually available through third-party vendors and standards
agencies.

• You can model regions at different levels of scale. A region can


consist of countries, provinces/states, cities, or postal codes.

• Sub-region: A child of a region. For example, the sub-regions of the


region Canada can be its provinces; the sub region of the region
London can be its postal codes.

• Zone: A collection of regions, for example, a western zone. Zone


information is unique to your business.

• Regional transit times: In-transit times specified between ship-from


locations and locations, zones, and regions based on shipping
methods. You can specify cost and load to track specifics of each
shipping method.

When the Oracle Advanced Planning and Scheduling Suite plans


shipments, it assumes that the transit time from your facility to all locations
within the zone is the same.

For example:
• You ship from Tokyo, Japan to customers in Manila, Philippines
and Taipei, Taiwan.

• You place Manila and Taipei in zone A.

• You specify the regional transit time between your Tokyo facility
and zone A as two days.
• Oracle Applications plans shipments from Tokyo to Manila for two
days and shipments from Tokyo to Taipei for two days also.

The advantages of planning shipments in terms of regions and zones are:


• You enter and maintain in-transit and sourcing rules information
between zones rather than between every ship-from/ship-to
address combination.

• With less in-transit information, Oracle Shipping Execution finds the


information that you need faster.

• The in-transit information automatically applies to new customers.


• For shipping quotes, you can more easily match your inter-zone
shipment requirements to service provider shipping lanes.

Usage of Region interface Page 4


Usage of Region interface Page 5
Setting Up

If you ship to multiple locations that are near to each other and you want
to plan shipments by regions and zones:
• Determine the regions and sub-regions that support your the Oracle
Advanced Planning and Scheduling Suite shipment planning, create
them, and map address locations to them.

• Determine the zones that support your the Oracle Advanced


Planning and Scheduling Suite shipment planning, create them, and
assign regions to them.

• Specify the in-transit times between zones (regional transit time)


and preferred ship method between zones.

• Use two concurrent processes to map and load bulk geographical


information. Use the forms for individual data entry and data
correction.

Order Processing

When calculating available-to-promise, the Oracle Advanced Planning and


Scheduling Suite uses regional transit times.

When scheduling shipments using zones and regions, the Oracle


Advanced Planning and Scheduling Suite:
• Consults the sales order line ship-from location, ship-to country,
ship-to postal code, ship method, and customer request date.

• Determines the ship-from and ship-to zones.

• Determines the regional transit time between the zones. If you


specify a shipping method, it determines that transit time. If you do
not specify a shipping method in the sales order line, it determines
the transit time of the default shipping method.

• Calculates the scheduled ship date from the available to promise


date and the regional transit time.

If you have specified an in-transit time and shipping method for the
specific ship-to location, the Oracle Advanced Planning and Scheduling
Suite uses that information instead of the regional information.

Usage of Region interface Page 6


TECHNICAL DETAILS

The Regions related information would be stored in the following


Shipping related base tables

• WSH_REGIONS
• WSH_REGIONS_TL

The Table WSH_REGIONS will contain the different codes related


information like the City Code, country code etc along with other
information which describes the features of the Region.
The Language table WSH_REGIONS_TL will contain the language specific
information, which describes each of the displayed values like country
name, State name etc. This table should contain the details related to the
different source languages used in the system.

Apart from the above tables there are 2 more tables, which can be used to
interface the Regions information to the Regions Base Tables. They are

• WSH_REGIONS_INTERFACE
• WSH_REGIONS_TL_INTERFACE

Data Flow for the Region Interface would be as shown in the above
diagram.

Usage of Region interface Page 7


The Table structure of the Regions related Interface Table will be as
mentioned below.

WSH_REGIONS_INTERFACE

Column Name Data Type Mandatory


REGION_ID NUMBER Yes
REGION_TYPE NUMBER No
PARENT_REGION_ID NUMBER No
COUNTRY_CODE VARCHAR2 (10) No
COUNTRY_REGION_CODE VARCHAR2 (10) No
STATE_CODE VARCHAR2 (10) No
CITY_CODE VARCHAR2 (10) No
PORT_FLAG VARCHAR2 (1) No
AIRPORT_FLAG VARCHAR2 (1) No
ROAD_TERMINAL_FLAG VARCHAR2 (1) No
RAIL_TERMINAL_FLAG VARCHAR2 (1) No
LONGITUDE NUMBER No
LATITUDE NUMBER No
TIMEZONE VARCHAR2 (3) No
ZONE_LEVEL NUMBER No
CREATED_BY NUMBER Yes
CREATION_DATE DATE Yes
LAST_UPDATED_BY NUMBER Yes
LAST_UPDATE_DATE DATE Yes
LAST_UPDATE_LOGIN NUMBER No
PROCESSED_FLAG VARCHAR2 (1) No

WSH_REGIONS_TL_INTERFACE

Column Name Data Type Mandatory


LANGUAGE VARCHAR2 (4) Yes
SOURCE_LANG VARCHAR2 (4) No
REGION_ID NUMBER Yes
CONTINENT VARCHAR2 (60) No
COUNTRY VARCHAR2 (60) No
COUNTRY_REGION VARCHAR2 (60) No
STATE VARCHAR2 (60) No
CITY VARCHAR2 (60) No
ZONE VARCHAR2 (60) No

Usage of Region interface Page 8


POSTAL_CODE_FROM VARCHAR2 (30) No
POSTAL_CODE_TO VARCHAR2 (30) No
ALTERNATE_NAME VARCHAR2 (60) No
COUNTY VARCHAR2 (60) No
CREATED_BY NUMBER Yes
CREATION_DATE DATE Yes
LAST_UPDATED_BY NUMBER Yes
LAST_UPDATE_DATE DATE Yes
LAST_UPDATE_LOGIN NUMBER No

Usage of Region interface Page 9


REGION INTERFACE WITH EXAMPLES

Region Interface is a concurrent program, which can be used to import the


Regions into Oracle Shipping related base tables.

Region Interface Concurrent Process


Use this process to load bulk geographical information from the regions
interface table to Oracle Shipping Execution. This enables you to filter the
data that you are loading so that you can repeat the process without
loading all of the geographical information each time. The filters are
country, country code, province/state, city, city code, and postal code.

Submission
Navigate to the Regions Interface form and, after verifying the correctness
of the data, click Load All Regions. If the process does not start, have your
system administrator add it to the All Shipping Interfaces request group.

Parameters
None

The Log file of the Regions Interface concurrent program will give the
following messages on successful completion.

Started the region upload process...


Summary: Total regions processed = 1
Summary: Number of new regions = 1
Summary: Number of regions with errors (not interfaced) = 0
Ended the region upload process.

In this Paper we will try to look at the usage of the “Region Interface”
concurrent program. The Region Interface is used to import the Regions in
to the Regions Base Tables i.e. WSH_REGIONS and WSH_REGIONS_TL.

Required information should be populated to the Regions Interface tables


and running the “Regions Interface” program will interface the data to the
base tables. The information can be made available to the interface tables
in 2 ways

1. Directly upload the data to the Regions Interface tables from any
available external source of Data
2. Run the concurrent program “Location to Region Mapping” Which
will try to list out all the Locations that cannot be mapped to
regions and populate the interface tables

Usage of Region interface Page 10


We will try to emphasize on the first method and import the Regions into
the base Tables.

A) First Use of Region interface

The following examples will clearly demonstrate the structure of the


Regions in the Shipping Module.

We will consider 2 different examples


a) To update a new City region under the existing parent region.
b) To create a new City region starting from Scratch.

Example: 1

Consider and example where we want to import a region which is in


Irvine City
Irvine uses Zip Codes 92602-92604, 92606, 92614, 92618-92620, 92623,
92697, 92698, 92709 and 92610
Irvine is in the Sate of California, USA
So this calls for 4 different regions

Region 1 Country – US
Region 2 State - California with Region 1 as parent Record
Region 3 City – Irvine with Region 2 as parent Record.
Region 4 Zip Code - 92602-92604 with Region 3 as parent Record.

Usage of Region interface Page 11


Query the Regions Form with Country as US and State as CA.

Usage of Region interface Page 12


Analysis:

We already have the Region 2 defined in the system, which is the State of
California using the Region 1 (US as country which is also available) as the
parent Region.

Region Region Level Value Parent Status


type Region
Region-1 0 Country United States None Available
Region-2 1 State California Region-1 Available
Region-3 2 City Irvine Region-2 To be
created
Region-4 3 Postal 92602-92604 Region-3 To be
created

So we need to create Region 3 and Region 4 as mentioned above.

2 records needs to be inserted in the Interface Tables with appropriate


links.

Find out the Region id of Region – 2 i.e. California State in US. This information
will be available in WSH_REGIONS table

Region Type Meaning


0 stands for Country
1 Stands for State
2 Stands for City
3 stands for Postal code range.

Query to be used

SELECT region_id
FROM wsh_regions
WHERE country_code = 'US'
AND State_code ='CA'
AND region_type = 1

This region id will be the parent_region_id for Region 3. (Assume its value
is 408)

Inserting Data for Region-3

Usage of Region interface Page 13


Insert record –1 in to WSH_REGIONS_INTERFACE to create Region-3
mentioned above.
Here the region type would be 2 and the parent region id would be 408

INSERT INTO wsh_regions_interface(


region_id,
region_type,
parent_region_id,
country_code,
state_code,
city_code,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES (500001,
2,
408,
'US',
'CA',
'IRVN',
-1,
sysdate,
-1,
sysdate)

Insert record –1 in to WSH_REGIONS_TL_INTERFACE to create Region-3


mentioned above.
Here the region_id would be same as that of the record inserted in
WSH_REGIONS_INTERFACE.

INSERT INTO wsh_regions_tl_interface(


language,
source_lang,
region_id,
country,
state,
city,
postal_code_from,
postal_code_to,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES ('US',
'US',
500001,
'United States',
'California',
'Irvine',
'',
'',
-1,
sysdate,
-1,
sysdate)

Usage of Region interface Page 14


Inserting Data for Region-4

Insert record –2 in to WSH_REGIONS_INTERFACE to create Region-4


mentioned above.
Here the region type would be 3 and the parent region id would be
500001

INSERT INTO wsh_regions_interface(


region_id,
region_type,
parent_region_id,
country_code,
state_code,
city_code,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES (500002,
3,
500001,
'US',
'CA',
'IRVN',
-1,
sysdate,
-1,
sysdate)

Insert record –2 in to WSH_REGIONS_TL_INTERFACE to create Region-4


mentioned above.
Here the region_id would be same as that of the record inserted in
WSH_REGIONS_INTERFACE.

INSERT INTO wsh_regions_tl_interface(


language,
source_lang,
region_id,
country,
state,
city,
postal_code_from,
postal_code_to,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES('US',
'US',
500002,
'United States',
'California',
'Irvine',

Usage of Region interface Page 15


'92602',
'92604',
-1,
sysdate,
-1,
sysdate)

Go to the Regions Interface Screen and query for the records. The Screen
would display the records as shown in the below screenshot.

Now you can import the records in to the Regions Table by running
“Region Interface” concurrent program or by clicking the “Load All
Regions” button in the screen shown.

Submit “Region Interface” concurrent program. This can be done using the
following Navigation. ShippingÆ InterfacesÆRunÆ”Region Interface”

Go back to the Regions and Zones screen and Query for all those regions
with country as ‘US’ and State as ‘CA’

The 2 new regions created will be available in the query output.

Usage of Region interface Page 16


Similarly all the pin codes in Irvine can be registered as Regions in a single
run of the Program.

Usage of Region interface Page 17


Example: 2

We will consider the second example where Mumbai in India would be


added as a Region.
The postal Codes in Mumbai are in between 400001 and 400104
We will create to postal code regions in Mumbai one for the range of
400001 – 400004 and other for range of 400005 - 400010

We will query for the Country code as ‘IN’ in the Regions and Zones
Screen

Analysis:
As No record is available, we need to create the Region from the scratch
by creating the country, State and City.
Mumbai belongs to the State of Maharasthra in India
So Region-1 would be Country – India
Region –2 State Maharasthra
Region-3 City Mumbai
Region – 4 and 5 postal code ranges

Region Region Level Value Parent Status


type Region
Region-1 0 Country India None To be
created

Usage of Region interface Page 18


Region-2 1 State Maharasthra Region-1 To be
created
Region-3 2 City Mumbai Region-2 To be
created
Region-4 3 Postal 400001 – Region-3 To be
400004 created
Region-5 3 Postal 400005 – Region-3 To be
400010 created

Inserting Data for Region-1

Insert record –1 in to WSH_REGIONS_INTERFACE to create Region-1


mentioned above.

INSERT INTO wsh_regions_interface(


region_id,
region_type,
parent_region_id,
country_code,
state_code,
city_code,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES (500003,
0,
-1,
'IN',
NULL,
NULL,
-1,
sysdate,
-1,
sysdate)

Insert record –1 in to WSH_REGIONS_TL_INTERFACE to create Region-1


mentioned above.
Here the region_id would be same as that of the record inserted in
WSH_REGIONS_INTERFACE.

INSERT INTO wsh_regions_tl_interface(


language,
source_lang,
region_id,
country,
state,
city,
postal_code_from,
postal_code_to,

Usage of Region interface Page 19


created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES('US',
'US',
500003,
'India',
NULL,
NULL,
'',
'',
-1,
sysdate,
-1,
sysdate)

Inserting Data for Region-2

Insert record –2 in to WSH_REGIONS_INTERFACE to create Region-2


mentioned above.
Here the parent region id would be from Region-1

INSERT INTO wsh_regions_interface(


region_id,
region_type,
parent_region_id,
country_code,
state_code,
city_code,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES (500004,
1,
500003,
'IN',
'MH',
NULL,
-1,
sysdate,
-1,
sysdate)

Insert record –2 in to WSH_REGIONS_TL_INTERFACE to create Region-2


mentioned above.
Here the region_id would be same as that of the record inserted in
WSH_REGIONS_INTERFACE.

INSERT INTO wsh_regions_tl_interface(


language,
source_lang,

Usage of Region interface Page 20


region_id,
country,
state,
city,
postal_code_from,
postal_code_to,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES('US',
'US',
500004,
'India',
'Maharashtra',
NULL,
NULL,
NULL,
-1,
sysdate,
-1,
sysdate)

Inserting Data for Region-3

Insert record –3 in to WSH_REGIONS_INTERFACE to create Region-3


mentioned above.
Here the parent region id would be from Region-2

INSERT INTO wsh_regions_interface(


region_id,
region_type,
parent_region_id,
country_code,
state_code,
city_code,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES (500005,
2,
500004,
'IN',
'MH',
'MUM',
-1,
sysdate,
-1,
sysdate)

Insert record –3 in to WSH_REGIONS_TL_INTERFACE to create Region-3


mentioned above.

Usage of Region interface Page 21


Here the region_id would be same as that of the record inserted in
WSH_REGIONS_INTERFACE.

INSERT INTO wsh_regions_tl_interface(


language,
source_lang,
region_id,
country,
state,
city,
postal_code_from,
postal_code_to,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES('US',
'US',
500005,
'India',
'Maharashtra',
'Mumbai',
NULL,
NULL,
-1,
sysdate,
-1,
sysdate)

Inserting Data for Region-4

Insert record –4 in to WSH_REGIONS_INTERFACE to create Region-3


mentioned above.
Here the parent region id would be from Region-3

INSERT INTO wsh_regions_interface(


region_id,
region_type,
parent_region_id,
country_code,
state_code,
city_code,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES (500006,
3,
500005,
'IN',
'MH',
'MUM',
-1,
sysdate,
-1,

Usage of Region interface Page 22


sysdate)

Insert record –4 in to WSH_REGIONS_TL_INTERFACE to create Region-4


mentioned above.
Here the region_id would be same as that of the record inserted in
WSH_REGIONS_INTERFACE.

INSERT INTO wsh_regions_tl_interface(


language,
source_lang,
region_id,
country,
state,
city,
postal_code_from,
postal_code_to,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES('US',
'US',
500006,
'India',
'Maharashtra',
'Mumbai',
'400001',
'400004',
-1,
sysdate,
-1,
sysdate)

Inserting Data for Region-5

Insert record –5 in to WSH_REGIONS_INTERFACE to create Region-5


mentioned above.
Here the parent region id would be from Region-3

INSERT INTO wsh_regions_interface(


region_id,
region_type,
parent_region_id,
country_code,
state_code,
city_code,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES (500007,
3,
500005,

Usage of Region interface Page 23


'IN',
'MH',
'MUM',
-1,
sysdate,
-1,
sysdate)

Insert record –5 in to WSH_REGIONS_TL_INTERFACE to create Region-4


mentioned above.
Here the region_id would be same as that of the record inserted in
WSH_REGIONS_INTERFACE.

INSERT INTO wsh_regions_tl_interface(


language,
source_lang,
region_id,
country,
state,
city,
postal_code_from,
postal_code_to,
created_by,
creation_date,
last_updated_by,
last_update_date)
VALUES('US',
'US',
500007,
'India',
'Maharashtra',
'Mumbai',
'400005',
'400010',
-1,
sysdate,
-1,
sysdate)

Query for the data in regions interface:

Usage of Region interface Page 24


Click on the “Load All Regions” Button in the “Regions Interface” screen.
Confirm the submission of these records to the Region Interface by
responding to the message box.

This will import the records from the Interface table to the Region Base tables.
The imported records can be verified by checking the Regions and Zones Screen
with the query criteria that matches the records that are interfaced. The
screenshot of the imported regions is attached below.

Usage of Region interface Page 25


We have an option to check the Sub-Regions under a given region in the
Regions and zones Form. Clicking on the Sub Regions Button will display
all the child regions having the current region as the Parent Region. This is
applicable for the Regions with all Region Types and only the immediate
child records will be displayed.

Usage of Region interface Page 26


Usage of Region interface Page 27
B) Second use of Region Interface

You can also use the “Location to Region Mapping” concurrent program
and provide the number of locations to be mapped along with the ‘Insert’
option as ‘Y’

The log file will show a similar message after inserting the data in the
interface tables.

Location to Region Mapping


Processing locations. Following locations could not be mapped to existing
regions.
These have been inserted in the regions interface tables
Total number of interfaced regions 5
---------------------------------------------------------------
Country State City Postal Code
------- ----- ---- ------ ----
Afghanistan Peshewar Kabul 467787
Italy WA Seattle 45023
Italy Rome 45000
Italy Venice 45201
United States Not set. Not set. Not set.

This will insert records in to the Regions Interface tables. Those records,
which are already available and are not required, should be deleted from
this screen after validations.
Any modifications if required should be done from this screen.

Usage of Region interface Page 28


The Regions can be interfaced to the Regions table by using the “Region
Interface” concurrent program or the “Load All Regions” option as already
explained above.

CAUTION:

The First time usage of "Regions Interface" will take much time
(irrespective of the number of records in the interface table). Users need
not have to worry about the time taken for the first run. From subsequent
runs of the interface the time taken will be optimum.

SUMMARY

Region Interface turns out to be a powerful tool for the usage of Transportation
and Advanced Planning and Scheduling Suite. With the Region Interface we will
be in a position to import Regions in to the system. The different customer
location can be mapped to these Regions, which can be used in determining the
transporting time to these regions. The "Location to Region Mapping" should
provide a provision to map specific customer address so that required Regions
can be imported and mapped selectively. This is a required feature for selective
creation of Regions.

Usage of Region interface Page 29


White Paper Title : Usage of Region Interface
June, 2005
Author: Chandan Samuel
Contributing Authors: None

Oracle Corporation
World Headquarters
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.

Worldwide Inquiries:
Phone: +1.650.506.7000
Fax: +1.650.506.7200
www.oracle.com

Oracle is a registered trademark of Oracle Corporation. Various


product and service names referenced herein may be trademarks
of Oracle Corporation. All other product and service names
mentioned may be trademarks of their respective owners.

Copyright © 2001 Oracle Corporation


All rights reserved.

You might also like