Oracle Process Manufacturing
Oracle Process Manufacturing
Oracle Process Manufacturing
Release 11i
October 2000
Part No. A82921-02
Richard D. Persen
Contributing Authors:
The Programs (which include both the software and documentation) contain proprietary information of
Oracle Corporation; they are provided under a license agreement containing restrictions on use and
disclosure and are also protected by copyright, patent, and other intellectual and industrial property
laws. Reverse engineering, disassembly, or decompilation of the Programs is prohibited.
Program Documentation is licensed for use solely to support the deployment of the Programs and not
for any other purpose.
The information contained in this document is subject to change without notice. If you find any problems
in the documentation, please report them to us in writing. Oracle Corporation does not warrant that this
document is error free. Except as may be expressly permitted in your license agreement for these
Programs, no part of these Programs may be reproduced or transmitted in any form or by any means,
electronic or mechanical, for any purpose, without the express written permission of Oracle Corporation.
If the Programs are delivered to the U.S. Government or anyone licensing or using the programs on
behalf of the U.S. Government, the following notice is applicable:
Restricted Rights Notice Programs delivered subject to the DOD FAR Supplement are "commercial
computer software" and use, duplication, and disclosure of the Programs, including documentation,
shall be subject to the licensing restrictions set forth in the applicable Oracle license agreement.
Otherwise, Programs delivered subject to the Federal Acquisition Regulations are "restricted computer
software" and use, duplication, and disclosure of the Programs shall be subject to the restrictions in FAR
52.227-19, Commercial Computer Software - Restricted Rights (June, 1987). Oracle Corporation, 500
Oracle Parkway, Redwood City, CA 94065.
The Programs are not intended for use in any nuclear, aviation, mass transit, medical, or other inherently
dangerous applications. It shall be the licensee's responsibility to take all appropriate fail-safe, backup,
redundancy, and other measures to ensure the safe use of such applications if the Programs are used for
such purposes, and Oracle Corporation disclaims liability for any damages caused by such use of the
Programs.
Oracle is a registered trademark, and Oracle Process Manufacturing is a trademark of Oracle
Corporation. All other company or product names mentioned are used for identification purposes only
and may be trademarks of their respective owners.
Contents
Send Us Your Comments .................................................................................................................. vii
Preface............................................................................................................................................................ ix
1
1-2
1-3
1-4
1-4
1-5
1-6
1-8
1-10
1-10
1-11
1-11
1-12
1-14
1-16
1-16
1-17
1-18
iii
4-2
4-2
4-3
4-6
4-7
4-7
4-9
4-10
iv
3-2
3-3
3-3
3-7
3-7
3-8
3-9
2-2
2-2
2-3
2-14
2-16
2-17
2-22
5-2
5-2
5-2
5-2
5-3
Item Lot/Sublot Conversion API Wrapper - Package and Procedure Names ......................... 5-4
Item Lot/Sublot Conversion API Wrapper - Error Messages ..................................................... 5-4
Item Lot/Sublot Conversion API Wrapper - Code Example....................................................... 5-5
7-2
7-2
7-2
7-4
7-4
7-5
7-6
6-2
6-2
6-3
6-7
6-8
6-8
6-17
6-19
8-2
8-2
8-2
8-9
8-10
8-10
8-12
Index
vi
9-2
9-3
9-4
9-5
9-6
Oracle Corporation welcomes your comments and suggestions on the quality and usefulness of this
publication. Your input is an important part of the information used for revision.
If you find any errors or have any other suggestions for improvement, please indicate the chapter,
section, and page number (if available). You can send comments to us in the following ways:
Electronic mail message to appsdoc@us.oracle.com
If you would like a reply, please give your name, address, and telephone number below.
If you have problems with the software, please contact your local Oracle Support Services.
vii
viii
Preface
Welcome to the Oracle Process Manufacturing Inventory APIs Users Guide. This
users guide includes the information you need to work with the Oracle Process
Manufacturing (OPM) application effectively.
This preface explains how this users guide is organized and introduces other
sources of information that can help you.
Intended Audience
This guide assumes that you have working knowledge of your business areas
processes and tools. It also assumes that you are familiar with OPM Inventory APIs.
If you have never used OPM Inventory APIs, we suggest you attend one or more of
the Oracle Process Manufacturing training classes available through Oracle World
Wide Education.
This guide also assumes that you are familiar with the Oracle Applications
graphical user interface. To learn more about Oracle Applications graphical user
interface, read the Oracle Applications Users Guide.
ix
Description
OPM
Inventory
APIs Introduction
Item Create
API
Provides the business function and technical details for the Item
Create API
Item Create
API Wrapper
Provides the business function and technical details for the Item
Create API wrapper
Item
Lot/Sublot
Conversion
API
Provides the business function and technical details for the Item
Lot/Sublot conversion API
Item
Lot/Sublot
Conversion
API Wrapper
Provides the business function and technical details for the Item
Lot/Sublot conversion API wrapper
Inventory
Quantities
API
Inventory
Quantities
API Wrapper
Lot Create
API
Provides the business function and technical details for the Lot
Create API
Lot Create
API Wrapper
Provides the business function and technical details for the Lot
Create API wrapper
Information Sources
You can choose from many sources of information, including documentation,
training, and support services to increase your knowledge and understanding.
Online Documentation
Oracle Applications documentation is available on CD-ROM, except for technical
reference manuals. Users guides are available in HTML format and on paper.
Technical reference manuals are available on paper only. Other documentation is
available on paper and sometimes in PDF format.
The content of the documentation remains the same from format to format. Slight
formatting differences could occur due to publication standards, but such
differences do not affect content. For example, page numbers are included on paper,
but are not included in HTML.
The HTML documentation is available from all Oracle Applications windows. Each
window is programmed to start your web browser and open a specific,
context-sensitive section. Once any section of the HTML documentation is open,
you can navigate freely throughout all Oracle Applications documentation.
Related Documents
Oracle Process Manufacturing shares business and setup information with other
Oracle products. You may find the following Oracle Applications users guides
useful:
xi
Inventory Control
Logistics
Process Execution
Process Planning
Product Development
Regulatory
xii
Training
Oracle offers a complete set of formal training courses to help you master Oracle
Process Manufacturing and reach full productivity quickly. We organize these
courses into functional learning paths, so you take only those courses appropriate to
your area of responsibility.
You have a choice of educational environments. You can attend courses offered by
Oracle Education Services at any one of our many Education Centers, or you can
arrange for our trainers to teach at your facility. In addition, Oracle Training
professionals can tailor standard courses or develop custom courses to meet your
needs. For example, you may want to use your organizations structure,
terminology, and data as examples in a customized training session delivered at
your own facility.
Conventions
The following conventions are used in this guide:
Bolded Text
Buttons, fields, keys, menus, and selections are bolded in procedures only. For
example: To access the next window, click OK. Otherwise, references to these
features appear in regular type.
Additional Menu Options
Only nonstandard menu options are discussed. Standard menu bar options (such as
Save) are not discussed. These standard options are described in the Oracle
Applications Users Guide. Only menu options unique to the use of the specific
window are discussed.
Field References
References to fields within procedures are in bold type. References within the body
of this guide appear in regular type.
Required Fields
The word Required appears as the last word in the field description of all required
fields. When the field is required contingent on the entry in another field, or only in
specific situations, "Required if..." is the last sentence of the field description.
Fields Reserved for Future Use
Fields with no current processing implications are referenced by the statement "This
field is not currently used" or "Reserved for future use." Do not use these fields for
xiii
your own reference data, because there are plans to link future functionality to
these fields. Fields intended for informational purposes only are referenced by the
statement "This field is for informational purposes only."
Pending/Completed Transactions
Discussions about processing transactions that use the words pending and
completed refer to the status of a transaction. Pending and completed do not refer
to the database tables that are updated as a result of transactions (for example, some
completed transactions are stored in the Pending Transactions table).
Procedures
Most topics contain a procedure with numbered steps. Any actions which are
subordinate to a step are assigned letters. You can customize your Oracle
Application, therefore, all procedures are suggestive only. Navigate to windows
and between responsibilities in a way that works best for your particular setup.
Also note that fields may appear in a different order than they are discussed.
Use of the Word Character
The word character means an alphanumeric character. Characters that are numeric
or alphabetic only are referenced specifically. Depending on your system security
profile, you many not have access to all of the windows and functions described in
this guide. If you do not see a menu option described in this guide, and you want
access to it, contact your System Administrator.
xiv
Consequently, we strongly recommend that you never use SQL*Plus or any other
tool to modify Oracle Applications data unless otherwise instructed by Oracle
Support Services.
About Oracle
Oracle Corporation develops and markets an integrated line of software products
for database management, applications development, decision support, and office
automation, as well as Oracle Applications, an integrated suite of more than 45
software modules for financial management, supply chain management,
manufacturing, project systems, human resources, sales, and service management.
Oracle Products are available for mainframes, minicomputers, personal computers,
network computers, and personal digital assistants, allowing organizations to
integrate different computers, different operating systems, different networks, and
even different database management systems, into a single, unified computing, and
information resource.
Oracle is the worlds leading supplier of software for information management, and
the worlds second largest software company. Oracle offers its database, tools, and
applications products, along with related consulting, education, and support
services in over 140 countries around the world.
Thank You
Thank you for choosing Oracle Process Manufacturing and this users guide.
We value your comments and feedback. At the beginning of this guide is a Readers
Comment Form that you can use to explain what you like or dislike about this
users guide. Mail your comments to the following address or call us directly at
650-506-7000.
Oracle Applications Documentation Manager
Oracle Corporation
500 Oracle Parkway
Redwood Shores, CA 94065
U.S.A.
Or, send an electronic mail message to appsdoc@us.oracle.com
xv
xvi
1
OPM Inventory APIs - Introduction
This topic provides a basic understanding of Oracle Process Manufacturing (OPM)
Inventory APIs. It presents the technical requirements for stored procedures. You
will gain an understanding of the technical structure and architecture of the
Inventory APIs. Also included in this topic is a technical overview of Inventory
APIs as well as how to handle error messages and result messages. Installation and
upgrade recommendations are provided with engineering notes on this release.
The following topics are covered:
1-2
These packages are created and owned by the applications user as part of a
standard Oracle Applications installation. They are not supplied within the OPM
Inventory APIs installation.
You should become familiar with the functionality of the procedures and functions
contained in the FND packages. The calling program utilizes these procedures on
return from the API in order to decode and handle messages.
API Architecture
1-4
API Architecture
APIs use a layered architecture. From top to bottom these layers are:
Public layer
Private layer - within which there are validation and database access layers
P (for public)
V (for private)
G (for group)
The next three letters define the package use, and result in the following package
names:
GMIPAPI - for the top level public API routines. These routines take in raw
data in the form of PL/SQL records and make all the required database calls to
find surrogate keys and so forth.
GMIGAPI - for the group level API routines. These are called by the routines in
the GMIPAPI package and they are also callable by third party code if the
required data is available.
GMIGUTL - for utility routines called by all layers of the API code. They are
also callable from third party and wrapper programs.
These three packages are the only ones that should be called from application code.
In addition the following packages exist to support them:
1-6
GMIVITM - for all internal processing (for example, validation) to support item
creation
Several packages are available for the more complex database processing involving
inventory transactions for the ic_summ_inv, ic_loct_inv, ic_tran_pnd and ic_tran_
cmp tables as follows:
GMIPTXN - Public transaction engine API routines. These are the only routines
in the transaction processor that should be called publicly.
The API release also includes some wrappers that can be used to process flat data
files. They are included more as an example of how the public APIs are called rather
than a supported product, since they have to be modified to suit a particular
installation.
The wrappers are:
1-8
The Item Master table IC_ITEM_MST holds all attributes of the item.
Lot controlled and quality control attributes are prompted for in the maintenance
form once the appropriate indicators are set. These details are also held against the
item.
Whether an item is defined as lot controlled or not lot controlled, the system always
generates a DEFAULT lot against the item on IC_LOTS_MST.
All lots hold additional attributes for Consumer Packaged Goods (CPG) specific
processing. These are held against IC_LOTS_CPG.
When an item is identified as dual UOM and the alternate UOM is of a different
type (for example, item is defined in type WEIGHT with dual UOM in VOLUME)
the save of the item master prompts for the conversion factor between WEIGHT
and VOLUME for the item. This mechanism and structure supports transactional
processing of the item in any supported UOM. This is handled outside of the Item
Create procedure through an additional function (Insert_Ic_Item_Cnv).
Wrapper Function
The wrapper function is responsible for collating the details required as input
parameters to the stored procedure, forwarding these in the call and monitoring the
return code.
The stored procedure returns three possible messages:
Successful
Error (Unsuccessful)
Unexpected error
Based on the return, the wrapper function may interrogate the Oracle Messages File
for the stored procedure to determine a COMMIT of the transaction or not.
1-10
Flat File
Input data to the user wrapper function may come from a flat file source. The flat
file is read record by record. For each record the wrapper builds the necessary
parameters and call the Item Create API. The wrapper assumes no
inter-dependency between the records and therefore instructs the API to commit
each successfully processed record.
Temporary Table
Input data to the user wrapper function may come from a temporary database
table. The table is read row by row. For each row the wrapper builds the necessary
parameters and calls the Item Create API. The wrapper assumes no
interdependency between the rows and therefore instructs the API to commit each
successfully processed row.
Security Considerations
Grant permissions can be controlled at the stored procedure levelabove the
individual database tables. This allows a global level of authorization against the
procedure rather than a table by table grant discipline within an application which
could hold anomalies. If you have grant authority to the procedure then it should
be assumed you have permissions at the database, and permissions at the
application levels.
Platform Independence
Stored procedure, unlike C coded functions, are platform independent with no
need to recompile according to hardware and operating platform.
1-12
The Item Master table IC_ITEM_MST holds all attributes of the item.
Lot controlled and QC attributes are prompted for in the maintenance form once
the appropriate indicators are set. These details are also held against the item.
Whether an item is defined as lot controlled or not the system always generates a
DEFAULT lot against the item on IC_LOTS_MST.
All lots hold additional attributes for Consumer Packaged Goods (CPG)-specific
processing. These are held against IC_LOTS_CPG.
Type
IN/OUT
Required
Validation
p_api_version
number
IN
p_init_msg_list
varchar2
IN
p_commit
varchar2
IN
p_validation_level
varchar2
IN
x_return_status
varchar2
OUT
1-14
x_msg_count
number
OUT
x_msg_data
varchar2
OUT
Examination of both the x_return_status and x_msg_count indicates the pass or fail
status of the call.
S - Successful
E - Expected error
U - Unexpected error
Error Messages for the individual APIs and wrappers are listed at the end of their
respective topics.
Delete - Deletes one or more messages from the API message list.
1-16
To add a message to the API message list, developers should use the regular
message dictionary procedures FND_MESSAGE.SET_NAME and FND_
MESSAGE.SET_TOKEN to set the message name and tokens on the message
dictionary stack. They should then call FND_MSG_PUB.Add to get the messages off
the message dictionary stack and add it to the API message list.
To get a message from the API message list, API callers should use the procedure
FND_MSG_PUB.Get. This procedure operates in five different modes:
1-18
In item creation, the message One or more classes is/are invalid is self
explanatory. It arises from the method used to validate all the classes in a single
database hit, with a consequent positive effect on performance, rather than
individually.
This arises because all of these conditions are checked in a single database
retrieval, and it is therefore impossible to know which particular condition has
not been met.
GMIGUTL.Get Reason - reads in the reason code for the key specified
1-20
All of the externally callable API routines make calls to routines in the private layer,
either directly or indirectly. If the call succeeds, other routines in the database layer
are called to create or retrieve the rows. The routines in the private layer are not
intended to be called by anything other than the routines in the group layer and are
not supported outside this context.
1-22
2
Item Create API
This topic provides an explanation of the business function and technical overview
of the Item Create API. The topic presents parameters used and includes table and
view usage, package and procedure names, and special logic used in the Item
Create API. Common error messages are listed.
The following topics are covered:
2-1
This topic describes how the stored procedure should be called, mandatory or
optional parameter requirements and the values that are returned to the calling
program. This includes all error conditions that may arise.
The procedure is intended as a create function only, used primarily to load item
data from legacy systems on implementation. The API does not allow Item Update
or Unit of Measure Conversion maintenance. These are handled through additional
stored procedures such as discussed in the Item Lot/Sublot Conversion API Special Logic topic.
2-2
IN
IN
IN
IN
IN
OUT
OUT
OUT
OUT
OUT
NUMBER
VARCHAR2 := FND_API.G_FALSE
VARCHAR2 := FND_API.G_FALSE
NUMBER := FND_API.G_VALID_LEVEL_FULL
GMIGAPI.item_rec_typ
ic_item_mst%ROWTYPE
ic_item_cpg%ROWTYPE
VARCHAR2
NUMBER
VARCHAR2
The first 4, and last 3 parameters are standard across all of the API calls.
Parameter
Validation
p_api_version
Used internally to check that the call is compatible with user code.
The latest patch documentation should be consulted for any
possible changes.
p_init_msg_list
p_commit
Determines whether the API should commit the new item after
creation (assuming the creation succeeded). Normally this
parameter is omitted and defaulted as above
p_validation_level
p_item_rec
2-3
2-4
The p_item_rec parameter is used to pass the item-specific data required to create
an inventory item as described in the following. Please refer to the Item Create API
Wrapper topic for an example of how to populate this parameter and call the stored
procedure.
Field/Column
Type
Length
Default
Reqd
Validation
item_no
varchar2
32
Duplicates not
allowed on ic_
item_mst
item_desc1
varchar2
70
item_desc2
varchar2
70
alt_itema
varchar2
32
alt_itemb
varchar2
32
item_um
varchar2
Must exist on
sy_uoms_mst
dualum_ind
number
0 = Single UOM
control
Non-blank
1 = Fixed
relationship
dual UOM
control
2 = Variable
relationship
dual UOM with
default
conversion
3 = Variable
relationship
dual UOM
control
item_um2
varchar2
Mandatory if
dual UOM > 0.
If non-blank
then must exist
on sy_uoms_
mst
2-5
Field/Column
deviation_lo
Type
Length
number
Default
0
Reqd
N
Validation
Must not be
negative value.
Must be 0 if
dualum_ind = 0
or 1
deviation_hi
number
Must not be
negative value.
Must be 0 if
dualum_ind = 0
or 1
level_code
number
lot_ctl
number
Not currently
used
0 = Not lot
controlled
1 = Lot
controlled
lot_indivisible
number
sublot_ctl
number
2-6
Field/Column
loct_ctl
Type
number
Length
5
Default
0
Reqd
N
Validation
0 = Not location
controlled
1 = Location
controlled with
validation of
location
2 = Location
controlled with
no validation of
location
noninv_ind
number
0 = Not a non
inventory item
- inventory
balances
maintained
1 = Non
inventory item,
inventory
balances not
maintained
Must be 0 if lot_
ctl = 0
match_type
number
Type of invoice
matching done
Blank is no
matching
1 = Invoice only
2 = Two way
matching
3 = Three way
matching
inactive_ind
number
0 = Active
1 = Inactive
inv_type
varchar2
Must exist on
ic_invn_typ if
non-blank
2-7
Field/Column
shelf_life
Type
Length
number
Default
0
Reqd
N
Validation
Must not be
negative.
Must be 0 if
grade_ctl = 0
retest_interval
number
Must not be
negative.
Must be 0 if
grade_ctl = 0
2-8
item_abccode
varchar2
gl_class
varchar2
Must exist on
ic_gled_cls if
supplied
inv_class
varchar2
Must exist on
ic_invn_cls if
supplied
sales_class
varchar2
Must exist on
ic_sale_cls if
supplied
ship_class
varchar2
Must exist on
ic_ship_cls if
supplied
frt_class
varchar2
Must exist on
ic_frgt_cls if
supplied
price_class
varchar2
Must exist on
ic_prce_cls if
supplied
storage_class
varchar2
Must exist on
ic_stor_cls if
supplied
purch_class
varchar2
Must exist on
ic_prch_cls if
supplied
tax_class
varchar2
Must exist on
ic_taxn_cls if
supplied
Field/Column
Type
Length
Default
Reqd
Validation
customs_class
varchar2
Must exist on
ic_ctms_cls if
supplied
alloc_class
varchar2
Must exist on
ic_allc_cls if
supplied
planning_class
varchar2
Must exist on
ps_plng_cls if
supplied
itemcost_class
varchar2
Must exist on
ic_cost_cls if
supplied
cost_mthd_code
varchar2
Must exist on
cm_mthd_mst
if supplied
upc_code
varchar2
16
Not currently
used
grade_ctl
number
0 = Not grade
controlled
1 = Grade
controlled
Must be 0 if lot_
ctl = 0
status_ctl
number
0 = Not status
controlled
1 = Status
controlled
Must be 0 if lot_
ctl = 0
qc_grade
varchar2
Must exist on
qc_grad_mst if
non-blank.
Must be
non-blank if
grade_ctl = 1
2-9
Field/Column
lot_status
Type
varchar2
Length
Default
Reqd
N
Validation
Must exist on
ic_lots_sts if
non-blank.
Must be
non-blank if
status_ctl = 1
bulk_id
number
10
Not currently
used
pkg_id
number
10
Not currently
used
qcitem_no
varchar2
32
Must exist on
ic_item_mst if
non-blank
qchold_res_code
varchar2
Must exist on
qc_hrec_mst if
non-blank
expaction_code
varchar2
Must exist on
qc_actn_mst if
non-blank
fill_qty
number
Not currently
used
fill_um
varchar2
Not currently
used
expaction_interval
number
Must not be
negative value
phantom_type
number
whse_item_no
varchar2
32
experimental_ind
number
0
4
Must exist on
ic_item_mst if
non-blank
0 = Non
experimental
item
1=
Experimental
item
exported_date
2-10
date
01-Jan-1970 N
+ 1 day
Field/Column
Type
Length
Default
Reqd
Validation
seq_dpnd_class
varchar2
Must exist on
cr_sqdt_cls if
non-blank
commodity_code
varchar2
Must exist on
ic_comd_cds if
non-blank.
Must be
non-blank if
GMI:Intrastat=
1
ic_matr_days
number
Must not be
negative value
ic_hold_days
number
Must not be
negative value
attribute1
varchar2
240
Descriptive
flexfield
segment
attribute2
varchar2
240
Descriptive
flexfield
segment
attribute3
varchar2
240
Descriptive
flexfield
segment
attribute4
varchar2
240
Descriptive
flexfield
segment
attribute5
varchar2
240
Descriptive
flexfield
segment
attribute6
varchar2
240
Descriptive
flexfield
segment
attribute7
varchar2
240
Descriptive
flexfield
segment
attribute8
varchar2
240
Descriptive
flexfield
segment
2-11
Field/Column
2-12
Type
Length
Default
Reqd
Validation
attribute9
varchar2
240
Descriptive
flexfield
segment
attribute10
varchar2
240
Descriptive
flexfield
segment
attribute11
varchar2
240
Descriptive
flexfield
segment
attribute12
varchar2
240
Descriptive
flexfield
segment
attribute13
varchar2
240
Descriptive
flexfield
segment
attribute14
varchar2
240
Descriptive
flexfield
segment
attribute15
varchar2
240
Descriptive
flexfield
segment
attribute16
varchar2
240
Descriptive
flexfield
segment
attribute17
varchar2
240
Descriptive
flexfield
segment
attribute18
varchar2
240
Descriptive
flexfield
segment
attribute19
varchar2
240
Descriptive
flexfield
segment
attribute20
varchar2
240
Descriptive
flexfield
segment
Field/Column
Type
Length
Default
Reqd
Validation
attribute21
varchar2
240
Descriptive
flexfield
segment
attribute22
varchar2
240
Descriptive
flexfield
segment
attribute23
varchar2
240
Descriptive
flexfield
segment
attribute24
varchar2
240
Descriptive
flexfield
segment
attribute25
varchar2
240
Descriptive
flexfield
segment
attribute26
varchar2
240
Descriptive
flexfield
segment
attribute27
varchar2
240
Descriptive
flexfield
segment
attribute28
varchar2
240
Descriptive
flexfield
segment
attribute29
varchar2
240
Descriptive
flexfield
segment
attribute30
varchar2
240
Descriptive
flexfield
segment
attribute_category
varchar2
30
Descriptive
flexfield
structure
defining
column
user_name
varchar2
100
Ignored, but
retained for
backward
compatibility.
OPM
2-13
sy_uoms_mst
sy_type_mst
ic_invn_mst
ic_rank_mst
ic_gled_cls
ic_invn_cls
ic_sale_cls
ic_ship_cls
ic_frgt_cls
ic_prce_cls
ic_stor_cls
ic_prch_cls
ic_taxn_cls
ic_ctms_cls
ic_allc_cls
ps_plng_cls
qc_grad_mst
qc_hres_mst
qc_actn_mst
Insert
Update
ic_item_cpg
ic_lots_mst
ic_lots_sts
2-14
Select
Delete
Base Table
The Item Master table IC_ITEM_MST holds all attributes of the item.
Lot controlled and quality control attributes are prompted for in the maintenance
form once the appropriate indicators are set. These details are also held against the
item.
Whether an item is defined as lot controlled or not the system always generates a
DEFAULT lot against the item on IC_LOTS_MST.
All lots hold additional attributes for Consumer Packaged Goods (CPG)-specific
processing. These are held against IC_LOTS_CPG.
When an item is identified as dual UOM and the alternate UOM is of a different
type (for example, an item is defined in type WEIGHT with dual UOM in
VOLUME) the save of the item master prompts for the conversion factor between
WEIGHT and VOLUME for the item. This mechanism and structure supports
transactional processing of the item in any supported UOM. This is handled outside
of the Item Create procedure through an additional function.
2-15
GMIPAPI
The stored procedure which is called to create a new inventory item is:
Create_Item
Please refer to the Item Create API Wrapper for an example of how the above
procedure is executed.
2-16
Validation
No validation is applied to descriptive flexfield segments or to the user name.
Update Logic
When all the validation checks have been performed and no errors are found, a new
item is created within the database. The following steps are followed:
1.
2.
Column Name
Value
item_id
qcitem_id
whse_item_id
created_by
creation_date
System date
last_updated_by
last_update_date
System date
last_update_login
Login id
trans_cnt
delete_mark
0 (not deleted)
text_code
2-17
3.
Column Name
item_id
created_by
creation_date
System date
last_updated_by
last_update_date
System date
last_update_login
Login id
4.
The default lot is now created in the lot master table (ic_lots_mst). This is
achieved by calling the Create Lot API function (GMI_LOTS_PUB.Create_
Lot). The standard API calling parameters and PL/SQL record are defined.
As the committing of a new item is controlled by the Item Create API, the
p_commit parameter is set to false for the purpose of calling the LotCreate
API.
2-18
Value
Type
Length
Value
item_no
varchar2
32
p_item_rec.item_no
lot_no
varchar2
32
GMI:Default Lot
sublot_no
varchar2
32
lot_desc
varchar2
40
qc_grade
varchar2
Field/Column
Type
Length
Value
expaction_code
varchar2
expaction_date
date
01-Jan-1970 00:00:00
lot_created
date
01-Jan-1970 00:00:00
expire_date
date
31-Dec-2010 00:00:00
retest_date
date
system date/time
strength
number
100
inactive_ind
number
origination_type
number
shipvendor_no
varchar2
32
vendor_lot_no
varchar2
32
ic_matr_date
date
p_item_rec.ic_matr_days
ic_hold_date
date
p_item_rec.ic_hold_days
attribute1
varchar2
240
Descriptive flexfield
segment
attribute2
varchar2
240
Descriptive flexfield
segment
attribute3
varchar2
240
Descriptive flexfield
segment
attribute4
varchar2
240
Descriptive flexfield
segment
attribute5
varchar2
240
Descriptive flexfield
segment
attribute6
varchar2
240
Descriptive flexfield
segment
attribute7
varchar2
240
Descriptive flexfield
segment
attribute8
varchar2
240
Descriptive flexfield
segment
attribute9
varchar2
240
Descriptive flexfield
segment
2-19
Field/Column
2-20
Type
Length
Value
attribute10
varchar2
240
Descriptive flexfield
segment
attribute11
varchar2
240
Descriptive flexfield
segment
attribute12
varchar2
240
Descriptive flexfield
segment
attribute13
varchar2
240
Descriptive flexfield
segment
attribute14
varchar2
240
Descriptive flexfield
segment
attribute15
varchar2
240
Descriptive flexfield
segment
attribute16
varchar2
240
Descriptive flexfield
segment
attribute17
varchar2
240
Descriptive flexfield
segment
attribute18
varchar2
240
Descriptive flexfield
segment
attribute19
varchar2
240
Descriptive flexfield
segment
attribute20
varchar2
240
Descriptive flexfield
segment
attribute21
varchar2
240
Descriptive flexfield
segment
attribute22
varchar2
240
Descriptive flexfield
segment
attribute23
varchar2
240
Descriptive flexfield
segment
attribute24
varchar2
240
Descriptive flexfield
segment
attribute25
varchar2
240
Descriptive flexfield
segment
attribute26
varchar2
240
Descriptive flexfield
segment
Field/Column
Type
Length
Value
attribute27
varchar2
240
Descriptive flexfield
segment
attribute28
varchar2
240
Descriptive flexfield
segment
attribute29
varchar2
240
Descriptive flexfield
segment
attribute30
varchar2
240
Descriptive flexfield
segment
attribute_category
varchar2
30
Descriptive flexfield
structure defining column
user_name
varchar2
100
Details of validation and update are contained in the topic on Lot Create API. If the
lot create function is unsuccessful, the whole transaction is rolled back.
2-21
2-22
Narrative
IC_API_ITEM_ALREADY_EXISTS
IC_API_INVALID_UOM
IC_API_INVALID_DUALUM_IND
Dual unit of measure indicator not in range 0 3 for item number &ITEM
IC_API_INVALID_DEVIATION
IC_API_INVALID_LOT_CTL
IC_API_INVALID_LOT_INDIVISIBLE
IC_API_INVALID_SUBLOT_CTL
IC_API_INVALID_LOCT_CTL
IC_API_INVALID_NONINV_IND
IC_API_INVALID_MATCH_TYPE
IC_API_INVALID_INV_TYPE
IC_API_INVALID_INACTIVE_IND
IC_API_INVALID_SHELF_LIFE
IC_API_INVALID_RETEST_INTERVAL
IC_API_INVALID_ABCCODE
IC_API_INVALID_GL_CLASS
IC_API_INVALID_INV_CLASS
IC_API_INVALID_SALES_CLASS
IC_API_INVALID_SHIP_CLASS
Message Code
Narrative
IC_API_INVALID_FRT_CLASS
IC_API_INVALID_PRICE_CLASS
IC_API_INVALID_STORAGE_CLASS
IC_API_INVALID_PURCH_CLASS
IC_API_INVALID_TAX_CLASS
IC_API_INVALID_CUSTOMS_CLASS
IC_API_INVALID_ALLOC_CLASS
IC_API_INVALID_PLANNING_CLASS
IC_API_INVALID_ITEMCOST_CLASS
IC_API_INVALID_COST_MTHD_CODE
IC_API_INVALID_GRADE_CTL
IC_API_INVALID_STATUS_CTL
IC_API_INVALID_QC_GRADE
IC_API_INVALID_LOT_STATUS_API
IC_API_INVALID_QCITEM_NO
IC_API_INVALID_QCHOLD_RES_
CODE
IC_API_INVALID_EXPACTION_CODE
IC_API_INVALID_WHSE_ITEM_NO
IC_API_INVALID_EXPERIMENTAL_
IND
IC_API_INVALID_SEQ_DPND_CLASS
IC_API_INVALID_COMMODITY_
CODE
IC_API_INVALID_MATR_DAYS
2-23
Message Code
2-24
Narrative
IC_API_INVALID_HOLD_DAYS
SY_API_UNABLE_TO_GET_
SURROGATE
3
Item Create API Wrapper
This topic provides the business function, input structure, and ASCII flat file layout
for the Item Create API Wrapper. The topic also presents package and procedure
names, special logic, error messages, and a code example for Item Create API
Wrapper.
The following topics are covered:
This topic describes how the wrapper function should be called and the parameters
that are required and optional.
3-2
Type
Length
Reqd
item number
alphanumeric
32
item description 1
alphanumeric
70
item description 2
alphanumeric
70
alphanumeric
32
alphanumeric
32
unit of measure
alphanumeric
number
alphanumeric
number
16
number
16
level code
number
number
number
number
number
number
match type
number
number
inventory type
alphanumeric
3-4
Field Name
Type
Length
Reqd
shelf life
number
16
retest interval
number
16
alphanumeric
gl class
alphanumeric
inventory class
alphanumeric
sales class
alphanumeric
ship class
alphanumeric
freight class
alphanumeric
price class
alphanumeric
storage class
alphanumeric
purchase class
alphanumeric
tax class
alphanumeric
customs class
alphanumeric
allocation class
alphanumeric
planning class
alphanumeric
cost class
alphanumeric
alphanumeric
alphanumeric
16
number
number
default QC grade
alphanumeric
alphanumeric
number
10
number
10
QC reference item
alphanumeric
32
alphanumeric
alphanumeric
number
16
Field Name
Type
Length
Reqd
alphanumeric
number
16
number
alphanumeric
32
number
date
(DDMMYYYY)
alphanumeric
commodity code
alphanumeric
number
number
user name
alphanumeric
100
attribute1
alphanumeric
240
attribute2
alphanumeric
240
attribute3
alphanumeric
240
attribute4
alphanumeric
240
attribute5
alphanumeric
240
attribute6
alphanumeric
240
attribute7
alphanumeric
240
attribute8
alphanumeric
240
attribute9
alphanumeric
240
attribute10
alphanumeric
240
attribute11
alphanumeric
240
attribute12
alphanumeric
240
attribute13
alphanumeric
240
attribute14
alphanumeric
240
attribute15
alphanumeric
240
Field Name
Type
Length
Reqd
attribute16
alphanumeric
240
attribute17
alphanumeric
240
attribute18
alphanumeric
240
attribute19
alphanumeric
240
attribute20
alphanumeric
240
attribute21
alphanumeric
240
attribute22
alphanumeric
240
attribute23
alphanumeric
240
attribute24
alphanumeric
240
attribute25
alphanumeric
240
attribute26
alphanumeric
240
attribute27
alphanumeric
240
attribute28
alphanumeric
240
attribute29
alphanumeric
240
attribute30
alphanumeric
240
attribute category
alphanumeric
30
3-6
GMI_ITEM_WRP
Create_Item
On initial entry to the wrapper the return status are set to success (S)
If for any record processed an expected error occurs and the return status is
currently set to success then it are updated to expected error (E).
If for any record processed and unexpected error occurs, then the return status
is set to unexpected error (U).
Update Logic
Updates are only be concerned with the processing of messages (errors and others)
generated by the item create API.
Messages (success and error) are written to a flat file designated by the p_output_
file parameter. A log file is written to the /tmp directory. This details start and
completion times, data retrieved from the ASCII flat file and messages generated.
3-8
Error Condition
Narrative
UTL_FILE.INVALID_OPERATION
UTL_FILE.INVALID_PATH
UTL_FILE.INVALID_MODE
UTL_FILE.INVALID_FILEHANDLE
UTL_FILE.WRITE_ERROR
UTL_FILE.READ_ERROR
UTL_FILE.INTERNAL_ERROR
Internal Error
l_return_status VARCHAR2(1);
BEGIN
l_return_status :=Create_item( p_dir
, p_input_file
, p_output_file
, p_delimiter
);
End Create_Item;
--+==========================================================================+
--| FUNCTION NAME
|
--|
Create_Item
|
--|
|
--| TYPE
|
--|
Public
|
--|
|
--| USAGE
|
--|
Create an inventory item
|
--|
|
--| DESCRIPTION
|
--|
This is a PL/SQL wrapper function to call the FND
|
--|
Inventory Create Item API.
|
--|
It reads item data from a flat file and outputs any error
|
--|
messages to a second flat file. It also generates a Status
|
--|
called wrapper<session_id>.log in the /tmp directory.
|
--|
|
--| PARAMETERS
|
--|
p_dir
IN VARCHAR2
- Working directory for input |
--|
and output files.
|
--|
p_input_file
IN VARCHAR2
- Name of input file
|
--|
p_output_file
IN VARCHAR2
- Name of output file
|
--|
p_delimiter
IN VARCHAR2
- Delimiter character
|
--|
|
--| RETURNS
|
--|
VARCHAR2 - S All records processed successfully
|
--|
E 1 or more records errored
|
--|
U 1 or more record unexpected error
|
--|
|
--| HISTORY
|
--|
|
--+==========================================================================+
3-10
VARCHAR2(1);
VARCHAR2(1) :=FND_API.G_RET_STS_SUCCESS;
NUMBER ;
NUMBER :=0;
NUMBER :=0;
NUMBER :=0;
VARCHAR2(2000);
GMIGAPI.item_rec_typ;
ic_item_mst%ROWTYPE;
ic_item_cpg%ROWTYPE;
VARCHAR2(50);
VARCHAR2(20);
UTL_FILE.FILE_TYPE;
VARCHAR2(20);
UTL_FILE.FILE_TYPE;
VARCHAR2(800);
VARCHAR(1);
VARCHAR2(50);
VARCHAR2(20) :=wrapper;
UTL_FILE.FILE_TYPE;
VARCHAR2(20);
l_session_id
VARCHAR2(10);
BEGIN
-- Enable The Buffer
DBMS_OUTPUT.ENABLE(1000000);
l_p_dir
l_input_file
:=p_dir;
:=p_input_file;
l_output_file
l_delimiter
l_global_file
:=p_output_file;
:=p_delimiter;
:=l_input_file;
--- Open The Wrapper File For Output And The Input File for Input.
-l_log_handle
l_infile_handle
--- Loop thru flat file and call Inventory Quantities API
-dbms_output.put_line(Start Processing);
UTL_FILE.PUT_LINE(l_log_handle, Process Started at
|| to_char(SYSDATE,DD-MON-YY HH24:MI:SS));
UTL_FILE.NEW_LINE(l_log_handle);
UTL_FILE.PUT_LINE(l_log_handle, Input Directory
UTL_FILE.PUT_LINE(l_log_handle, Input File
UTL_FILE.PUT_LINE(l_log_handle, Record Type
UTL_FILE.PUT_LINE(l_log_handle, Output File
||
||
||
||
l_p_dir );
l_input_file );
l_delimiter );
l_output_file );
LOOP
l_record_count
3-12
:=l_record_count+1;
BEGIN
UTL_FILE.GET_LINE(l_infile_handle, l_line);
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXIT;
END;
UTL_FILE.NEW_LINE(l_log_handle);
UTL_FILE.PUT_LINE(l_log_handle, Reading Record || l_record_count );
item_rec.item_no
:=Get_Field(l_line,l_delimiter,1);
item_rec.item_desc1
:=Get_Field(l_line,l_delimiter,2);
item_rec.item_desc2
:=Get_Field(l_line,l_delimiter,3);
item_rec.alt_itema
:=Get_Field(l_line,l_delimiter,4);
item_rec.alt_itemb
:=Get_Field(l_line,l_delimiter,5);
item_rec.item_um
:=Get_Field(l_line,l_delimiter,6);
item_rec.dualum_ind
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,7), ), ,0));
item_rec.item_um2
:=Get_Field(l_line,l_delimiter,8);
item_rec.deviation_lo
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,9), ), ,0));
item_rec.deviation_hi
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,10), ), ,0));
item_rec.level_code
:=TO_NUMBER(Get_Field(l_line,l_delimiter,11));
item_rec.lot_ctl
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,12), ), ,0));
item_rec.lot_indivisible :=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,13), ), ,0));
item_rec.sublot_ctl
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,14), ), ,0));
item_rec.loct_ctl
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,15), ), ,0));
item_rec.noninv_ind
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,16), ), ,0));
item_rec.match_type
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,17), ), ,0));
item_rec.inactive_ind
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,18), ), ,0));
item_rec.inv_type
:=Get_Field(l_line,l_delimiter,19);
item_rec.shelf_life
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,20), ), ,0));
item_rec.retest_interval :=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,21), ), ,0));
item_rec.item_abccode
:=Get_Field(l_line,l_delimiter,22);
item_rec.gl_class
:=Get_Field(l_line,l_delimiter,23);
item_rec.inv_class
:=Get_Field(l_line,l_delimiter,24);
item_rec.sales_class
:=Get_Field(l_line,l_delimiter,25);
item_rec.ship_class
:=Get_Field(l_line,l_delimiter,26);
item_rec.frt_class
:=Get_Field(l_line,l_delimiter,27);
item_rec.price_class
:=Get_Field(l_line,l_delimiter,28);
item_rec.storage_class :=Get_Field(l_line,l_delimiter,29);
item_rec.purch_class
:=Get_Field(l_line,l_delimiter,30);
item_rec.tax_class
:=Get_Field(l_line,l_delimiter,31);
item_rec.customs_class :=Get_Field(l_line,l_delimiter,32);
item_rec.alloc_class
:=Get_Field(l_line,l_delimiter,33);
item_rec.planning_class :=Get_Field(l_line,l_delimiter,34);
item_rec.itemcost_class :=Get_Field(l_line,l_delimiter,35);
item_rec.cost_mthd_code :=Get_Field(l_line,l_delimiter,36);
item_rec.upc_code
:=Get_Field(l_line,l_delimiter,37);
item_rec.grade_ctl
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,38), ), ,0));
item_rec.status_ctl
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,39), ), ,0));
item_rec.qc_grade
:=Get_Field(l_line,l_delimiter,40);
--B965832(1) Check for spaces
IF item_rec.qc_grade =
THEN
item_rec.qc_grade := ;
END IF;
--B965832(1) End
item_rec.lot_status
:=Get_Field(l_line,l_delimiter,41);
--B965832(1) Check for spaces
IF item_rec.lot_status =
THEN
item_rec.lot_status :=;
END IF;
--B965832(1) End
item_rec.bulk_id
:=TO_NUMBER(Get_Field(l_line,l_delimiter,42));
item_rec.pkg_id
:=TO_NUMBER(Get_Field(l_line,l_delimiter,43));
item_rec.qcitem_no
:=Get_Field(l_line,l_delimiter,44);
item_rec.qchold_res_code :=Get_Field(l_line,l_delimiter,45);
item_rec.expaction_code :=Get_Field(l_line,l_delimiter,46);
item_rec.fill_qty
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,47), ), ,0));
item_rec.fill_um
:=Get_Field(l_line,l_delimiter,48);
item_rec.expaction_interval :=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,49), ), ,0));
item_rec.phantom_type
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,50), ), ,0));
3-14
item_rec.whse_item_no
:=Get_Field(l_line,l_delimiter,51);
item_rec.experimental_ind:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,52), ), ,0));
IF (Get_Field(l_line,l_line,53) IS NULL)
THEN
item_rec.exported_date :=TO_DATE(02011970,DDMMYYYY);
ELSE
item_rec.exported_date :=TO_DATE(
Get_Field(l_line,l_delimiter,53),DDMMYYYY);
END IF;
item_rec.seq_dpnd_class :=Get_Field(l_line,l_delimiter,54);
item_rec.commodity_code :=Get_Field(l_line,l_delimiter,55);
item_rec.ic_matr_days
:=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,56), ), ,0));
item_rec.ic_hold_days :=
TO_NUMBER(TRANSLATE(NVL(Get_Field(l_line,l_delimiter,57), ), ,0));
IF ((Get_Field(l_line,l_delimiter,58)) IS NULL)
THEN
item_rec.user_name
:=OPM;
ELSE
item_rec.user_name
:=Get_Field(l_line,l_delimiter,58);
END IF;
item_rec.attribute1
:=Get_Field(l_line,l_delimiter,59);
item_rec.attribute2
:=Get_Field(l_line,l_delimiter,60);
item_rec.attribute3
:=Get_Field(l_line,l_delimiter,61);
item_rec.attribute4
:=Get_Field(l_line,l_delimiter,62);
item_rec.attribute5
:=Get_Field(l_line,l_delimiter,63);
item_rec.attribute6
:=Get_Field(l_line,l_delimiter,64);
item_rec.attribute7
:=Get_Field(l_line,l_delimiter,65);
item_rec.attribute8
:=Get_Field(l_line,l_delimiter,66);
item_rec.attribute9
:=Get_Field(l_line,l_delimiter,67);
item_rec.attribute10
:=Get_Field(l_line,l_delimiter,68);
item_rec.attribute11
:=Get_Field(l_line,l_delimiter,69);
item_rec.attribute12
:=Get_Field(l_line,l_delimiter,70);
item_rec.attribute13
:=Get_Field(l_line,l_delimiter,71);
item_rec.attribute14
:=Get_Field(l_line,l_delimiter,72);
item_rec.attribute15
:=Get_Field(l_line,l_delimiter,73);
item_rec.attribute16
:=Get_Field(l_line,l_delimiter,74);
item_rec.attribute17
:=Get_Field(l_line,l_delimiter,75);
item_rec.attribute18
:=Get_Field(l_line,l_delimiter,76);
item_rec.attribute19
:=Get_Field(l_line,l_delimiter,77);
item_rec.attribute20
:=Get_Field(l_line,l_delimiter,78);
item_rec.attribute21
:=Get_Field(l_line,l_delimiter,79);
item_rec.attribute22
:=Get_Field(l_line,l_delimiter,80);
item_rec.attribute23
:=Get_Field(l_line,l_delimiter,81);
item_rec.attribute24
:=Get_Field(l_line,l_delimiter,82);
item_rec.attribute25
:=Get_Field(l_line,l_delimiter,83);
item_rec.attribute26
:=Get_Field(l_line,l_delimiter,84);
item_rec.attribute27
:=Get_Field(l_line,l_delimiter,85);
item_rec.attribute28
:=Get_Field(l_line,l_delimiter,86);
item_rec.attribute29
:=Get_Field(l_line,l_delimiter,87);
item_rec.attribute30
:=Get_Field(l_line,l_delimiter,88);
item_rec.attribute_category :=Get_Field(l_line,l_delimiter,89);
UTL_FILE.PUT_LINE(l_log_handle,item_no
=
UTL_FILE.PUT_LINE(l_log_handle,item_desc1
=
UTL_FILE.PUT_LINE(l_log_handle,item_desc2
=
UTL_FILE.PUT_LINE(l_log_handle,alt_itema
=
UTL_FILE.PUT_LINE(l_log_handle,alt_itemb
=
UTL_FILE.PUT_LINE(l_log_handle,item_um
=
UTL_FILE.PUT_LINE(l_log_handle,dualum_ind
=
UTL_FILE.PUT_LINE(l_log_handle,item_um2
=
UTL_FILE.PUT_LINE(l_log_handle,deviation_lo =
UTL_FILE.PUT_LINE(l_log_handle,deviation_hi =
UTL_FILE.PUT_LINE(l_log_handle,level_code
=
UTL_FILE.PUT_LINE(l_log_handle,lot_ctl
=
UTL_FILE.PUT_LINE(l_log_handle,lot_indivisible=
UTL_FILE.PUT_LINE(l_log_handle,sublot_ctl
=
UTL_FILE.PUT_LINE(l_log_handle,loct_ctl
=
UTL_FILE.PUT_LINE(l_log_handle,noninv_ind
=
UTL_FILE.PUT_LINE(l_log_handle,match_type
=
UTL_FILE.PUT_LINE(l_log_handle,inactive_ind =
UTL_FILE.PUT_LINE(l_log_handle,inv_type
=
UTL_FILE.PUT_LINE(l_log_handle,shelf_life
=
UTL_FILE.PUT_LINE(l_log_handle,retest_interval=
UTL_FILE.PUT_LINE(l_log_handle,item_abccode =
UTL_FILE.PUT_LINE(l_log_handle,gl_class
=
UTL_FILE.PUT_LINE(l_log_handle,inv_class
=
UTL_FILE.PUT_LINE(l_log_handle,sales_class
=
UTL_FILE.PUT_LINE(l_log_handle,ship_class
=
UTL_FILE.PUT_LINE(l_log_handle,frt_class
=
UTL_FILE.PUT_LINE(l_log_handle,price_class
=
UTL_FILE.PUT_LINE(l_log_handle,storage_class =
UTL_FILE.PUT_LINE(l_log_handle,purch_class
=
UTL_FILE.PUT_LINE(l_log_handle,tax_class
=
UTL_FILE.PUT_LINE(l_log_handle,customs_class =
UTL_FILE.PUT_LINE(l_log_handle,alloc_class
=
UTL_FILE.PUT_LINE(l_log_handle,planning_class =
UTL_FILE.PUT_LINE(l_log_handle,itemcost_class =
UTL_FILE.PUT_LINE(l_log_handle,cost_mthd_code =
3-16
||item_rec.item_no);
||item_rec.item_desc1);
||item_rec.item_desc2);
||item_rec.alt_itema);
||item_rec.alt_itemb);
||item_rec.item_um);
||item_rec.dualum_ind);
||item_rec.item_um2);
||item_rec.deviation_lo);
||item_rec.deviation_hi);
||item_rec.level_code);
||item_rec.lot_ctl);
||item_rec.lot_indivisible);
||item_rec.sublot_ctl);
||item_rec.loct_ctl);
||item_rec.noninv_ind);
||item_rec.match_type);
||item_rec.inactive_ind);
||item_rec.inv_type);
||item_rec.shelf_life);
||item_rec.retest_interval);
||item_rec.item_abccode);
||item_rec.gl_class);
||item_rec.inv_class);
||item_rec.sales_class);
||item_rec.ship_class);
||item_rec.frt_class);
||item_rec.price_class);
||item_rec.storage_class);
||item_rec.purch_class);
||item_rec.tax_class);
||item_rec.customs_class);
||item_rec.alloc_class);
||item_rec.planning_class);
||item_rec.itemcost_class);
||item_rec.cost_mthd_code);
UTL_FILE.PUT_LINE(l_log_handle,upc_code
= ||item_rec.upc_code);
UTL_FILE.PUT_LINE(l_log_handle,grade_ctl
= ||item_rec.grade_ctl);
UTL_FILE.PUT_LINE(l_log_handle,status_ctl
= ||item_rec.status_ctl);
UTL_FILE.PUT_LINE(l_log_handle,qc_grade
= ||item_rec.qc_grade);
UTL_FILE.PUT_LINE(l_log_handle,lot_status
= ||item_rec.lot_status);
UTL_FILE.PUT_LINE(l_log_handle,bulk_id
= ||item_rec.bulk_id);
UTL_FILE.PUT_LINE(l_log_handle,pkg_id
= ||item_rec.pkg_id);
UTL_FILE.PUT_LINE(l_log_handle,qcitem_no
= ||item_rec.qcitem_no);
UTL_FILE.PUT_LINE(l_log_handle,qchold_res_code= ||item_rec.qchold_res_code);
UTL_FILE.PUT_LINE(l_log_handle,expaction_code = ||item_rec.expaction_code);
UTL_FILE.PUT_LINE(l_log_handle,fill_qty
= ||item_rec.fill_qty);
UTL_FILE.PUT_LINE(l_log_handle,fill_um
= ||item_rec.fill_um);
UTL_FILE.PUT_LINE(
l_log_handle,expaction_interval = ||item_rec.expaction_interval);
UTL_FILE.PUT_LINE(l_log_handle,phantom_type = ||item_rec.phantom_type);
UTL_FILE.PUT_LINE(l_log_handle,whse_item_no = ||item_rec.whse_item_no);
UTL_FILE.PUT_LINE(
l_log_handle,experimental_ind = ||item_rec.experimental_ind);
UTL_FILE.PUT_LINE(l_log_handle,exported_date = ||item_rec.exported_date);
UTL_FILE.PUT_LINE(l_log_handle,seq_dpnd_class = ||item_rec.seq_dpnd_class);
UTL_FILE.PUT_LINE(l_log_handle,commodity_code = ||item_rec.commodity_code);
UTL_FILE.PUT_LINE(l_log_handle,ic_matr_days = ||item_rec.ic_matr_days);
UTL_FILE.PUT_LINE(l_log_handle,ic_hold_days = ||item_rec.ic_hold_days);
UTL_FILE.PUT_LINE(l_log_handle,user_name
= ||item_rec.user_name);
UTL_FILE.PUT_LINE(l_log_handle,Attribute1
= ||
item_rec.attribute1 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute2
= ||
item_rec.attribute2 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute3
= ||
item_rec.attribute3 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute4
= ||
item_rec.attribute4 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute5
= ||
item_rec.attribute5 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute6
= ||
item_rec.attribute6 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute7
= ||
item_rec.attribute7 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute8
= ||
item_rec.attribute8 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute9
= ||
item_rec.attribute9 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute10
= ||
item_rec.attribute10 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute11
= ||
item_rec.attribute11 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute12
= ||
item_rec.attribute12 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute13
= ||
item_rec.attribute13 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute14
= ||
item_rec.attribute14 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute15
= ||
item_rec.attribute15 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute16
= ||
item_rec.attribute16 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute17
= ||
item_rec.attribute17 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute18
= ||
item_rec.attribute18 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute19
= ||
item_rec.attribute19 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute20
= ||
item_rec.attribute20 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute21
= ||
item_rec.attribute21 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute22
= ||
item_rec.attribute22 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute23
= ||
item_rec.attribute23 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute24
= ||
item_rec.attribute24 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute25
= ||
item_rec.attribute25 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute26
= ||
item_rec.attribute26 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute27
= ||
item_rec.attribute27 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute28
= ||
item_rec.attribute28 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute29
= ||
item_rec.attribute29 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute30
= ||
item_rec.attribute30 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute_Category = ||
item_rec.attribute_category );
GMIPAPI.Create_Item
( p_api_version
=> 3.0
, p_init_msg_list => FND_API.G_TRUE
3-18
, p_commit
=> FND_API.G_TRUE
, p_validation_level => FND_API.G_VALID_LEVEL_FULL
, p_item_rec
=>item_rec
, x_ic_item_mst_row => l_ic_item_mst_row
, x_ic_item_cpg_row => l_ic_item_cpg_row
, x_return_status =>l_status
, x_msg_count
=>l_count
, x_msg_data
=>l_data
);
IF l_count > 0
THEN
l_loop_cnt :=1;
LOOP
FND_MSG_PUB.Get(
p_msg_index
p_data
p_encoded
p_msg_index_out
=>
=>
=>
=>
l_loop_cnt,
l_data,
FND_API.G_FALSE,
l_dummy_cnt);
-- dbms_output.put_line(Message || l_data );
UTL_FILE.PUT_LINE(l_outfile_handle, Record = ||l_record_count );
UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
UTL_FILE.NEW_LINE(l_outfile_handle);
IF l_status = E OR
l_status = U
THEN
l_data
:= CONCAT(ERROR ,l_data);
END IF;
UTL_FILE.PUT_LINE(l_log_handle, l_data);
-- Update error status
IF (l_status = U)
THEN
l_return_status :=l_status;
ELSIF (l_status = E and l_return_status <> U)
THEN
l_return_status :=l_status;
ELSE
l_return_status :=l_status;
END IF;
l_loop_cnt := l_loop_cnt + 1;
IF l_loop_cnt > l_count
THEN
EXIT;
END IF;
END LOOP;
END IF;
END LOOP;
UTL_FILE.NEW_LINE(l_log_handle);
UTL_FILE.PUT_LINE(l_log_handle, Process Completed at
|| to_char(SYSDATE,DD-MON-YY HH24:MI:SS));
--- Check if any messages generated. If so then decode and
-- output to error message flat file
-UTL_FILE.FCLOSE_ALL;
RETURN l_return_status;
EXCEPTION
WHEN UTL_FILE.INVALID_OPERATION THEN
dbms_output.put_line(Invalid Operation For || l_global_file);
UTL_FILE.FCLOSE_ALL;
RETURN l_return_status;
WHEN UTL_FILE.INVALID_PATH THEN
dbms_output.put_line(Invalid Path For
UTL_FILE.FCLOSE_ALL;
RETURN l_return_status;
WHEN UTL_FILE.INVALID_MODE THEN
dbms_output.put_line(Invalid Mode For
UTL_FILE.FCLOSE_ALL;
RETURN l_return_status;
WHEN UTL_FILE.INVALID_FILEHANDLE THEN
dbms_output.put_line(Invalid File Handle
UTL_FILE.FCLOSE_ALL;
RETURN l_return_status;
3-20
|| l_global_file);
|| l_global_file);
|| l_global_file);
|| l_global_file);
|| l_global_file);
--| HISTORY
|
--|
|
--+==========================================================================+
-- Api end of comments
FUNCTION Get_Field
( p_line
IN VARCHAR2
, p_delimiter
IN VARCHAR2
, p_field_no
IN NUMBER
)
RETURN VARCHAR2
IS
--- Local variables
-l_start
NUMBER :=0;
l_end
NUMBER :=0;
BEGIN
-- Determine start position
IF p_field_no = 1
THEN
l_start
:=0;
ELSE
l_start
:=INSTR(p_line,p_delimiter,1,(p_field_no - 1));
IF l_start
= 0
THEN
RETURN NULL;
END IF;
END IF;
-- Determine end position
l_end
:=INSTR(p_line,p_delimiter,1,p_field_no);
IF l_end
= 0
THEN
l_end
:= LENGTH(p_line) + 1;
END IF;
-- Extract the field data
IF (l_end - l_start) = 1
THEN
RETURN NULL;
ELSE
RETURN SUBSTR(p_line,(l_start + 1),((l_end - l_start) - 1));
END IF;
3-22
EXCEPTION
WHEN OTHERS
THEN
RETURN NULL;
END Get_Field;
--+==========================================================================+
--| FUNCTION NAME
|
--|
Get_Substring
|
--|
|
--| TYPE
|
--|
Public
|
--|
|
--| USAGE
|
--|
Get value of Sub-string from formatted ASCII data file record
|
--|
|
--| DESCRIPTION
|
--|
This utility function will return the value of a passed sub-string
|
--|
of a formatted ASCII data file record
|
--|
|
--| PARAMETERS
|
--|
p_substring
IN VARCHAR2
- substring data
|
--|
|
--| RETURNS
|
--|
VARCHAR2
- Value of field
|
--|
|
--| HISTORY
|
--|
|
--+==========================================================================+
-- Api end of comments
FUNCTION Get_Substring
( p_substring
IN VARCHAR2
)
RETURN VARCHAR2
IS
--- Local variables
-l_string_value VARCHAR2(200) := ;
BEGIN
-- Determine start position
l_string_value :=NVL(RTRIM(LTRIM(p_substring)), );
RETURN l_string_value;
EXCEPTION
WHEN OTHERS
THEN
RETURN ;
END Get_Substring;
END GMI_ITEM_WRP;
/
-- show errors;
COMMIT;
EXIT;
3-24
4
Item Lot/Sublot Conversion API
This topic provides the business function and technical overview for the Item
Lot/Sublot Conversion API. Parameters for Item Lot/Sublot conversion are
included with information on table and view use, and package and procedure
names. The topic also provides information on special logic, error messages, and
success messages.
The following topics are covered:
The document describes how the stored procedure should be called, the parameters
that are required (and optional) and the values that are returned to the calling
program. This includes all error conditions that may arise.
The procedure is intended as a create function only. The create function is used
primarily to load item data from legacy systems on implementation.
4-2
GMIPAPI.Create_Item_Lot_Conv
(
p_api_version
, p_init_msg_list
, p_commit
, p_validation_level
, p_conv_rec
, x_ic_item_cnv_row
, x_return_status
, x_msg_count
, x_msg_data
);
IN
IN
IN
IN
IN
OUT
OUT
OUT
OUT
NUMBER
VARCHAR2 := FND_API.G_FALSE
VARCHAR2 := FND_API.G_FALSE
NUMBER := FND_API.G_VALID_LEVEL_FULL
GMIGAPI.conv_rec_typ
ic_lots_mst%ROWTYPE
VARCHAR2
NUMBER
VARCHAR2
The first 4, and last 3 parameters are standard across all of the API calls and are
identical to the Create Item API, where they are fully documented. If the creation is
successful, the x_ic_item_cnv_row parameter is returned with the data set up in the
table, regardless of whether it was committed by the procedure.
The group procedure has the following call interface:
GMIGAPI.Create_Item_Lot_Conv
(
p_api_version
, p_init_msg_list
, p_commit
, p_validation_level
, p_conv_rec
, p_ic_item_mst_row
, p_ic_lots_mst_row
, x_ic_item_cnv_row
, x_return_status
, x_msg_count
, x_msg_data
);
IN
IN
IN
IN
IN
IN
IN
OUT
OUT
OUT
OUT
NUMBER
VARCHAR2 := FND_API.G_FALSE
VARCHAR2 := FND_API.G_FALSE
NUMBER := FND_API.G_VALID_LEVEL_FULL
GMIGAPI.conv_rec_typ
ic_item_mst%ROWTYPE
ic_lots_mst%ROWTYPE
ic_lots_mst%ROWTYPE
VARCHAR2
NUMBER
VARCHAR2
This procedure takes two additional parameters compared to the P variant for use
when item and lot data are already known. If this is the case then p_ic_item_mst_
row and p_ic_lots_mst_row should be passed with the appropriate data. This can
be found by calling the GMIGUTL.Get_Item and GMIGUTL.Get_Lot procedures.
All other IN and OUT parameters are identical to the public API.
This p_conv_rec parameter passes the item-specific data required to create an
inventory item. It is described in the following. Please refer to the section on the
Item Lot/Sublot Conversion API Wrapper for an example of how to populate and
call the stored procedure.
Field/Column
Type
Length
item_no
varchar2
32
Default
Reqd
Validation
lot_no
varchar2
32
sublot_no
varchar2
32
from_uom
varchar2
to_uom
varchar2
4-4
Field/Column
Type
type_factor
number
user_name
varchar2
Length
100
Default
OPM
Reqd
Validation
Conversion factor. 1
from-uom equals this
number of to_uom
Select
ic_item_mst
sy_uoms_mst
ic_item_cnv
sy_uoms_typ
ic_lots_mst
Insert
Update
Delete
Base Table
The Item Lot UOM conversion table IC_ITEM_CNV holds unit of measure
conversion values for the item/lot.
When an item is identified as dual UOM and the alternate UOM is of a different
type (for example, an item is defined in type WEIGHT with dual UOM in
VOLUME) the save of the item master prompts for the conversion factor between
WEIGHT and VOLUME for the item. This mechanism and structure supports
transactional processing of the item in any supported UOM.
4-6
GMIPAPI
The stored procedure which is called to create a new Item Lot/Sublot conversion is:
Create_Lot
Please refer to the Item Lot/Sublot conversion API wrapper specification for an
example of how the above procedure is executed.
Update Logic
When all the validation checks have been performed and no errors are found, a new
item/lot conversion is created within the database. The following steps are
followed:
1.
2.
3.
Get unit of measure type of primary unit of measure for item (C)
4.
5.
6.
If standard unit of measure differs from the from unit of measure then use the
standard unit of measure conversion routine to convert from p_item_cnv_
rec.from_um to sy_uoms_typ.std_um.
7.
8.
If standard unit of measure differs from the to unit of measure then use the
standard unit of measure conversion routine to convert from p_item_cnv_
rec.to_um to sy_uoms_typ.std_um.
9.
4-8
Column Name
Value
item_id
ic_item_mst.item_id
lot_id
um_type
sy_uoms_typ.um_type of p_item_cnv_rec.to_um
type_factor
Calculated above
creation_date
System date
last_update_date
System date
created_by
last_updated_by
trans_cnt
delete_mark
text_code
type_factorrev
Reciprocal of type_factor
last_update_login
login_id
Narrative
IC_API_INVALID_ITEM_NO
IC_API_INVALID_LOT_NO
IC_API_INVALID_LOT_UOM_TYPE
IC_API_INVALID_LOT_UOM
IC_API_ITEM_CNV_ALREADY_EXISTS
IC_API_INVALID_TYPE_FACTOR
IC_API_LOT_ITEM_UOM_MISMATCH
IC_API_ITEM_LOT_UOM_FAILED
Narrative
IC_API_ILC_CREATED
Conversion created for item &ITEM_NO lot &LOT_NO SUBLOT_NO UOM type &UM_TYPE
4-10
5
Item Lot/Sublot Conversion API Wrapper
This topic provides the business function, technical requirements, input structure,
special logic, ASCII flat file layout, and package and procedure names for the Item
Lot/Sublot Conversion API Wrapper. Error messages and a code example are also
supplied.
The following topics are covered:
This topic describes how the wrapper function should be called and the parameter
requirements.
5-2
On initial entry to the wrapper the return status is set to success (S).
If for any record processed an expected error occurs and the return status is
currently set to success then it is updated to expected error (E).
If for any record processed and unexpected error occurs, then the return status
is set to unexpected error (U).
Update Logic
Updates are only concerned with the processing of messages (errors and others)
generated by the item/lot conversion API.
Messages (success and error) are written to a flat file as designated by the p_
output_file parameter. Additionally a log file is written to the /tmp directory. This
details the start and completion times, data retrieved from the ASCII flat file, and
messages generated.
Type
Length
Required
item number
alphanumeric
32
lot number
alphanumeric
32
sublot number
alphanumeric
32
from unit of
measure
alphanumeric
to unit of
measure
alphanumeric
conversion factor
number
16
user name
alphanumeric
100
GMI_ITEM_LOT_CONV_WRP
Create_Conv
5-4
Error Condition
Narrative
UTL_FILE INVALID_OPERATION
UTL_FILE.INVALID_PATH
UTL_FILE.INVALID_MODE
UTL_FILE.INVALID_FILEHANDLE
UTL_FILE.WRITE_ERROR
UTL_FILE.READ_ERROR
UTL_FILE.INTERNAL_ERROR
Internal Error
BEGIN
l_return_status :=Create_conv( p_dir
, p_input_file
, p_output_file
, p_delimiter
);
End Create_Conv;
--+==========================================================================+
--| FUNCTION NAME
|
--|
Create_conv
|
--|
|
--| TYPE
|
--|
Public
|
--|
|
--| USAGE
|
--|
Create an Item/Lot/Sublot UoM conversion
|
--|
|
--| DESCRIPTION
|
--|
This is a PL/SQL wrapper function to call the OPM
|
--|
Inventory Item Lot/Sublot UOM Conversion Create API.
|
--|
It reads item data from a flat file and outputs any error
|
--|
messages to a second flat file. It also generates a Status
|
--|
called wrapper<session_id>.log in the /Out directory.
|
--|
|
--| PARAMETERS
|
--|
p_dir
IN VARCHAR2
- Working directory for input |
--|
and output files.
|
--|
p_input_file
IN VARCHAR2
- Name of input file
|
--|
p_output_file
IN VARCHAR2
- Name of output file
|
--|
p_delimiter
IN VARCHAR2
- Delimiter character
|
--|
|
--| RETURNS
|
--|
VARCHAR2 - S All records processed successfully
|
--|
E 1 or more records errored
|
--|
U 1 or more record unexpected error
|
--|
|
--| HISTORY
|
--|
|
--+==========================================================================+
-- Api end of comments
FUNCTION Create_Conv
( p_dir
IN VARCHAR2
5-6
, p_input_file IN VARCHAR2
, p_output_file IN VARCHAR2
, p_delimiter
IN VARCHAR2
)
RETURN VARCHAR2
IS
--- Local variables
-l_status
l_return_status
l_count
l_dummy_cnt
l_loop_cnt
l_record_count
l_data
item_cnv_rec
l_p_dir
l_output_file
l_outfile_handle
l_input_file
l_infile_handle
l_line
l_delimiter
l_log_dir
l_log_name
l_log_handle
l_global_file
VARCHAR2(1);
VARCHAR2(1) :=FND_API.G_RET_STS_SUCCESS;
NUMBER ;
NUMBER :=0;
NUMBER :=0;
NUMBER :=0;
VARCHAR2(2000);
GMIGAPI.conv_rec_typ;
VARCHAR2(50);
VARCHAR2(20);
UTL_FILE.FILE_TYPE;
VARCHAR2(20);
UTL_FILE.FILE_TYPE;
VARCHAR2(200);
VARCHAR(1);
VARCHAR2(50);
VARCHAR2(20) :=wrapper;
UTL_FILE.FILE_TYPE;
VARCHAR2(20);
l_session_id
l_ic_item_cnv_row
VARCHAR2(10);
ic_item_cnv%ROWTYPE;
BEGIN
-- Enable The Buffer
DBMS_OUTPUT.ENABLE(1000000);
l_p_dir
l_input_file
l_output_file
l_delimiter
l_global_file
:=p_dir;
:=p_input_file;
:=p_output_file;
:=p_delimiter;
:=l_input_file;
--- Loop thru flat file and call Item Lot/Sublot UOM Conversion create API
-UTL_FILE.PUT_LINE(l_log_handle, Process Started at
|| to_char(SYSDATE,DD-MON-YY HH:MI:SS));
UTL_FILE.NEW_LINE(l_log_handle);
UTL_FILE.PUT_LINE(l_log_handle, Input Directory
UTL_FILE.PUT_LINE(l_log_handle, Input File
UTL_FILE.PUT_LINE(l_log_handle, Record Type
UTL_FILE.PUT_LINE(l_log_handle, Output File
||
||
||
||
l_p_dir );
l_input_file );
l_delimiter );
l_output_file );
LOOP
l_record_count
:=l_record_count+1;
BEGIN
UTL_FILE.GET_LINE(l_infile_handle, l_line);
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXIT;
END;
5-8
UTL_FILE.NEW_LINE(l_log_handle);
UTL_FILE.PUT_LINE(l_log_handle, Reading Record || l_record_count );
item_cnv_rec.item_no
:=Get_Field(l_line,l_delimiter,1);
item_cnv_rec.lot_no
:=Get_Field(l_line,l_delimiter,2);
item_cnv_rec.sublot_no
:=Get_Field(l_line,l_delimiter,3);
item_cnv_rec.from_uom
:=Get_Field(l_line,l_delimiter,4);
item_cnv_rec.to_uom
:=Get_Field(l_line,l_delimiter,5);
IF (Get_Field(l_line,l_delimiter,6) IS NULL)
THEN
item_cnv_rec.type_factor:=0;
ELSE
item_cnv_rec.type_factor:=TO_NUMBER(Get_Field(l_line,l_delimiter,6));
END IF;
IF (Get_Field(l_line,l_delimiter,7) IS NULL)
THEN
item_cnv_rec.user_name
:=OPM;
ELSE
item_cnv_rec.user_name
:=Get_Field(l_line,l_delimiter,7);
END IF;
UTL_FILE.PUT_LINE(l_log_handle,item no
=
UTL_FILE.PUT_LINE(l_log_handle,lot no
=
UTL_FILE.PUT_LINE(l_log_handle,sublot no =
UTL_FILE.PUT_LINE(l_log_handle,from_uom =
UTL_FILE.PUT_LINE(l_log_handle,to_uom
=
UTL_FILE.PUT_LINE(l_log_handle,type_factor=
UTL_FILE.PUT_LINE(l_log_handle,op Code
=
||item_cnv_rec.item_no );
||item_cnv_rec.lot_no );
||item_cnv_rec.sublot_no );
||item_cnv_rec.from_uom );
||item_cnv_rec.to_uom );
||item_cnv_rec.type_factor );
||item_cnv_rec.user_name );
IF l_count > 0
THEN
l_loop_cnt :=1;
LOOP
FND_MSG_PUB.Get(
p_msg_index
p_data
p_encoded
p_msg_index_out
=>
=>
=>
=>
l_loop_cnt,
l_data,
FND_API.G_FALSE,
l_dummy_cnt);
-- dbms_output.put_line(Message || l_data );
UTL_FILE.PUT_LINE(l_outfile_handle, Record = ||l_record_count );
UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
UTL_FILE.NEW_LINE(l_outfile_handle);
IF l_status = E OR
l_status = U
THEN
l_data
:= CONCAT(ERROR ,l_data);
END IF;
UTL_FILE.PUT_LINE(l_log_handle, l_data);
-- Update error status
IF (l_status = U)
THEN
l_return_status :=l_status;
ELSIF (l_status = E and l_return_status <> U)
THEN
l_return_status :=l_status;
ELSE
l_return_status :=l_status;
END IF;
l_loop_cnt := l_loop_cnt + 1;
IF l_loop_cnt > l_count
THEN
EXIT;
END IF;
END LOOP;
END IF;
5-10
END LOOP;
UTL_FILE.NEW_LINE(l_log_handle);
UTL_FILE.PUT_LINE(l_log_handle, Process Completed at
|| to_char(SYSDATE,DD-MON-YY HH:MI:SS));
--- Check if any messages generated. If so then decode and
-- output to error message flat file
-UTL_FILE.FCLOSE_ALL;
RETURN l_return_status;
EXCEPTION
WHEN UTL_FILE.INVALID_OPERATION THEN
dbms_output.put_line(Invalid Operation For || l_global_file);
UTL_FILE.FCLOSE_ALL;
RETURN FND_API.G_RET_STS_UNEXP_ERROR;
WHEN UTL_FILE.INVALID_PATH THEN
dbms_output.put_line(Invalid Path For
UTL_FILE.FCLOSE_ALL;
RETURN FND_API.G_RET_STS_UNEXP_ERROR;
WHEN UTL_FILE.INVALID_MODE THEN
dbms_output.put_line(Invalid Mode For
UTL_FILE.FCLOSE_ALL;
RETURN FND_API.G_RET_STS_UNEXP_ERROR;
WHEN UTL_FILE.INVALID_FILEHANDLE THEN
dbms_output.put_line(Invalid File Handle
UTL_FILE.FCLOSE_ALL;
RETURN FND_API.G_RET_STS_UNEXP_ERROR;
WHEN UTL_FILE.WRITE_ERROR THEN
dbms_output.put_line(Invalid Write Error
UTL_FILE.FCLOSE_ALL;
RETURN FND_API.G_RET_STS_UNEXP_ERROR;
WHEN UTL_FILE.READ_ERROR THEN
dbms_output.put_line(Invalid Read Error
UTL_FILE.FCLOSE_ALL;
RETURN FND_API.G_RET_STS_UNEXP_ERROR;
|| l_global_file);
|| l_global_file);
|| l_global_file);
|| l_global_file);
|| l_global_file);
5-11
5-12
IS
--- Local variables
-l_start
NUMBER :=0;
l_end
NUMBER :=0;
BEGIN
-- Determine start position
IF p_field_no = 1
THEN
l_start
:=0;
ELSE
l_start
:=INSTR(p_line,p_delimiter,1,(p_field_no - 1));
IF l_start
= 0
THEN
RETURN NULL;
END IF;
END IF;
-- Determine end position
l_end
:=INSTR(p_line,p_delimiter,1,p_field_no);
IF l_end
= 0
THEN
l_end
:= LENGTH(p_line) + 1;
END IF;
-- Extract the field data
IF (l_end - l_start) = 1
THEN
RETURN NULL;
ELSE
RETURN SUBSTR(p_line,(l_start + 1),((l_end - l_start) - 1));
END IF;
EXCEPTION
WHEN OTHERS
THEN
RETURN NULL;
END Get_Field;
--+==========================================================================+
--| FUNCTION NAME
|
5-13
--|
Get_Substring
|
--|
|
--| TYPE
|
--|
Public
|
--|
|
--| USAGE
|
--|
Get value of Sub-string from formatted ASCII data file record
|
--|
|
--| DESCRIPTION
|
--|
This utility function will return the value of a passed sub-string
|
--|
of a formatted ASCII data file record
|
--|
|
--| PARAMETERS
|
--|
p_substring
IN VARCHAR2
- substring data
|
--|
|
--| RETURNS
|
--|
VARCHAR2
- Value of field
|
--|
|
--| HISTORY
|
--|
|
--+==========================================================================+
-- Api end of comments
FUNCTION Get_Substring
( p_substring
IN VARCHAR2
)
RETURN VARCHAR2
IS
--- Local variables
-l_string_value VARCHAR2(200) := ;
BEGIN
-- Determine start position
l_string_value :=NVL(RTRIM(LTRIM(p_substring)), );
RETURN l_string_value;
EXCEPTION
WHEN OTHERS
THEN
RETURN ;
END Get_Substring;
5-14
END GMI_ITEM_LOT_CONV_WRP;
/
commit;
exit;
5-15
5-16
6
Inventory Quantities API
This topic provides the business function and technical overview for the Inventory
Quantities API. Parameters for Inventory Quantities API are included with
information on table and view use, and package and procedure names. The topic
also provides information on special logic, error messages, and success messages.
The following topics are covered:
Create inventory
Adjust inventory
Move inventory
Change QC grade
This topic describes how the stored procedure should be called, the parameters that
are required (and optional) and the values that are returned to the calling program.
This includes all error conditions that may arise.
6-2
GMIPAPI.Inventory_Posting
(
p_api_version
, p_init_msg_list
, p_commit
, p_validation_level
, p_qty_rec
, x_ic_jrnl_mst_row
, x_ic_adjs_jnl_row1
, x_ic_adjs_jnl_row2
, x_return_status
, x_msg_count
, x_msg_data
);
IN
IN
IN
IN
IN
OUT
OUT
OUT
OUT
OUT
OUT
NUMBER
VARCHAR2 := FND_API.G_FALSE
VARCHAR2 := FND_API.G_FALSE
NUMBER := FND_API.G_VALID_LEVEL_FULL
GMIGAPI.qty_rec_typ
ic_jrnl_mst%ROWTYPE
ic_adjs_jnl%ROWTYPE
ic_adjs_jnl%ROWTYPE
VARCHAR2
NUMBER
VARCHAR2
The first 4, and last 3 parameters are standard across all of the API calls and are
identical to the Create Item API where they are fully documented. If the posting is
successful, the x_ic_jrnl_mst_row and x_ic_adjs_jnl_row parameters are returned
with the data set up in the tables, regardless of whether it was committed by the
procedure. For inventory movements, grade and status changes x_ic_adjs_jnl_row1
contains the from and x_ic_adjs_jnl_row2 contains the to. For all other calls the x_
ic_adjs_jnl_row2 returned s undefined.
The group level call interface is:
GMIGAPI.Inventory_Posting
(
,
,
,
,
,
,
,
p_api_version
p_init_msg_list
p_commit
p_validation_level
p_qty_rec
p_ic_item_mst_row
p_ic_item_cpg_row
p_ic_lots_mst_row
IN
IN
IN
IN
IN
IN
IN
IN
NUMBER
VARCHAR2 := FND_API.G_FALSE
VARCHAR2 := FND_API.G_FALSE
NUMBER := FND_API.G_VALID_LEVEL_FULL
GMIGAPI.qty_rec_typ
ic_item_mst%ROWTYPE
ic_item_cpg%ROWTYPE
ic_lots_mst%ROWTYPE
, p_oc_lots_cpg_row
, x_ic_jrnl_mst_row
, x_ic_adjs_jnl_row1
, x_ic_adjs_jnl_row2
, x_return_status
, x_msg_count
, x_msg_data
);
IN
OUT
OUT
OUT
OUT
OUT
OUT
ic_lots_cpg%ROWTYPE
ic_jrnl_mst%ROWTYPE
ic_adjs_jnl%ROWTYPE
ic_adjs_jnl%ROWTYPE
VARCHAR2
NUMBER
VARCHAR2
This version takes in extra parameters for use when the appropriate data is known
in the calling program in the same way as above.
The p_qty_rec parameter is used to pass the item-specific data required to create an
inventory item. It is described below. Please refer to the Inventory Quantities API
Wrapper topic for an example of how to populate this parameter and call the stored
procedure.
Field/Column
Type
Length
trans_type
number
Default
Reqd
Validation
1 - create inventory
2 - adjust inventory
3 - move inventory
4 - change lot status
5 - change QC grade
No other values allowed
item_no
varchar
2
32
journal_no
varchar
2
32
Must be blank if
automatic document
sequencing
Must not exist in ic_jrnl_
mst if manual document
sequencing
6-4
Field/Column
Type
Length
from_whse_
code
varchar
2
Default
Reqd
Validation
to_whse_code
varchar
2
item_um
varchar
2
NULL
item_um2
varchar
2
lot_no
varchar
2
32
blank
sublot_no
varchar
2
32
from_location
varchar
2
to_location
varchar
2
trans_qty
blank
16
16
number
trans_qty2
number
qc_grade
varchar
2
lot_status
varchar
2
co_code
varchar
2
6-6
Field/Column
Type
Length
orgn_code
varchar
2
trans_date
date
reason_code
varchar
2
user_name
varchar
2
100
Default
Reqd
Validation
Must exist in sy_orgn_mst
and sy_orgn_mst.co_code
must be co_code above
OPM
Must be in an open
inventory calendar
Table Name
Select
ic_item_mst
sy_uoms_mst
ic_item_cnv
sy_uoms_typ
ic_lots_mst
Insert
Update
ic_adjs_jnl
ic_tran_cmp
X
X
ic_summ_inv
ic_lots_sts
Base Table
ic_jrnl_mst
ic_loct_inv
Delete
The Item Lot UOM conversion table IC_ITEM_CNV holds unit of measure
conversion values for the item/lot.
When an item is identified as dual UOM and the alternate UOM is of a different
type (for example, the item is defined in type WEIGHT with dual UOM in
VOLUME) the save of the item master prompts for the conversion factor between
WEIGHT and VOLUME for the item. This mechanism and structure supports
transactional processing of the item in any supported UOM.
Inventory_Posting
Please refer to the Inventory Quantities API Wrapper topic for an example of how
the previous procedure is executed.
6-8
For all transactions except change (QC) grade, the "from warehouse" is
validated and the "from location" is validated according to the item/warehouse
location rules.
For move inventory transactions, the "to warehouse" is validated and the "to
location" is similarly validated.
For transactions affecting quantity for dual unit of measure items, the
secondary quantity is validated to be within tolerance of the primary quantity.
For adjustments, movements and change lot status, the inventory location is
validated to ensure an on-hand balance exists at the location. For create
inventory transactions, there should be no location balance.
Update Logic
When all the validation checks have been performed and no errors found, the
transaction can be posted. The following steps are followed:
1.
The surrogate key (journal_id) is obtained from the surrogate key generator and
a row is inserted in the journal header table as follows:
2.
Column Name
Value
journal_id
journal_no
journal_
comment
Blank
posting_id
Zero
print_cnt
Zero
posted_ind
orgn_code
from p_trans_rec.orgn_code
creation_date
system date
last_update_date
system date
created_by
last_updated_by
Column Name
Value
program_
update_date
System date
last_update_
login
login_id
in_use
delete_mark
text_code
Null
3.
For Create inventory and adjust inventory transactions, one row is inserted
in the inventory adjustment detail table.
For Move inventory, lot status and (QC) grade change transactions, two
rows are inserted. This value is stored as a loop counter.
4.
5.
6.
7.
Column Name
Value
trans_type
CREI if p_trans_rec.trans_type = 1
ADJI if p_trans_rec.trans_type = 2
TRNI if p_trans_rec.trans_type = 3
STSI if p_trans_rec.trans_type = 4
GRDI if p_trans_rec.trans_type = 5
6-10
trans_flag
Zero
doc_id
doc_line
Loop counter
journal_id
completed_ind
Column Name
Value
whse_code
reason_code
from p_trans_rec.reason_code
doc_date
from p_trans_rec.trans_date
item_id
item_um
p_trans_rec.item_um
item_um2
p_trans_rec.item_um2
lot_id
location
qty
p_trans_rec.trans_qty
qty2
p_trans_rec.trans_qty2
qc_grade
lot_status
line_type
line_id
co_code
p_trans_rec.co_code
orgn_code
p_trans_rec.orgn_code
no_inv
Zero
no_trans
Zero
creation_date
System date
last_update_date
System date
created_by
Column Name
Value
last_updated_by
program_update_
date
System date
trans_cnt
last_update_login
login_id
8.
For each row inserted into the inventory adjustment detail table, the PL/SQL
record p_cmp_tran_rec defined below is populated and the Completed
Inventory Transaction Processor is called.
6-12
Column Name
Value
item_id
p_cmp_tran_rec.item_id
line_id
p_cmp_tran_rec.line_id
trans_id
co_code
p_cmp_tran_rec.co_code
orgn_code
p_cmp_tran_rec.orgn_code
whse_code
p_cmp_tran_rec.whse_code
lot_id
p_cmp_tran_rec.lot_id
location
p_cmp_tran_rec.location
doc_id
p_cmp_tran_rec.doc_id
Column Name
Value
doc_type
p_cmp_tran_rec.trans_type
doc_line
p_cmp_tran_rec.doc_line
line_type
p_cmp_tran_rec.line_type
reason_code
p_cmp_tran_rec.reason_code
trans_date
p_cmp_tran_rec.doc_date
trans_qty
p_cmp_tran_rec.trans_qty
trans_qty2
p_cmp_tran_rec.trans_qty2
qc_grade
p_cmp_tran_rec.qc_grade
lot_status
p_cmp_tran_rec.lot_status
trans_stat
p_cmp_tran_rec.trans_stat
trans_um
p_cmp_tran_rec.trans_um
trans_um2
p_cmp_tran_rec.trans_um2
op_code
p_cmp_tran_rec.op_code
gl_posted_ind
p_cmp_tran_rec.gl_posted_ind
event_id
p_cmp_tran_rec.event_id
text_code
p_cmp_tran_rec.text_code
creation_date
system date
last_update_date
system date
created_by
last_updated_by
last_update_login
login_id
Value
loct_onhand
loct_onhand + p_cmp_tran_rec.trans_qty
loct_onhand2
loct_onhand2 + p_cmp_tran_rec.trans_qty2
The Inventory summary table is then updated. The lot status table is read (ic_lots_
sts.lot_status = p_cmp_tran_rec.lot_status) in order to obtain the lot status
indicators. The ic_summ_inv table is then updated as follows:
where item_id = p_cmp_tran_rec.item_id
and whse_code = p_cmp_tran_rec.whse_code
and qc_grade = p_cmp_tran_rec.qc_grade
Column Name
Value
onhand_qty
if ic_lots_sts.nettable_ind = 1 then
onhand_qty = onhand_qty + p_cmp_tran_rec.trans_qty
onhand_qty2
if ic_lots_sts.nettable_ind = 1 then
onhand_qty2 = onhand_qty2 + p_cmp_tran_rec.trans_qty2
onhand_prod_qty
if ic_lots_sts.prod_ind = 1 then
onhand_prod_qty = onhand_prod_qty + p_cmp_tran_rec.trans_qty
onhand_prod_qty2
if ic_lots_sts.prod_ind = 1 then
onhand_prod_qty2= onhand_prod_qty2 + p_cmp_tran_rec.trans_
qty2
onhand_order_qty
if ic_lots_sts.order_proc_ind = 1 then
onhand_order_qty = onhand_order_qty + p_cmp_tran_rec.trans_qty
onhand_order_qty2
if ic_lots_sts.order_proc_ind = 1 then
onhand_order_qty2 = onhand_order_qty2 + p_cmp_tran_rec.trans_
qty2
onhand_ship_qty
if ic_lots_sts.shipping_ind = 1 then
onhand_ship_qty = onhand_ship_qty + p_cmp_tran_rec.trans_qty
onhand_ship_qty2
if ic_lots_sts.shipping_ind = 1 then
onhand_ship_qty2 = onhand_ship_qty2 + p_cmp_tran_rec.trans_
qty2
6-14
loct_onhand2
loct_onhand2 + p_cmp_tran_rec.trans_qty2
If the row is not found in the inventory summary table then it is created with zero
value quantities prior to be updated as above.
Value
lot_status
p_cmp_tran_rec.lot_status
The transaction quantity values are then used to update the summary inventory
table (ic_summ_inv) as detailed for inventory movements above.
Value
qc_grade
1.
2.
6-16
The warehouses at which the lot exists and their on-hand quantities must be
obtained from the inventory location table (ic_loct_inv). This are used to
populate the PL/SQL record p_cmp_tran_rec as follows:
The transaction quantity values are then used to update the summary inventory
table (ic_summ_inv) as detailed for inventory movements above.
Narrative
IC_API_INVALID_TRANS_TYPE
IC_API_INVALID_JOURNAL_
NO
SY_API_UNABLE_TO_GET_
DOC_NO
IC_API_INVALID_ITEM_NO
IC_API_TRANS_TYPE_FOR_
ITEM
IC_API_INVALID_LOT_NO
IC_API_INVALID_UOM
IC_API_SUBLOT_NOT_REQD
IC_API_INVALID_WHSE_CODE
IC_API_INVALID_LOCATION
IC_API_INVALID_QTY
IC_API_LOCT_ONHAND_
EXISTS
IC_API_NO_LOCT_ONHAND
IC_API_NEG_QTY_NOT_
ALLOWED
IC_API_MOVE_STATUS_ERR
6-18
Message Code
Narrative
IC_API_INVALID_LOT_STATUS
IC_API_INVALID_QC_GRADE
SY_API_INVALID_REASON_
CODE
SY_API_INVALID_CO_CODE
SY_API_INVALID_ORGN_
CODE
IC_API_INVALID_TRANS_
DATE
SY_API_UNABLE_TO_GET_
SURROGATE
SY_API_INVALID_OP_CODE
Narrative
6-20
7
Inventory Quantities API Wrapper
This topic provides business function and input structure for the Inventory
Quantities API Wrapper. ASCII flat file layout, package and procedure names,
special logic, and error messages are included. Sample inventory quantities API
wrapper code is shown.
The following topics are covered:
This topic describes how the wrapper function should be called, and parameters
that are required or optional.
7-2
Field Name
Type
Length
Required
transaction type
number
item number
alphanumeric
32
journal number
alphanumeric
32
alphanumeric
to warehouse code
alphanumeric
alphanumeric
alphanumeric
lot number
alphanumeric
32
sublot number
alphanumeric
32
from location
alphanumeric
16
Field Name
Type
Length
Required
to location
alphanumeric
16
number
number
QC grade
alphanumeric
lot status
alphanumeric
company code
alphanumeric
organization code
alphanumeric
transaction date
date
(DDMMYYYY)
reason code
alphanumeric
user name
alphanumeric
100
GMI_QUANTITY_WRP
Post
On initial entry to the wrapper the return status is set to success (S).
If for any record processed an expected error occurs and the return status is
currently set to success then it is updated to expected error (E).
If for any record processed and unexpected error occurs, then the return status
is set to unexpected error (U).
Update Logic
Updates are only concerned with the processing of messages (errors and others)
generated by the inventory quantities API.
Messages (success and error) are written to a flat file as designated by the p_
output_file parameter. Additionally a log file are written to the /tmp directory. This
details start and completion times, data retrieved from the ASCII flat file and
messages generated.
7-4
Narrative
UTL_FILE.INVALID_OPERATION
UTL_FILE.INVALID_PATH
UTL_FILE.INVALID_MODE
UTL_FILE.INVALID_FILEHANDLE
UTL_FILE.WRITE_ERROR
UTL_FILE.READ_ERROR
UTL_FILE.INTERNAL_ERROR
Internal Error
--+==========================================================================+
--| PROCEDURE NAME
|
--|
Post
|
--|
|
--| TYPE
|
--|
Public
|
--|
|
--| USAGE
|
--|
Post an inventory transaction
|
--|
|
--| DESCRIPTION
|
--|
This is a PL/SQL wrapper procedure to call the Post transaction
|
--|
API wrapper function
|
--|
|
--| PARAMETERS
|
--|
p_dir
IN VARCHAR2
- Working directory for input |
--|
and output files.
|
--|
p_input_file
IN VARCHAR2
- Name of input file
|
--|
p_output_file
IN VARCHAR2
- Name of output file
|
--|
p_delimiter
IN VARCHAR2
- Delimiter character
|
--|
|
--| RETURNS
|
--|
None
|
--|
|
--| HISTORY
|
--|
|
--+==========================================================================+
-- Api end of comments
PROCEDURE Post
( p_dir
IN VARCHAR2
, p_input_file IN VARCHAR2
, p_output_file IN VARCHAR2
, p_delimiter
IN VARCHAR2
)
IS
7-6
l_return_status VARCHAR2(1);
BEGIN
l_return_status :=Post( p_dir
, p_input_file
, p_output_file
, p_delimiter
);
End Post;
--+==========================================================================+
--| FUNCTION NAME
|
--|
Post
|
--|
|
--| TYPE
|
--|
Public
|
--|
|
--| USAGE
|
--|
Post an inventory transaction
|
--|
|
--| DESCRIPTION
|
--|
This is a PL/SQL wrapper function to call the OPM
|
--|
Inventory Quantities API.
|
--|
It reads item data from a flat file and outputs any error
|
--|
messages to a second flat file. It also generates a Status
|
--|
called wrapper<session_id>.log in the /tmp directory.
|
--|
|
--| PARAMETERS
|
--|
p_dir
IN VARCHAR2
- Working directory for input |
--|
and output files.
|
--|
p_input_file
IN VARCHAR2
- Name of input file
|
--|
p_output_file
IN VARCHAR2
- Name of output file
|
--|
p_delimiter
IN VARCHAR2
- Delimiter character
|
--|
|
--| RETURNS
|
--|
None
|
--|
|
--| HISTORY
|
--|
|
--+==========================================================================+
-- Api end of comments
FUNCTION Post
( p_dir
IN VARCHAR2
, p_input_file IN VARCHAR2
, p_output_file IN VARCHAR2
, p_delimiter
IN VARCHAR2
)
RETURN VARCHAR2
IS
--- Local variables
-l_status
l_return_status
l_count
l_loop_cnt
l_dummy_cnt
l_record_count
l_data
trans_rec
l_p_dir
l_output_file
l_outfile_handle
l_input_file
l_infile_handle
l_line
l_delimiter
l_log_dir
l_log_name
l_log_handle
l_global_file
VARCHAR2(1);
VARCHAR2(1) :=FND_API.G_RET_STS_SUCCESS;
NUMBER ;
NUMBER :=0;
NUMBER :=0;
NUMBER :=0;
VARCHAR2(2000);
GMIGAPI.qty_rec_typ;
VARCHAR2(50);
VARCHAR2(20);
UTL_FILE.FILE_TYPE;
VARCHAR2(20);
UTL_FILE.FILE_TYPE;
VARCHAR2(200);
VARCHAR(1);
VARCHAR2(50);
VARCHAR2(20) :=wrapper;
UTL_FILE.FILE_TYPE;
VARCHAR2(20);
l_session_id
VARCHAR2(10);
l_ic_jrnl_mst_row ic_jrnl_mst%ROWTYPE;
l_ic_adjs_jnl_row1 ic_adjs_jnl%ROWTYPE;
l_ic_adjs_jnl_row2 ic_adjs_jnl%ROWTYPE;
BEGIN
-- Enable The Buffer
--DBMS_OUTPUT.ENABLE(1000000);
-- Disable The Buffer
--DBMS_OUTPUT.DISABLE;
l_p_dir
l_input_file
7-8
:=p_dir;
:=p_input_file;
l_output_file
l_delimiter
l_global_file
:=p_output_file;
:=p_delimiter;
:=l_input_file;
||
||
||
||
l_p_dir );
l_input_file );
l_delimiter );
l_output_file );
:=l_record_count+1;
BEGIN
UTL_FILE.GET_LINE(l_infile_handle, l_line);
dbms_output.put_line(LINE IS ||l_line);
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXIT;
END;
UTL_FILE.NEW_LINE(l_log_handle);
UTL_FILE.PUT_LINE(l_log_handle, Reading Record || l_record_count );
trans_rec.trans_type
:=TO_NUMBER(Get_Field(l_line,l_delimiter,1));
trans_rec.item_no
:=Get_Field(l_line,l_delimiter,2);
trans_rec.journal_no
:=Get_Field(l_line,l_delimiter,3);
trans_rec.from_whse_code :=Get_Field(l_line,l_delimiter,4);
trans_rec.to_whse_code
:=Get_Field(l_line,l_delimiter,5);
trans_rec.item_um
:=Get_Field(l_line,l_delimiter,6);
trans_rec.item_um2
:=Get_Field(l_line,l_delimiter,7);
trans_rec.lot_no
:=Get_Field(l_line,l_delimiter,8);
trans_rec.sublot_no
:=Get_Field(l_line,l_delimiter,9);
trans_rec.from_location :=Get_Field(l_line,l_delimiter,10);
trans_rec.to_location
:=Get_Field(l_line,l_delimiter,11);
trans_rec.trans_qty
:=TO_NUMBER(Get_Field(l_line,l_delimiter,12));
trans_rec.trans_qty2
:=TO_NUMBER(Get_Field(l_line,l_delimiter,13));
trans_rec.qc_grade
:=Get_Field(l_line,l_delimiter,14);
trans_rec.lot_status
:=Get_Field(l_line,l_delimiter,15);
trans_rec.co_code
:=Get_Field(l_line,l_delimiter,16);
trans_rec.orgn_code
:=Get_Field(l_line,l_delimiter,17);
IF Get_Field(l_line,l_delimiter,18) IS NULL
THEN
trans_rec.trans_date
:=SYSDATE;
ELSE
trans_rec.trans_date
:=TO_DATE(Get_Field(l_line,l_delimiter,18)
,DDMMYYYY);
END IF;
trans_rec.reason_code
:=Get_Field(l_line,l_delimiter,19);
IF ((Get_Field(l_line,l_delimiter,20)) IS NULL)
THEN
trans_rec.user_name
:=OPM;
ELSE
trans_rec.user_name
:=Get_Field(l_line,l_delimiter,20);
END IF;
UTL_FILE.PUT_LINE(l_log_handle,trans type
UTL_FILE.PUT_LINE(l_log_handle,item no
UTL_FILE.PUT_LINE(l_log_handle,journal no
UTL_FILE.PUT_LINE(l_log_handle,from_whse_code
7-10
=
=
=
=
||trans_rec.trans_type);
||trans_rec.item_no);
||trans_rec.journal_no);
||
trans_rec.from_whse_code);
UTL_FILE.PUT_LINE(l_log_handle,to_whse_code
trans_rec.to_whse_code);
UTL_FILE.PUT_LINE(l_log_handle,item_um
UTL_FILE.PUT_LINE(l_log_handle,item_um2
UTL_FILE.PUT_LINE(l_log_handle,lot no
UTL_FILE.PUT_LINE(l_log_handle,sublot no
UTL_FILE.PUT_LINE(l_log_handle,from_location
trans_rec.from_location);
UTL_FILE.PUT_LINE(l_log_handle,to_location
trans_rec.to_location);
UTL_FILE.PUT_LINE(l_log_handle,trans_qty
UTL_FILE.PUT_LINE(l_log_handle,trans_qty2
UTL_FILE.PUT_LINE(l_log_handle,qc_grade
UTL_FILE.PUT_LINE(l_log_handle,lot_status
UTL_FILE.PUT_LINE(l_log_handle,co code
UTL_FILE.PUT_LINE(l_log_handle,orgn code
UTL_FILE.PUT_LINE(l_log_handle,trans_date
UTL_FILE.PUT_LINE(l_log_handle,reason code
UTL_FILE.PUT_LINE(l_log_handle,user name
= ||
=
=
=
=
=
||trans_rec.item_um);
||trans_rec.item_um2);
||trans_rec.lot_no);
||trans_rec.sublot_no);
||
= ||
=
=
=
=
=
=
=
=
=
||trans_rec.trans_qty);
||trans_rec.trans_qty2);
||trans_rec.qc_grade);
||trans_rec.lot_status);
||trans_rec.co_code);
||trans_rec.orgn_code);
||trans_rec.trans_date);
||trans_rec.reason_code);
||trans_rec.user_name );
FND_MSG_PUB.Get(
p_msg_index
p_data
p_encoded
p_msg_index_out
=>
=>
=>
=>
l_loop_cnt,
l_data,
FND_API.G_FALSE,
l_dummy_cnt);
7-12
7-14
ELSE
l_start
:=INSTR(p_line,p_delimiter,1,(p_field_no - 1));
IF l_start
= 0
THEN
RETURN NULL;
END IF;
END IF;
-- Determine end position
l_end
:=INSTR(p_line,p_delimiter,1,p_field_no);
IF l_end
= 0
THEN
l_end
:= LENGTH(p_line) + 1;
END IF;
-- Extract the field data
IF (l_end - l_start) = 1
THEN
RETURN NULL;
ELSE
RETURN SUBSTR(p_line,(l_start + 1),((l_end - l_start) - 1));
END IF;
EXCEPTION
WHEN OTHERS
THEN
RETURN NULL;
END Get_Field;
--+==========================================================================+
--| FUNCTION NAME
|
--|
Get_Substring
|
--|
|
--| TYPE
|
--|
Public
|
--|
|
--| USAGE
|
--|
Get value of Sub-string from formatted ASCII data file record
|
--|
|
--| DESCRIPTION
|
--|
This utility function will return the value of a passed sub-string
|
--|
of a formatted ASCII data file record
|
--|
|
--| PARAMETERS
|
--|
p_substring
IN VARCHAR2
- substring data
|
--|
|
--| RETURNS
|
--|
VARCHAR2
- Value of field
|
--|
|
--| HISTORY
|
--|
|
--+==========================================================================+
-- Api end of comments
FUNCTION Get_Substring
( p_substring
IN VARCHAR2
)
RETURN VARCHAR2
IS
--- Local variables
-l_string_value VARCHAR2(200) := ;
BEGIN
-- Determine start position
l_string_value :=NVL(RTRIM(LTRIM(p_substring)), );
RETURN l_string_value;
EXCEPTION
WHEN OTHERS
THEN
RETURN ;
END Get_Substring;
END GMI_QUANTITY_WRP;
/
commit;
exit;
7-16
8
Lot Create API
This topic provides the business function, technical overview and parameters for
the Lot Create API. Also included are table and view usage, package and procedure
names, special logic and error messages.
The following topics are covered:
8-1
This topic describes how the stored procedure should be called, the parameters that
are required (and optional) and the values that are returned to the calling program.
This includes all error conditions that may arise.
The procedure is intended as a create function only, used primarily to load item lot
data from legacy systems on implementation. The Lot Create API does not allow
Lot Update, or Delete.
GMIPAPI.Create_Lot
( p_api_version
, p_init_msg_list
, p_commit
, p_validation_level
, p_lot_rec
, x_ic_lots_mst_rec
, x_ic_lots_cpg_rec
, x_return_status
, x_msg_count
, x_msg_data
);
8-2
IN
IN
IN
IN
IN
OUT
OUT
OUT
OUT
OUT
NUMBER
VARCHAR2 := FND_API.G_FALSE
VARCHAR2 := FND_API.G_FALSE
NUMBER := FND_API.G_VALID_LEVEL_FULL
GMIGAPI.lot_rec_typ
ic_lots_mst%ROWTYPE
ic_lots_cpg%ROWTYPE
VARCHAR2
NUMBER
VARCHAR2
The first 4, and last 3 parameters are standard across all of the API calls and are
identical to the Create Item API where they are fully documented. If the lot creation
is successful, x_ic_lots_mst_row and x_ic_lots_cpg_row parameters are returned
with the data set up in the two tables, regardless of whether it was committed by
the procedure.
If the SY$CPG_INSTALL flag is set to zero the contents of the row returned in x_ic_
lots_cpg are undefined and nothing is written to the ic_lots_cpg table.
The group version is as follows:
GMIGAPI.Create_Lot
( p_api_version
, p_init_msg_list
, p_commit
, p_validation_level
, p_lot_rec
, p_ic_item_mst_row
, p_ic_item_cpg_row
, x_ic_lots_mst_rec
, x_ic_lots_cpg_rec
, x_return_status
, x_msg_count
, x_msg_data
);
IN
IN
IN
IN
IN
IN
IN
OUT
OUT
OUT
OUT
OUT
NUMBER
VARCHAR2 := FND_API.G_FALSE
VARCHAR2 := FND_API.G_FALSE
NUMBER := FND_API.G_VALID_LEVEL_FULL
GMIGAPI.lot_rec_typ
ic_item_mst%ROWTYPE
ic_item_cpg%ROWTYPE
ic_lots_mst%ROWTYPE
ic_lots_cpg%ROWTYPE
VARCHAR2
NUMBER
VARCHAR2
This procedure takes two additional parameters compared to the P variant for use
when item data is already known. If this is the case then p_ic_item_mst_row and p_
ic_item_mst_cpg should be passed with the appropriate data. This can be found by
calling the GMIGUTL.Get_Item procedure. All other IN and OUT parameters are
identical to the public API, and the SY$CPG_INSTALL flag are treated in the same
way.
The p_lot_rec parameter is used to pass the lot-specific data required to create a lot
for an inventory item. It is described below. Please refer to the Lot Create API
Wrapper topic for an example of how to populate this parameter and call the stored
procedure.
8-3
Field/Column
Type
Length
item_no
varchar2
32
Default
Reqd
Validation
lot_no
varchar2
32
Non-blank
sublot_no
varchar2
32
Must be blank if
ic_item_mst,
sublot_ctl = 0
The item_
no/lot_
no/sublot_no
must not already
exist on ic_lots_
mst
lot_desc
varchar2
40
qc_grade
varchar2
N
ic_item_mst.qc_ N
grade
Must be blank if
ic_item_
mst.grade_ctl = 0
Must not be
blank if ic_item_
mst.grade_ctl = 1
Must exist on qc_
grad_mst if
non-blank
expaction_code
8-4
varchar2
ic_item_
mst.expaction_
code
Field/Column
Type
expaction_date
date
Length
Default
Reqd
Validation
IF ic_item_
mst.grade_ctl =
1AND ic_item_
mst.expaction_
interval > 0
THEN expire_
date + ic_item_
mst.expaction_
interval ELSE
31-Dec-2010
00:00:00
(SY$MAX_
DATE)
lot_created
date
System Date
expire_date
date
IF ic_item_
mst.grade_ctl =
1AND ic_item_
mst.shelf_life >
0 THEN lot_
created + ic_
item_mst.shelf_
life ELSE
Must be zero or
positive value
31-Dec-2010
00:00:00
(SY$MAX_
DATE)
retest_date
date
IF ic_item_
mst.grade_ctl =
1AND ic_item_
mst.retest_
interval > 0
THEN lot_
created + ic_
item_
mst.retest_
interval ELSE
31-Dec-2010
00:00:00
(SY$MAX_
DATE)
strength
number
100
8-5
8-6
Field/Column
Type
Length
Default
Reqd
Validation
inactive_ind
number
Must be 0 or 1
origination_
type
number
shipvendor_no
varchar2
32
Must exist on
po_vend_mst if
non-blank
vendor_lot_no
varchar2
32
ic_matr_date
date
lot_created +
ic_item_mst.ic_
matr_days
ic_hold_date
date
lot_created +
ic_item_mst.ic_
hold_days
attribute1
varchar2
240
Descriptive
flexfield segment
attribute2
varchar2
240
Descriptive
flexfield segment
attribute3
varchar2
240
Descriptive
flexfield segment
attribute4
varchar2
240
Descriptive
flexfield segment
attribute5
varchar2
240
Descriptive
flexfield segment
attribute6
varchar2
240
Descriptive
flexfield segment
attribute7
varchar2
240
Descriptive
flexfield segment
attribute8
varchar2
240
Descriptive
flexfield segment
Field/Column
Type
Length
attribute9
varchar2
attribute10
Default
Reqd
Validation
240
Descriptive
flexfield segment
varchar2
240
Descriptive
flexfield segment
attribute11
varchar2
240
Descriptive
flexfield segment
attribute12
varchar2
240
Descriptive
flexfield segment
attribute13
varchar2
240
Descriptive
flexfield segment
attribute14
varchar2
240
Descriptive
flexfield segment
attribute15
varchar2
240
Descriptive
flexfield segment
attribute16
varchar2
240
Descriptive
flexfield segment
attribute17
varchar2
240
Descriptive
flexfield segment
attribute18
varchar2
240
Descriptive
flexfield segment
attribute19
varchar2
240
Descriptive
flexfield segment
attribute20
varchar2
240
Descriptive
flexfield segment
attribute21
varchar2
240
Descriptive
flexfield segment
attribute22
varchar2
240
Descriptive
flexfield segment
attribute23
varchar2
240
Descriptive
flexfield segment
attribute24
varchar2
240
Descriptive
flexfield segment
attribute25
varchar2
240
Descriptive
flexfield segment
8-7
8-8
Field/Column
Type
Length
attribute26
varchar2
attribute27
Default
Reqd
Validation
240
Descriptive
flexfield segment
varchar2
240
Descriptive
flexfield segment
attribute28
varchar2
240
Descriptive
flexfield segment
attribute29
varchar2
240
Descriptive
flexfield segment
attribute30
varchar2
240
Descriptive
flexfield segment
attribute_
category
varchar2
30
Descriptive
flexfield
structure
definition
user_name
varchar2
100
Ignored but
retained for
backward
compatibility
OPM
Select
ic_item_mst
sy_type_mst
qc_grad_mst
po_vend_mst
qc_actn_mst
ic_item_cpg
ic_lots_mst
ic_lots_cpg
Insert
Update
Delete
Base Table
X
X
ic_lots_sts
sy_oper_mst
The Item Master table IC_ITEM_MST holds all attributes of the item.
Lot controlled and QC attributes are prompted for in the maintenance form once
the appropriate indicators are set. These details are also held against the item.
Whether an item is defined as lot controlled or not the system always generates a
DEFAULT lot against the item on IC_LOTS_MST.
All lots hold additional attributes for Consumer Packaged Goods (CPG) specific
processing. These are held against IC_LOTS_CPG.
When an item is identified as dual UOM and the alternate UOM is of a different
type (for example, an item is defined in type WEIGHT with dual UOM in
VOLUME) saving the item master prompts you for the conversion factor between
WEIGHT and VOLUME for the item. This mechanism and structure supports
transactional processing of the item in any supported UOM. This is handled outside
of the Item Create procedure through an additional function.
8-9
Additional text can be maintained against the item to hold free format information
on IC_TEXT_TBL. This is handled outside of the Item Create procedure through an
additional function.
The stored procedure which is called to create a new item lot is:
Create_Lot
Please refer to the Lot Create API Wrapper topic for an example of how the
previous procedure is executed.
2.
8-10
set lot_id = 0
Column Name
Value
item_id
ic_item_mst.item_id
lot_id
shipvend_id
po_vend_mst.vend_id
date_added
system date
Column Name
Value
date_modified
System date
added_by
p_lot_rec.op_code
modified_by
p_lot_rec.op_code
trans_cnt
delete_mark
text_code
3.
Column Name
Value
item_id
ic_item_mst.item_id
lot_id
ic_matr_date
ic_hold_date
created_by
creation_date
System date
last_updated_by
last_update_date
System date
last_update_login
login id
8-12
Message Code
Narrative
IC_API_INVALID_ITEM
IC_API_ITEM_NOT_LOT_CTL
IC_API_SUBLOT_NOT_REQD
IC_API_LOT_ALREADY_EXISTS
IC_API_INVALID_LOT_QC_GRADE
IC_API_INVALID_LOT_EXPACTION_CODE
IC_API_INVALID_EXPACTION_DATE_API
IC_API_INVALID_EXPIRE_DATE
IC_API_INVALID_RETEST_DATE
IC_API_INVALID_LOT_STRENGTH
IC_API_INVALID_LOT_INACTIVE_IND
IC_API_INVALID_LOT_ORIGINATION_
TYPE
IC_API_INVALID_LOT_SHIPVENDOR_NO
IC_API_INVALID_LOT_MATR_DAYS
Message Code
Narrative
IC_API_INVALID_LOT_HOLD_DAYS
SY_API_UNABLE_TO_GET_SURROGATE
8-14
9
Lot Create API Wrapper
This topic provides the business function and ASCII flat file layout for the lot create
API wrapper. Also included are package and procedure names, special logic and
error messages. A code example is included.
The following topics are covered:
This topic describes how the wrapper function should be called and the parameters
that are required (and optional).
Type
Length
Required
lot number
alphanumeric
32
sublot number
alphanumeric
32
lot description
alphanumeric
40
p_init_msg_list
alphanumeric
alphanumeric
date (DDMMYYYY)
date (DDMMYYYY)
date (DDMMYYYY)
9-2
Field/Column
Type
Length
Required
retest date
date (DDMMYYYY)
strength
number
16
inactive indicator
number
origination type
number
user class1
alphanumeric
16
user class2
alphanumeric
16
user class3
alphanumeric
16
user class4
alphanumeric
16
user class5
alphanumeric
16
user class6
alphanumeric
16
alphanumeric
32
alphanumeric
32
date (DDMMYYYY)
date (DDMMYYYY)
operator code
alphanumeric
Ignored
GMI_LOTS_WRP
Create_Lot
On initial entry to the wrapper the return status will be set to success (S).
If for any record processed an expected error occurs and the return status is
currently set to success then it will be updated to expected error (E).
If for any record processed and unexpected error occurs, then the return status
is set to unexpected error (U).
Update Logic
Updates are only be concerned with the processing of messages (errors and others)
generated by the Lot Create API.
Messages (success and error) are written to a flat file as designated by the p_
output_file parameter. Additionally a log file are written to the /tmp directory. This
details start and completion times, data retrieved from the ASCII flat file and
messages generated.
9-4
Narrative
UTL_FILE.INVALID_OPERATION
UTL_FILE.INVALID_PATH
UTL_FILE.INVALID_MODE
UTL_FILE.INVALID_FILEHANDLE
UTL_FILE.WRITE_ERROR
UTL_FILE.READ_ERROR
UTL_FILE.INTERNAL_ERROR
Internal Error
9-6
BEGIN
l_return_status :=Create_Lot( p_dir
, p_input_file
, p_output_file
, p_delimiter
);
End Create_Lot;
--+==========================================================================+
--| FUNCTION NAME
|
--|
Create_Lot
|
--|
|
--| TYPE
|
--|
Public
|
--|
|
--| USAGE
|
--|
Create a Lot/Sublot
|
--|
|
--| DESCRIPTION
|
--|
This is a PL/SQL wrapper function to call the OPM Lot/Sublot Create |
--|
API
|
--|
It reads item data from a flat file and outputs any error
|
--|
messages to a second flat file. It also generates a Status
|
--|
called wrapper<session_id>.log in the /tmp directory.
|
--|
|
--| PARAMETERS
|
--|
p_dir
IN VARCHAR2
- Working directory for input |
--|
and output files.
|
--|
p_input_file
IN VARCHAR2
- Name of input file
|
--|
p_output_file
IN VARCHAR2
- Name of output file
|
--|
p_delimiter
IN VARCHAR2
- Delimiter character
|
--|
|
--| RETURNS
|
--|
VARCHAR2 - S All records processed successfully
|
--|
E 1 or more records errored
|
--|
U 1 or more record unexpected error
|
--|
|
--| HISTORY
|
--|
|
--+==========================================================================+
-- Api end of comments
FUNCTION Create_Lot
( p_dir
IN VARCHAR2
, p_input_file IN VARCHAR2
, p_output_file IN VARCHAR2
, p_delimiter
IN VARCHAR2
)
RETURN VARCHAR2
IS
--- Local variables
-l_status
l_return_status
l_count
l_loop_cnt
l_dummy_cnt
l_record_count
l_data
lot_rec
l_p_dir
l_output_file
l_outfile_handle
l_input_file
l_infile_handle
l_line
l_delimiter
l_log_dir
l_log_name
l_log_handle
l_global_file
VARCHAR2(1);
VARCHAR2(1) :=FND_API.G_RET_STS_SUCCESS;
NUMBER ;
NUMBER :=0;
NUMBER :=0;
NUMBER :=0;
VARCHAR2(2000);
GMIGAPI.lot_rec_typ;
VARCHAR2(50);
VARCHAR2(20);
UTL_FILE.FILE_TYPE;
VARCHAR2(20);
UTL_FILE.FILE_TYPE;
VARCHAR2(200);
VARCHAR(1);
VARCHAR2(50);
VARCHAR2(20) :=wrapper;
UTL_FILE.FILE_TYPE;
VARCHAR2(20);
l_session_id
l_ic_lots_mst_row
l_ic_lots_cpg_row
BEGIN
VARCHAR2(10);
ic_lots_mst%ROWTYPE;
ic_lots_cpg%ROWTYPE;
9-8
:=p_dir;
:=p_input_file;
:=p_output_file;
:=p_delimiter;
:=l_input_file;
--- Loop thru flat file and call Inventory Quantities API
-dbms_output.put_line(Start Processing);
UTL_FILE.PUT_LINE(l_log_handle, Process Started at
|| to_char(SYSDATE,DD-MON-YY HH:MI:SS));
UTL_FILE.NEW_LINE(l_log_handle);
UTL_FILE.PUT_LINE(l_log_handle, Input Directory
UTL_FILE.PUT_LINE(l_log_handle, Input File
UTL_FILE.PUT_LINE(l_log_handle, Record Type
UTL_FILE.PUT_LINE(l_log_handle, Output File
||
||
||
||
l_p_dir );
l_input_file );
l_delimiter );
l_output_file );
:=l_record_count+1;
BEGIN
UTL_FILE.GET_LINE(l_infile_handle, l_line);
EXCEPTION
WHEN NO_DATA_FOUND THEN
EXIT;
END;
UTL_FILE.NEW_LINE(l_log_handle);
UTL_FILE.PUT_LINE(l_log_handle, Reading Record || l_record_count );
lot_rec.item_no
:=Get_Field(l_line,l_delimiter,1);
lot_rec.lot_no
:=Get_Field(l_line,l_delimiter,2);
lot_rec.sublot_no
:=Get_Field(l_line,l_delimiter,3);
lot_rec.lot_desc
:=Get_Field(l_line,l_delimiter,4);
lot_rec.qc_grade
:=Get_Field(l_line,l_delimiter,5);
lot_rec.expaction_code :=Get_Field(l_line,l_delimiter,6);
IF (Get_Field(l_line,l_delimiter,7) IS NULL)
THEN
lot_rec.expaction_date :=GMA_GLOBAL_GRP.SY$MAX_DATE;
ELSE
lot_rec.expaction_date :=TO_DATE(
Get_Field(l_line,l_delimiter,7),DDMMYYYY);
END IF;
IF (Get_Field(l_line,l_delimiter,8) IS NULL)
THEN
lot_rec.lot_created :=SYSDATE;
ELSE
lot_rec.lot_created :=TO_DATE(
Get_Field(l_line,l_delimiter,8),DDMMYYYY);
END IF;
IF (Get_Field(l_line,l_delimiter,9) IS NULL)
THEN
lot_rec.expire_date :=GMA_GLOBAL_GRP.SY$MAX_DATE;
ELSE
lot_rec.expire_date :=TO_DATE(
Get_Field(l_line,l_delimiter,9),DDMMYYYY);
END IF;
IF (Get_Field(l_line,l_delimiter,10) IS NULL)
THEN
lot_rec.retest_date :=GMA_GLOBAL_GRP.SY$MAX_DATE;
ELSE
lot_rec.retest_date :=TO_DATE(
Get_Field(l_line,l_delimiter,10),DDMMYYYY);
END IF;
IF (Get_Field(l_line,l_delimiter,11) IS NULL)
THEN
lot_rec.strength
:=100;
ELSE
lot_rec.strength
:=TO_NUMBER(Get_Field(l_line,l_delimiter,11));
END IF;
IF (Get_Field(l_line,l_delimiter,12) IS NULL)
9-10
THEN
lot_rec.origination_type
:=0;
ELSE
lot_rec.origination_type
:=TO_NUMBER(Get_Field(l_line,l_delimiter,12));
END IF;
lot_rec.shipvendor_no :=Get_Field(l_line,l_delimiter,13);
lot_rec.vendor_lot_no :=Get_Field(l_line,l_delimiter,14);
IF (Get_Field(l_line,l_delimiter,15) IS NULL)
THEN
lot_rec.ic_matr_date :=GMA_GLOBAL_GRP.SY$MAX_DATE;
ELSE
lot_rec.ic_matr_date :=TO_DATE(
Get_Field(l_line,l_delimiter,15),DDMMYYYY);
END IF;
IF (Get_Field(l_line,l_delimiter,16) IS NULL)
THEN
lot_rec.ic_hold_date :=GMA_GLOBAL_GRP.SY$MAX_DATE;
ELSE
lot_rec.ic_hold_date :=TO_DATE(
Get_Field(l_line,l_delimiter,16),DDMMYYYY);
END IF;
IF (Get_Field(l_line,l_delimiter,17) IS NULL)
THEN
lot_rec.user_name
:=OPM;
ELSE
lot_rec.user_name
:=Get_Field(l_line,l_delimiter,17);
END IF;
lot_rec.attribute1
:=Get_Field(l_line,l_delimiter,18);
lot_rec.attribute2
:=Get_Field(l_line,l_delimiter,19);
lot_rec.attribute3
:=Get_Field(l_line,l_delimiter,20);
lot_rec.attribute4
:=Get_Field(l_line,l_delimiter,21);
lot_rec.attribute5
:=Get_Field(l_line,l_delimiter,22);
lot_rec.attribute6
:=Get_Field(l_line,l_delimiter,23);
lot_rec.attribute7
:=Get_Field(l_line,l_delimiter,24);
lot_rec.attribute8
:=Get_Field(l_line,l_delimiter,25);
lot_rec.attribute9
:=Get_Field(l_line,l_delimiter,26);
lot_rec.attribute10
:=Get_Field(l_line,l_delimiter,27);
lot_rec.attribute11
:=Get_Field(l_line,l_delimiter,28);
lot_rec.attribute12
:=Get_Field(l_line,l_delimiter,29);
lot_rec.attribute13
:=Get_Field(l_line,l_delimiter,30);
lot_rec.attribute14
:=Get_Field(l_line,l_delimiter,31);
lot_rec.attribute15
:=Get_Field(l_line,l_delimiter,32);
lot_rec.attribute16
:=Get_Field(l_line,l_delimiter,33);
lot_rec.attribute17
:=Get_Field(l_line,l_delimiter,34);
lot_rec.attribute18
:=Get_Field(l_line,l_delimiter,35);
lot_rec.attribute19
:=Get_Field(l_line,l_delimiter,36);
lot_rec.attribute20
:=Get_Field(l_line,l_delimiter,37);
lot_rec.attribute21
:=Get_Field(l_line,l_delimiter,38);
lot_rec.attribute22
:=Get_Field(l_line,l_delimiter,39);
lot_rec.attribute23
:=Get_Field(l_line,l_delimiter,40);
lot_rec.attribute24
:=Get_Field(l_line,l_delimiter,41);
lot_rec.attribute25
:=Get_Field(l_line,l_delimiter,42);
lot_rec.attribute26
:=Get_Field(l_line,l_delimiter,43);
lot_rec.attribute27
:=Get_Field(l_line,l_delimiter,44);
lot_rec.attribute28
:=Get_Field(l_line,l_delimiter,45);
lot_rec.attribute29
:=Get_Field(l_line,l_delimiter,46);
lot_rec.attribute30
:=Get_Field(l_line,l_delimiter,47);
lot_rec.attribute_category :=Get_Field(l_line,l_delimiter,48);
UTL_FILE.PUT_LINE(l_log_handle,item no
= ||lot_rec.item_no);
UTL_FILE.PUT_LINE(l_log_handle,lot_no
= ||lot_rec.lot_no);
UTL_FILE.PUT_LINE(l_log_handle,sublot_no
= ||lot_rec.sublot_no);
UTL_FILE.PUT_LINE(l_log_handle,lot_desc
= ||lot_rec.lot_desc);
UTL_FILE.PUT_LINE(l_log_handle,qc_grade
= ||lot_rec.qc_grade);
UTL_FILE.PUT_LINE(l_log_handle,expaction_code = ||
lot_rec.expaction_code);
UTL_FILE.PUT_LINE(l_log_handle,expaction_date = ||
lot_rec.expaction_date);
UTL_FILE.PUT_LINE(l_log_handle,lot_created
= ||
lot_rec.lot_created);
UTL_FILE.PUT_LINE(l_log_handle,expire_date
= ||
lot_rec.expire_date);
UTL_FILE.PUT_LINE(l_log_handle,retest_date
= ||
lot_rec.retest_date);
UTL_FILE.PUT_LINE(l_log_handle,strength
= ||lot_rec.strength);
UTL_FILE.PUT_LINE(l_log_handle,origination_type= ||
lot_rec.origination_type);
UTL_FILE.PUT_LINE(l_log_handle,shipvendor_no = ||lot_rec.shipvendor_no);
UTL_FILE.PUT_LINE(l_log_handle,vendor_lot_no = ||lot_rec.vendor_lot_no);
UTL_FILE.PUT_LINE(l_log_handle,ic_matr_date = ||lot_rec.ic_matr_date);
UTL_FILE.PUT_LINE(l_log_handle,ic_hold_date = ||lot_rec.ic_hold_date);
UTL_FILE.PUT_LINE(l_log_handle,user name
= ||lot_rec.user_name );
UTL_FILE.PUT_LINE(l_log_handle,Attribute1
= ||
lot_rec.attribute1 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute2
= ||
lot_rec.attribute2 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute3
= ||
lot_rec.attribute3 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute4
= ||
lot_rec.attribute4 );
9-12
UTL_FILE.PUT_LINE(l_log_handle,Attribute5
lot_rec.attribute5 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute6
lot_rec.attribute6 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute7
lot_rec.attribute7 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute8
lot_rec.attribute8 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute9
lot_rec.attribute9 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute10
lot_rec.attribute10 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute11
lot_rec.attribute11 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute12
lot_rec.attribute12 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute13
lot_rec.attribute13 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute14
lot_rec.attribute14 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute15
lot_rec.attribute15 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute16
lot_rec.attribute16 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute17
lot_rec.attribute17 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute18
lot_rec.attribute18 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute19
lot_rec.attribute19 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute20
lot_rec.attribute20 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute21
lot_rec.attribute21 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute22
lot_rec.attribute22 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute23
lot_rec.attribute23 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute24
lot_rec.attribute24 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute25
lot_rec.attribute25 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute26
lot_rec.attribute26 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute27
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
= ||
lot_rec.attribute27 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute28
= ||
lot_rec.attribute28 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute29
= ||
lot_rec.attribute29 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute30
= ||
lot_rec.attribute30 );
UTL_FILE.PUT_LINE(l_log_handle,Attribute_Category = ||
lot_rec.attribute_category );
GMIPAPI.Create_Lot
( p_api_version
=> 3.0
, p_init_msg_list => FND_API.G_TRUE
, p_commit
=> FND_API.G_TRUE
, p_validation_level => FND_API.G_VALID_LEVEL_FULL
, p_lot_rec
=>lot_rec
, x_ic_lots_mst_row => l_ic_lots_mst_row
, x_ic_lots_cpg_row => l_ic_lots_cpg_row
, x_return_status =>l_status
, x_msg_count
=>l_count
, x_msg_data
=>l_data
);
IF l_count > 0
THEN
l_loop_cnt :=1;
LOOP
FND_MSG_PUB.Get(
p_msg_index
p_data
p_encoded
p_msg_index_out
=>
=>
=>
=>
l_loop_cnt,
l_data,
FND_API.G_FALSE,
l_dummy_cnt);
-- dbms_output.put_line(Message || l_data );
UTL_FILE.PUT_LINE(l_outfile_handle, Record = ||l_record_count );
UTL_FILE.PUT_LINE(l_outfile_handle, l_data);
UTL_FILE.NEW_LINE(l_outfile_handle);
IF l_status = E OR
l_status = U
THEN
l_data
:= CONCAT(ERROR ,l_data);
END IF;
9-14
UTL_FILE.PUT_LINE(l_log_handle, l_data);
-- Update error status
IF (l_status = U)
THEN
l_return_status :=l_status;
ELSIF (l_status = E and l_return_status <> U)
THEN
l_return_status :=l_status;
ELSE
l_return_status :=l_status;
END IF;
l_loop_cnt := l_loop_cnt + 1;
IF l_loop_cnt > l_count
THEN
EXIT;
END IF;
END LOOP;
END IF;
END LOOP;
UTL_FILE.NEW_LINE(l_log_handle);
UTL_FILE.PUT_LINE(l_log_handle, Process Completed at
|| to_char(SYSDATE,DD-MON-YY HH:MI:SS));
--- Check if any messages generated. If so then decode and
-- output to error message flat file
-UTL_FILE.FCLOSE_ALL;
RETURN l_return_status;
EXCEPTION
WHEN UTL_FILE.INVALID_OPERATION THEN
dbms_output.put_line(Invalid Operation For || l_global_file);
UTL_FILE.FCLOSE_ALL;
WHEN UTL_FILE.INVALID_PATH THEN
dbms_output.put_line(Invalid Path For
UTL_FILE.FCLOSE_ALL;
|| l_global_file);
|| l_global_file);
|| l_global_file);
|| l_global_file);
|| l_global_file);
9-16
--|
returned
|
--|
|
--| RETURNS
|
--|
VARCHAR2
- Value of field
|
--|
|
--| HISTORY
|
--|
|
--+==========================================================================+
-- Api end of comments
FUNCTION Get_Field
( p_line
IN VARCHAR2
, p_delimiter
IN VARCHAR2
, p_field_no
IN NUMBER
)
RETURN VARCHAR2
IS
--- Local variables
-l_start
NUMBER :=0;
l_end
NUMBER :=0;
BEGIN
-- Determine start position
IF p_field_no = 1
THEN
l_start
:=0;
ELSE
l_start
:=INSTR(p_line,p_delimiter,1,(p_field_no - 1));
IF l_start
= 0
THEN
RETURN NULL;
END IF;
END IF;
-- Determine end position
l_end
:=INSTR(p_line,p_delimiter,1,p_field_no);
IF l_end
= 0
THEN
l_end
:= LENGTH(p_line) + 1;
END IF;
-- Extract the field data
IF (l_end - l_start) = 1
THEN
RETURN NULL;
ELSE
RETURN SUBSTR(p_line,(l_start + 1),((l_end - l_start) - 1));
END IF;
EXCEPTION
WHEN OTHERS
THEN
RETURN NULL;
END Get_Field;
--+==========================================================================+
--| FUNCTION NAME
|
--|
Get_Substring
|
--|
|
--| TYPE
|
--|
Public
|
--|
|
--| USAGE
|
--|
Get value of Sub-string from formatted ASCII data file record
|
--|
|
--| DESCRIPTION
|
--|
This utility function will return the value of a passed sub-string
|
--|
of a formatted ASCII data file record
|
--|
|
--| PARAMETERS
|
--|
p_substring
IN VARCHAR2
- substring data
|
--|
|
--| RETURNS
|
--|
VARCHAR2
- Value of field
|
--|
|
--| HISTORY
|
--|
|
--+==========================================================================+
-- Api end of comments
FUNCTION Get_Substring
( p_substring
IN VARCHAR2
)
RETURN VARCHAR2
IS
--- Local variables
--
9-18
l_string_value
VARCHAR2(200) := ;
BEGIN
-- Determine start position
l_string_value :=NVL(RTRIM(LTRIM(p_substring)), );
RETURN l_string_value;
EXCEPTION
WHEN OTHERS
THEN
RETURN ;
END Get_Substring;
END GMI_LOTS_WRP;
/
commit;
exit;
9-20
Index
A
ABC code, 3-4
action code, lot expiry, 3-4
Add utility function, 1-16
added_by, 8-11
ADJI, 6-10, 6-13
adjust inventory, 6-2
adjusting inventory, table, 6-10
adjustments, 6-8
AFASMSGS.pls, 1-16
alloc_class, 2-9
allocation class, 3-4
allowable deviation, factor, 3-3
alt_itema, 2-5
alt_itemb, 2-5
alternate UOM, 8-9
alternative name for item, 3-3
API
architecture, 1-4, 1-5
mechanism, 1-4
package details, 1-4
structure, 1-4
API architecture, 1-5
API message utility routines, 1-16
API, definition, 1-2
API_VERSION, 1-20
application code calls, 1-6
application program interfaces, 1-2
architecture, API, 1-4
architecture, layered, 1-6
ASCII flat file, 3-2, 3-3, 3-7, 3-8, 5-2, 7-2, 9-2
ASCII flat file layout, 5-3
asynchronous mode, 3-2
B
between-layer calls, 1-5
block relationship diagram, API, 1-8
block relationship diagram, item master,
bulk id, 3-4
bulk_id, 2-10
business characteristics, API, 1-8
1-4
C
c_item_mst.grade_ctl, 8-5
callable API routines, external, 1-21
calling program, 1-2, 1-3
calling wrapper interrogation, 1-12
calls, between layers, 1-5
calls, from application code, 1-6
calls, permitted between layers, 1-5
change lot status, 6-2, 6-8
changing lot status transactions, 6-15
changing quality control grade, 6-2, 6-15
character delimited, 3-3
co_code, 6-5, 6-6, 6-11, 6-12
code calls, from the application, 1-6
code example, 3-9, 5-5, 7-6, 9-6
commit, 1-12
commodity code, 3-5
commodity_code, 2-11
Index-1
D
D_USER.USER_ID, 2-18
data from legacy systems, 8-2
database layer, 1-21
database tables, 1-3, 1-12
date, system, 2-19
date_added, 8-10
date_modified, 8-11
decoding and handling messages, 1-3
decoding messages, 1-3
default lot, 1-8, 1-9
default lot status, 3-4
default quality control grade, 3-4
DEFAULT_LOGIN, 1-21
DEFAULT_USER_ID, 1-20
definition, API, 1-2
Delete utility function, 1-16
delete_mark, 2-17, 4-8, 6-10, 8-11
dependencies and syntax, procedural, 1-11
descriptive flexfield segment, 2-11, 2-17, 2-19
Index-2
deviation_hi, 2-6
deviation_lo, 2-6
doc_date, 6-11
doc_id, 6-10, 6-12
doc_line, 6-10, 6-11, 6-13
doc_type, 6-9, 6-13
document type, JRNL, 6-9
dual unit of measure, 6-8
dual unit of measure indicator, 3-3
dual UOM, 2-5, 2-15, 6-7, 6-8, 8-9
dualum_ind, 2-5
E
encode format, for message storage, 1-16
ERP, 1-2
error messages, 1-16, 2-22, 6-17, 7-5, 9-5
errors, 2-22
event_id, 6-13
executing a stored procedure, 1-12, 1-13
expaction_code, 2-10, 2-19, 8-4
expaction_date, 2-19, 8-5
expaction_interval, 2-10
experimental item indicator, 3-5
experimental_ind, 2-10
expire_date, 2-19, 8-5
expiry action code, 9-2
expiry action date, 9-2
expiry action interval, 3-5
export to Oracle financials date, 3-5
exported_date, 2-10
F
file type, nomenclature, 1-7
file type, .pls, 1-7
fill qty, 3-4
fill um, 3-5
fill_qty, 2-10
fill_um, 2-10
Financials (Oracle), date exported to,
First, (API) mode, 1-17
flat file, 1-11
flat file, layout, 5-3
flexfields, descriptive, 2-17
3-5
G
GEM5_ITEM_ID_S, 2-17
gem5_line_id_s, 6-10
gem5_lot_id_s, 8-10
gem5_trans_id_s, 6-12
GET MESSAGES, 1-12
Get utility function, 1-16
gl class, 3-4
gl_class, 2-8
gl_posted_ind, 6-13
GMI
Allow Negative Inventory, 6-9
Default Lot, 2-18, 6-5, 8-10
Intrastat, 2-11
Move Different Status, 6-9
GMI_ITEM_LOT_CONV_WRP, 5-4
GMI_ITEM_WRP, 3-7
GMI_LOTS_PUB.Create_Lot, 2-18
GMI_LOTS_WRP, 9-3
GMI_QUANTITY_WRP, 7-4
GMIGAPI, 1-6
GMIGAPI.Create_Item_Lot_Conv, 4-3
GMIGAPI.Create_Lot, 8-3
GMIGUTL, 1-6
GMIGUTL.Get Reason, 1-20
GMIGUTL.Get_Item, 1-20, 4-4, 8-3
GMIGUTL.Get_Lot, 1-20, 4-4
GMIGUTL.Setup, 1-20
GMIGUTL.setup, 2-17
GMIPAPI, 1-6, 2-16, 4-7, 6-8, 8-10
GMIPAPI.Create_Item_Lot_Conv, 4-3
GMIPAPI.Create_Lot, 8-2
GMIPAPI.Inventory_Posting, 6-3
GMIPILW, 1-7
GMIPITW, 1-7
GMIPLOW, 1-7
GMIPQTW, 1-7
GMIPTXN, 1-7
GMIPXFW, 1-7
GMIVBUL, 1-7
GMIVBUS, 1-7
GMIVCMP, 1-7
GMIVDBL, 1-6
GMIVILC, 1-6
GMIVITM, 1-6
GMIVLOC, 1-7
GMIVLOT, 1-6
GMIVPND, 1-7
GMIVQTY, 1-6
GMIVSUM, 1-7
GMIVTXN, 1-7
GMIVXFR, 1-6
grade, 6-10
grade change transactions, 6-8
grade, quality control, changing, 6-15
grade_ctl, 2-9
GRDI, 6-10
group layer, 1-5, 1-21
H
handling
Index-3
errors, 1-16
messages, 1-3
result messages,
1-16
I
IC$ALLOW_INACTIVE, 6-4, 6-9
IC$ALLOWNEGINV, 1-20
IC$API_ALLOW_INACTIVE, 1-20
IC$DEFAULT_LOCT, 1-20
IC$DEFAULT_LOT, 1-20
IC$MOVEDIFFSTAT, 1-20
ic_adjs_jnl, 6-7
ic_allc_cls, 2-14
IC_API_ILC_CREATED, 4-10
IC_API_INVALID_ABCCODE, 2-22
IC_API_INVALID_ALLOC_CLASS, 2-23
IC_API_INVALID_COMMODITY_CODE, 2-23
IC_API_INVALID_CUSTOMS_CLASS, 2-23
IC_API_INVALID_DEVIATION, 2-22
IC_API_INVALID_DUALUM_IND, 2-22
IC_API_INVALID_EXPACTION_CODE, 2-23
IC_API_INVALID_EXPACTION_DATE_API, 8-12
IC_API_INVALID_EXPERIMENTAL_IND, 2-23
IC_API_INVALID_EXPIRE_DATE, 8-12
IC_API_INVALID_FRT_CLASS, 2-23
IC_API_INVALID_GL_CLASS, 2-22
IC_API_INVALID_GRADE_CTL, 2-23
IC_API_INVALID_HOLD_DAYS, 2-24
IC_API_INVALID_INACTIVE_IND, 2-22
IC_API_INVALID_INV_CLASS, 2-22
IC_API_INVALID_INV_TYPE, 2-22
IC_API_INVALID_ITEM, 8-12
IC_API_INVALID_ITEM_NO, 4-9, 6-17
IC_API_INVALID_ITEMCOST_CLASS, 2-23
IC_API_INVALID_JOURNAL_NO, 6-17
IC_API_INVALID_LOCATION, 6-17
IC_API_INVALID_LOCT_CTL, 2-22
IC_API_INVALID_LOT_CTL, 2-22
IC_API_INVALID_LOT_EXPACTION_
CODE, 8-12
IC_API_INVALID_LOT_HOLD_DAYS, 8-13
IC_API_INVALID_LOT_INACTIVE_IND, 8-12
IC_API_INVALID_LOT_INDIVISIBLE, 2-22
IC_API_INVALID_LOT_MATR_DAYS, 8-12
Index-4
IC_API_NVALID_SHELF_LIFE, 2-22
IC_API_SUBLOT_NOT_REQD, 6-17, 8-12
IC_API_TRAN_POSTED, 6-19
IC_API_TRANS_TYPE_FOR_ITEM, 6-17
ic_ctms_cls, 2-14
ic_frgt_cls, 2-14
ic_gled_cls, 2-14
ic_hold_date, 2-19, 8-6, 8-11
ic_hold_days, 2-11
ic_invn_cls, 2-14
ic_invn_mst, 2-14
ic_item_cnv, 4-6, 4-7, 6-7
ic_item_cpg, 2-14, 2-18, 8-9
ic_item_cpg table, 2-3
IC_ITEM_MST, 8-9
ic_item_mst, 1-13, 2-14, 2-15, 2-17, 4-6, 6-7, 8-4, 8-5,
8-9
ic_item_mst.expaction_code, 8-4
ic_item_mst.expaction_interval, 8-5
ic_item_mst.grade_ctl, 8-4
ic_item_mst.ic_hold_days, 8-6
ic_item_mst.ic_matr_days, 8-6
ic_item_mst.item_id, 4-8, 6-11, 8-10, 8-11
ic_item_mst.lot_ctl, 6-5
ic_item_mst.qc_grade, 8-4
ic_item_mst.shelf_life, 8-5
ic_item_mst.sublot_ctl, 6-5
ic_jrnl_mst, 6-4, 6-7, 6-9
ic_jrnl_mst.journal_id, 6-10
ic_loct_inv, 1-7, 6-7, 6-13, 6-15, 6-16
ic_loct_inv.loct_onhand, 6-16
ic_loct_inv.loct_onhand2, 6-16
ic_loct_inv.lot_status, 6-11
ic_loct_inv.whse_code, 6-16
IC_LOTS_CPG, 1-13
ic_lots_cpg, 1-13, 2-15, 8-3, 8-9
IC_LOTS_MST, 1-13, 2-15, 8-9
ic_lots_mst, 1-9, 1-13, 2-14, 2-15, 4-6, 6-5, 6-7, 8-4,
8-6, 8-9, 8-10
ic_lots_mst.lot_id, 4-8, 6-11
ic_lots_mst.qc_grade, 6-11
ic_lots_sts, 2-14, 6-7, 8-9
ic_lots_sts.nettable_ind, 6-14
ic_lots_sts.order_proc_ind, 6-14
ic_lots_sts.prod_ind, 6-14
ic_lots_sts.shipping_ind, 6-14
ic_matr_date, 2-19, 8-6, 8-11
ic_matr_days, 2-11
ic_prce_cls, 2-14
ic_prch_cls, 2-14
ic_rank_mst, 2-14
ic_sale_cls, 2-14
ic_ship_cls, 2-14
ic_stor_cls, 2-14
ic_summ_inv, 1-7, 6-7, 6-14, 6-15, 6-16
ic_taxn_cls, 2-14
ic_text_tbl, 8-10
ic_tran_cmp, 1-7, 6-7, 6-12
ic_tran_pnd, 1-7
ic_whse_mst, 6-5
in_use, 6-10
inactive indicator, 9-3
inactive item indicator, 3-3
inactive_ind, 2-7, 2-19, 8-6
indicator, lot indivisibility, 3-3
initialization
item create API, 2-17
Initialize utility function, 1-16
installation, 1-17
interrogation, by calling wrapper, 1-12
intracompany transfer package, 1-7
intracompany transfers, 1-19
inv_class, 2-8
inv_type, 2-7
Invalid Organization, message, 1-19
inventory (negative), profile option, 6-9
inventory adjustment detail table, 6-10
inventory calendar, 6-6
inventory class, 3-4
inventory item, creation, 2-2
inventory item, lot creation, 8-2
inventory location, 6-8
inventory movement, lot status issues, 6-9
inventory quantities, 1-2
inventory transaction packages, 1-7
inventory type, 3-3
inventory, negative balance, 6-9
Inventory_Posting, 6-8
item creation, 1-2, 2-2
item description 1, 3-3
Index-5
J
journal number, 7-2
journal_comment, 6-9
journal_id, 6-9, 6-10
journal_no, 6-4, 6-9
JRNL document type, 6-9
L
lang_code, 4-10
Last (API) mode, 1-17
last_update_date, 2-17, 2-18, 4-8, 6-9, 6-11, 6-13,
8-11
last_update_login, 2-17, 2-18, 4-8, 6-10, 6-12, 6-13,
8-11
last_updated_by, 2-17, 2-18, 4-8, 6-9, 6-12, 6-13,
8-11
layer
database access, 1-5
group, 1-5
private, 1-5
public, 1-5
validation, 1-5
wrapper, 1-5
layered architecture, 1-5, 1-6
level code, 3-3
Index-6
level_code, 2-6
line_id, 6-11, 6-12
line_type, 6-11, 6-13
location, 6-11, 6-12, 6-14, 6-15
location control, 3-3
location control issues, 6-9
loct_ctl, 2-7
loct_onhand, 6-14
loct_onhand2, 6-14, 6-15
logic, special, 3-7
logic, update, 4-7
logical transaction, 1-12
login id, 8-11
login_id, 4-8, 6-10, 6-13
lot attributes, CPG, 1-8
lot controlled item indicator, 3-3
lot controlled items, 1-9
Lot Create, 1-2
Lot Create API wrapper, 8-3
Lot Create stored procedure, 8-2
lot created date, 9-2
lot creation, 8-2
lot description, 9-2
lot expiration, action code for, 3-4
lot expire date, 9-2
lot hold days, 3-5
lot hold release date, 9-3
lot indivisibility, 3-3
lot maturity date, 9-3
lot maturity days, 3-5
lot number, 5-3, 7-2, 9-2
lot status, 7-3
lot status change, 6-8
lot status controlled item indicator, 3-4
lot status, changing, 6-15
lot status, inventory movement, 6-9
lot, default, 1-8
lot_created, 2-19, 8-5, 8-6
lot_ctl, 2-6
lot_desc, 2-18, 8-4
lot_id, 4-8, 6-11, 6-12, 6-13, 6-15, 8-10, 8-11
lot_indivisible, 2-6
lot_no, 2-18, 4-4, 4-8, 6-5, 8-4
lot_status, 2-10, 6-5, 6-11, 6-13, 6-15
lot/sublot-controlled, 6-8
M
match type, 3-3
match_type, 2-7
mechanism, stored procedure, 1-4
message count, 2-4
message decoding, 1-3
message dictionary, 1-16
message handling, 1-3
message list, 1-16
message list, getting messages from, 1-17
message stack, 2-4
messages, error, 2-22
messages, result, 1-16
messaging, errors, 1-16
mode
First (API), 1-17
Last (API), 1-17
Next (API), 1-17
Previous (API), 1-17
Specific (API), 1-17
modified_by, 8-11
move inventory, 6-2
movements, 6-8
moving inventory, lot status issues, 6-9
N
negative inventory, 6-9
negative inventory, profile option,
network traffic, 1-12
Next (API) mode, 1-17
no_inv, 6-11
no_trans, 6-11
noninv_ind, 2-7
non-inventory item, 3-3
O
on-hand balances, 6-8
onhand_order_qty, 6-14
onhand_order_qty2, 6-14
onhand_prod_qty, 6-14
onhand_prod_qty2, 6-14
onhand_qty, 6-14
onhand_qty2, 6-14
6-9
onhand_ship_qty, 6-14
onhand_ship_qty2, 6-14
op_code, 4-10, 6-13
operator code, 9-3
OPM item master, 1-8
Oracle Financials, 3-5
Oracle Messages table, 1-12
Oracle-supplied wrapper code,
organization code, 7-3
orgn_code, 6-6, 6-9, 6-11, 6-12
origination type, 9-3
origination_type, 2-19, 8-6
1-6
P
p_api_version, 1-14, 2-3
p_cmp_tran_rec, 6-12, 6-15, 6-16
p_cmp_tran_rec.co_code, 6-12
p_cmp_tran_rec.doc_date, 6-13
p_cmp_tran_rec.doc_id, 6-12
p_cmp_tran_rec.doc_line, 6-13
p_cmp_tran_rec.doc_type, 6-13
p_cmp_tran_rec.event_id, 6-13
p_cmp_tran_rec.gl_posted_ind, 6-13
p_cmp_tran_rec.item_id, 6-12, 6-13, 6-14, 6-15
p_cmp_tran_rec.line_id, 6-12
p_cmp_tran_rec.line_type, 6-13, 6-15, 6-16
p_cmp_tran_rec.location, 6-12, 6-14, 6-15
p_cmp_tran_rec.lot_id, 6-12
p_cmp_tran_rec.lot_status, 6-13, 6-15
p_cmp_tran_rec.onhand2, 6-16
p_cmp_tran_rec.op_code, 6-13
p_cmp_tran_rec.orgn_code, 6-12
p_cmp_tran_rec.qc_grade, 6-13, 6-14, 6-15
p_cmp_tran_rec.reason_code, 6-13
p_cmp_tran_rec.text_code, 6-13
p_cmp_tran_rec.tran_id, 6-13, 6-15
p_cmp_tran_rec.trans_qty, 6-13, 6-14, 6-16
p_cmp_tran_rec.trans_qty2, 6-13, 6-14, 6-15, 6-16
p_cmp_tran_rec.trans_stat, 6-13
p_cmp_tran_rec.trans_type, 6-13
p_cmp_tran_rec.trans_um, 6-13
p_cmp_tran_rec.trans_um2, 6-13
p_cmp_tran_rec.whse_code, 6-12, 6-13, 6-14, 6-15,
6-16
Index-7
Index-8
Q
qc_actn_mst, 2-14, 8-9
qc_grad_mst, 2-14, 6-5, 8-4, 8-9
qc_grade, 2-9, 2-18, 6-5, 6-11, 6-13, 6-14, 6-15, 8-4
qc_hres_mst, 2-14
qchold_res_code, 2-10
qcitem_id, 2-17
qcitem_no, 2-10
qty, 6-11
qty2, 6-11
quality control
grade, 7-3
grade controlled item indicator, 3-4
grade, changing, 6-15
hold reason code, 3-4
reference item, 3-4
quality control attributes, 1-8
quantities, 6-7
quantities transaction, validation of, 1-19
R
reason code, 7-3
reason_code, 6-6, 6-11, 6-13
record validation, 1-12
record, PL/SQL, 1-12
requirements, technical, 1-3, 4-2, 5-2, 6-2, 8-2
Reset utility function, 1-16
result messages, 1-16
retest date, 9-3
retest interval, 3-4
retest_date, 2-19, 8-5
retest_interval, 2-8
S
sales class, 3-4
sales_class, 2-8
second alternative name for item, 3-3
secondary transaction quantity, 7-3
secondary unit of measure, 3-3, 7-2
security, 1-12
separation, relating to user interface, 1-12
seq_dpnd_class, 2-11
sequence dependent class, 3-5
shelf life, 3-4
shelf_life, 2-8
ship class, 3-4
ship vendor number, 9-3
ship_class, 2-8
shipvend_id, 8-10
shipvendor_no, 2-19, 8-6
Index-9
T
table, Oracle Messages, 1-12
table_name, 8-6
tax class, 3-4
tax_class, 2-8
technical requirements, 1-3, 4-2, 5-2, 6-2, 8-2
temporary table, 1-11
text_code, 2-17, 4-8, 6-10, 6-13, 8-11
third party code, 1-5
third party code, and public calls, 1-19
third party code, callable utility routines, 1-20
time, system, 2-19
/tmp, directory, 7-4
to location, 7-3
to unit of measure, 5-3
to warehouse code, 7-2
to_location, 6-5
to_um, 4-7
to_uom, 4-4
to_whse_code, 6-5
traffic, network, 1-12
trans_cnt, 2-17, 4-8, 6-12, 8-11
trans_date, 6-6, 6-13
trans_flag, 6-10
trans_id, 6-12
trans_qty, 6-5, 6-13
trans_qty2, 6-5, 6-13
trans_stat, 6-13
trans_type, 6-4, 6-5, 6-8, 6-10, 6-11
trans_um, 6-13
trans_um2, 6-13
transaction date, 7-3
transaction packages, inventory, 1-7
transaction type, 7-2
transaction, logical, 1-12
transactions, changing lot status, 6-15
transactions, grade (QC), 6-8
TRNI, 6-10, 6-13
type_factor, 4-5, 4-8
type_factorrev, 4-8
U
um_type, 4-8
unit of measure,
Index-10
3-3, 4-7
x_ic_lots_mst_row, 8-3
x_msg_count, 1-14, 1-15, 2-22, 4-9, 6-17, 8-12
x_msg_data, 1-14
x_return_status, 1-14, 1-15, 1-16, 2-22, 4-9, 6-17,
8-12
V
validating a record, 1-12, 3-7, 6-8
validation
inventory quantities API wrapper, 7-4
item create API, 2-17
item create API wrapper, 3-7
item lot/sublot conversion API, 4-7
item lot/sublot conversion API wrapper,
lot create API wrapper, 9-4
variables, 1-6
vendor_lot_no, 2-19, 8-6
vendors lot number, 9-3
5-2
W
warehouse item number, 3-5
whse_code, 6-11, 6-12, 6-13, 6-14, 6-15
whse_item_id, 2-17
whse_item_no, 2-10
wrapper, 1-7
GMIPILW, 1-7
GMIPITW, 1-7
GMIPLOW, 1-7
GMIPQTW, 1-7
item creation, 1-7
item/lot UOM conversion, 1-7
lot creation, 1-7
quantity transactions, 1-7
wrapper code, 1-5, 1-6
wrapper function, 2-2, 2-16, 3-2, 3-3, 4-2, 4-7, 5-2,
6-2, 7-2, 9-2
wrappers, 1-5
X
x_ic_adjs_jnl_row, 6-3
x_ic_adjs_jnl_row1, 6-3
x_ic_adjs_jnl_row2, 6-3
x_ic_item_cnv_row, 4-3
x_ic_item_cpg row, 2-3
x_ic_item_cpg_row, 2-3
x_ic_item_mst_row, 2-3
x_ic_jrnl_mst_row, 6-3
x_ic_lots_cpg, 8-3
x_ic_lots_cpg_row, 8-3
Index-11
Index-12