115gmepeapiug PDF
115gmepeapiug PDF
115gmepeapiug PDF
July 2003
Oracle Process Manufacturing Process Execution API Users Guide, Release 11i
Part No. A97388-03
Copyright 2003 Oracle Corporation. All rights reserved.
Primary Author: Michele-Andrea Fields
Contributors: Bill Stearns, Thomas Daniel, Shrikant Nene
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, except to the extent required
to obtain interoperability with other independently created software or as specified by law, is prohibited.
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 OracleMetaLink, Oracle Store, Oracle8, Oracle8i, and SQL*Plus are
trademarks or registered trademarks of Oracle Corporation. Other names may be trademarks of their
respective owners.
Contents
Send Us Your Comments .................................................................................................................. vii
Preface............................................................................................................................................................ ix
Audience for This Guide...................................................................................................................... ix
How To Use This Guide ....................................................................................................................... ix
Documentation Accessibility ......................................................................................................... xi
Other Information Sources .................................................................................................................. xi
Online Documentation.................................................................................................................... xi
Related Users Guides.................................................................................................................... xii
Guides Related to All Products .................................................................................................... xii
User Guides Related to This Product .......................................................................................... xii
Installation and System Administration ................................................................................... xvii
Other Implementation Documentation...................................................................................... xix
Training and Support.................................................................................................................... xxi
Do Not Use Database Tools to Modify Oracle Applications Data............................................. xxi
About Oracle........................................................................................................................................ xxii
Your Feedback ..................................................................................................................................... xxiii
API Introduction
Introducing the Process Execution APIs ........................................................................................
Process Execution API Support Policy ......................................................................................
Technical Requirements ..............................................................................................................
Technical Overview......................................................................................................................
Basic Business Needs .........................................................................................................................
1-2
1-3
1-3
1-3
1-3
iii
1-4
1-5
1-5
1-6
1-11
Technical Overview
Structure for Process Execution Public APIs ................................................................................. 3-2
Standard Parameters........................................................................................................................... 3-4
Value-ID Conversion.................................................................................................................... 3-5
Business Objects
Allocate Batch ......................................................................................................................................
Allocate Line ........................................................................................................................................
Cancel Batch.........................................................................................................................................
Close Batch ...........................................................................................................................................
Close Steps ...........................................................................................................................................
Complete Batch ...................................................................................................................................
Complete Steps..................................................................................................................................
Convert FPO to Batches ...................................................................................................................
Create Batch .......................................................................................................................................
Create Phantom .................................................................................................................................
Delete Batchstep Activity ................................................................................................................
Delete Batchstep Resource ..............................................................................................................
Delete Line Allocation .....................................................................................................................
Delete Material Detail Line ............................................................................................................
Delete Step .........................................................................................................................................
End Completed Resource Transaction ..........................................................................................
Incremental Backflushing ...............................................................................................................
iv
4-1
4-3
4-4
4-6
4-7
4-8
4-11
4-14
4-16
4-19
4-21
4-22
4-23
4-24
4-25
4-26
4-27
4-30
4-31
4-34
4-36
4-39
4-41
4-43
4-44
4-47
4-49
4-50
4-51
4-52
4-53
4-54
4-55
4-56
4-58
4-60
4-61
4-62
4-63
4-65
4-66
4-69
4-72
Listing of GMEPAPIS.pls
Index
vi
Oracle Corporation welcomes your comments and suggestions on the quality and usefulness of this
document. 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 document
title and part number, and the chapter, section, and page number (if available). You can send comments to us in the following ways:
If you have problems with the software, please contact your local Oracle Support Services.
vii
viii
Preface
Audience for This Guide
Welcome to Release 11i of the Oracle Process Manufacturing Process Execution API
Users Guide.
This guide assumes you have a working knowledge of the following:
See Other Information Sources for more information about Oracle Applications
product information.
Chapter 1 describes how APIs are used, the basic business need of APIs, and the
different Process Execution APIs offered.
ix
Documentation Accessibility
Our goal is to make Oracle products, services, and supporting documentation
accessible, with good usability, to the disabled community. To that end, our
documentation includes features that make information available to users of
assistive technology. This documentation is available in HTML format, and contains
markup to facilitate access by the disabled community. Standards will continue to
evolve over time, and Oracle Corporation is actively engaged with other
market-leading technology vendors to address technical obstacles so that our
documentation can be accessible to all of our customers. For additional information,
visit the Oracle Accessibility Program Web site at
http://www.oracle.com/accessibility/.
Online Documentation
All Oracle Applications documentation is available online (HTML or PDF).
Online Help - The new features section in the HTML help describes new
features in 11i. This information is updated for each new release of Oracle
Process Manufacturing System Administration. The new features section also
includes information about any features that were not yet available when this
guide was printed. For example, if your administrator has installed software
from a mini-packs an upgrade, this document describes the new features.
Online help patches are available on OracleMetaLink.
xi
11i Features Matrix - This document lists new features available by patch and
identifies any associated new documentation. The new features matrix
document is available on OracleMetaLink.
Readme File - Refer to the readme file for patches that you have installed to
learn about new documentation or documentation patches that you can
download.
xii
Since OPM is closely integrated with Oracle General Ledger (GL), much of the
attributes are defined in the Oracle GL instead of OPM, and therefore, the windows
are display only within OPM. The Oracle Process Manufacturing Accounting Setup
Users Guide describes how to setup and use this application.
xiii
xiv
ingredients, record actual ingredient usage, and then complete and close production
batches. Production inquiries and preformatted reports help you optimize
inventory costs while maintaining a high level of customer satisfaction with on-time
delivery of high quality products. The OPM Process Execution Users Guide presents
overviews of the tasks and responsibilities for the Production Supervisor and the
Production Operator. It provides prerequisite setup in other applications, and
details the windows, features, and functionality of the OPM Process Execution
application.
xv
data. Through the Manufacturing Scheduling application, you can optimize the
schedule based on resource and component constraints and user predefined
priorities. Using different optimization objectives, you can tailor Manufacturing
Scheduling to meet your needs.
Using Oracle Manufacturing Scheduling helps you improve productivity and
efficiency on your shop floor. By optimally scheduling shop floor jobs, and being
able to quickly react to unplanned constraints, you can lower manufacturing costs,
increase resource utilization and efficiency, and increase customer satisfaction
through improved on-time delivery. The Using Oracle Process Manufacturing with
Oracle Manufacturing Scheduling Users Guide describes how to setup and use this
integrated solution.
Implementation Guide
The Oracle Process Manufacturing Implementation Guide offers information on setup.
That is, those tasks you must complete following the initial installation of the Oracle
xvi
Process Manufacturing software. Any tasks that must be completed in order to use
the system out-of-the-box are included in this manual.
xvii
automating many of the required steps. This guide contains instructions for using
Oracle Rapid Install and lists the tasks you need to perform to finish your
installation. You should use this guide in conjunction with individual product
users guides and implementation guides.
xviii
xix
product data. This manual also provides information on creating custom reports on
flexfields data.
xx
needs. For example, you may want to use your organization structure, terminology,
and data as examples in a customized training session delivered at your own
facility.
Support
From on-site support to central support, our team of experienced professionals
provides the help and information you need to keep Oracle Process Manufacturing
Process Execution APIs working for you. This team includes your Technical
Representative, Account Manager, and Oracles large staff of consultants and
support specialists with expertise in your business area, managing an Oracle8i
server, and your hardware and software environment.
About Oracle
Oracle Corporation develops and markets an integrated line of software products
for database management, applications development, decision support, and office
xxi
xxii
Your Feedback
Thank you for using Oracle Process Manufacturing Process Execution APIs and this
users guide.
Oracle values your comments and feedback. At the end of this guide is a Readers
Comment Form you can use to explain what you like or dislike about Oracle
Process Manufacturing Process Execution APIs or 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 electronic mail to [email protected].
xxiii
xxiv
1
API Introduction
This document describes the Application Program Interfaces (APIs) that support
external interfaces to Oracle Process Manufacturing (OPM) Process Execution
application. The topics discussed in this chapter are:
n
Major Features
API Introduction
1-1
Multilingual support
S for success
E for error
Oracle provides objects and libraries needed to use the APIs and the
documentation for their use.
Oracle does not support customer generated programs that use the APIs.
Technical Requirements
Process Execution APIs make use of the following standard Oracle Applications
packages:
n
These packages are installed as part of the current release. Refer to the Oracle
Applications Coding Standards manual for additional details.
Technical Overview
Process Execution APIs are designed to operate in an OPM 11i environment only.
They offer the following basic API functionality:
n
Proper encapsulation.
API Introduction
1-3
In addition, these APIs serve as a central place to insert, update, or delete batch
records in OPM from any source.
Following are some of the important characteristics for these APIs:
Code Reuse
You can maximize code reuse from all application development tools, including
PL/SQL, Oracle Forms, and Oracle Reports.
Ease of Integration
You can integrate APIs into other applications and enabling technology, such as
Oracle Workflow Server, Oracle Internet Commerce & Oracle WebSystem, and
Oracle EDI Gateway.
Consistent Behavior
You can hide Object logic specific to an application from other applications, and to
ensure that this logic is correctly invoked by other applications and customers.
Robust Validation
You can validate all incoming information into Oracle Applications.
Batch File
Input data to the user wrapper function comes from a batch file. This is processed
by the wrapper and header information passed, as parameters, to the stored
procedure in an asynchronous mode. In this mode, the calling function does not
monitor the success or failure of each individual record. The Oracle Message FND_
PUB_MSG functionality is used to audit the calls.
Wrapper Function
Windows are generally used as wrapper functions.
The wrapper function is responsible for collating the details required as input
parameters to the stored procedure and forwarding these in the call and monitoring
the return code.
The stored procedure returns three possible return code:
n
S for success
E for error
Based on the return, the wrapper function searches the Oracle Messages File for the
stored procedure to determine a COMMIT of the transaction or not.
Stored Procedure
The stored procedure is called with the appropriate parameters forwarded in a
PL/SQL table format. The procedure validates each record from this table and then
processes the appropriate functional logic as required. The procedure writes
appropriate messages to the Oracle Messages table. These are informational as
determined by the logic. These can be interrogated by the calling wrapper function
through the GET MESSAGES functionality.
API Introduction
1-5
Major Features
The stored procedure calls other validation procedures in the course of its
execution; a modular approach has been adopted. Functions called by these
procedures do not use IN/OUT parameters as these have been removed from the
Oracle 8 coding standards.
On successful completion of the procedure, a success unit is in place that can be
optionally COMMITTED. The decision as to whether a COMMIT is issued on
successful completion is under the control of the calling code and deliberately
outside the scope of the API procedures.
Major Features
In order to support the requirements mentioned in the Basic Business Needs
topic, the new APIs support the following functionality:
Allocate Batch
The Allocate Batch API autoallocates a batch and all the phantom batches.
Allocate Line
The Allocate Line API autoallocates the material detail line.
Cancel Batch
The Cancel Batch API is a business object that nullifies a batch. The batch remains in
the database for audit purposes, but it has a specific status of cancelled and any
effect it has on inventory is reversed.
Close Batch
The Close Batch API is a business object that closes the batch. Closing a batch
prevents further editing of a batch, and makes it available for use by Actual
Costing.
Close Steps
The Close Step API is a business object that closes the batch step. Closing a batch
step prevents further editing.
Complete Batch
The Complete Batch, or certify batch, API is a business object that completes the
batch. Completing a batch indicates that the batch has been completed and the
Major Features
products and byproducts have been yielded. Completing a batch lets adjustments to
ingredient, product, and byproduct quantities.
Complete Steps
The Complete Step, or certify batch step, API is a business object that completes a
single batch step or multiple batch steps based on certain criteria. Completing a step
is how output quantities are specified, or defaulted, for items yielded in the step.
Resource usage for all activities is also calculated. If this is the final step, then
completing it results in a batch completion when the GME:Step Control Batch Status
profile option is set to Yes.
Create Batch
The Create Batch API is a business object that creates batches, lab batches, and Firm
Planned Orders (FPOs) in OPM.
Create Phantom
The Create Phantom API creates phantom batches based on the validity rule passed.
API Introduction
1-7
Major Features
Delete Step
The Delete Step API deletes the step in the batch.
Incremental Backflushing
The Incremental Backflushing, or partial certification, API is a business object that
lets you incrementally record product yield and have ingredient usage backflushed.
Major Features
Insert Step
The Insert Step API inserts the new step to the batch.
Release Batch
The Release Batch API is a business object that converts pending batches to work in
process (WIP) batches in OPM.
Release Steps
The Release Step API is a business object that can release a single batch step or
multiple batch steps based on certain criteria. If the profile option GME:Step
Control Batch Status is set to Yes, then it will also release the batch.
Reopen Batch
The Reopen Batch API changes the status of the batch from closed to completed.
Reopen Steps
The Reopen Steps API changes the status of the step from closed to completed.
Reroute Batch
The Reroute Batch API is a business object that reroutes a batch to a different recipe
with the same formula. The batch or firm planned order is only rerouted in pending
status.
Reschedule Batch
The Reschedule Batch API is a business object that reschedules a batch or firm
planned order to a different date. The batch is only rescheduled while in pending or
WIP status. The firm planned order is only rescheduled when in a pending state.
API Introduction
1-9
Major Features
Reschedule Step
The Reschedule Step API reschedules the step and all subsequent steps.
Scale Batch
The Scale Batch API scales batches up or down, as well as all the phantom batches.
Unrelease Batch
The Unrelease Batch API removes the completed allocations for the ingredient lines.
Unreleasing a batch sets the batch status to pending.
Unrelease Steps
The Unrelease Step API is a business object that unreleases a batch step based on
certain criteria. Unreleasing a step sets the step to pending status.
GMEGAPIS.pls: GME_API_GRP
GMEGTXNS.pls: GME_TRANS_ENGINE_GRP
GMEMATLS.pls: GME_API_MATERIAL_DETAILS
GMEPAPIS.pls: GME_API_PUB
GMEUDBGS.pls: GME_DEBUG
GMEUTXNS.pls: GME_TRANS_ENGINE_UTIL
GMEVALBS.pls: GME_API_ALLOCATE_BATCH_PVT
GMEVALLS.pls: GME_API_ALLOCATE_LINE_PVT
GMEVCCBS.pls: GME_CANCEL_BATCH_PVT
GMEVCCSS.pls: GME_CANCEL_STEP_PVT
GMEVCFPS.pls: GME_API_CONVERT_FPO
GMEVCLBS.pls: GME_API_CLOSE_BATCH
GMEVCLSS.pls: GME_API_CLOSE_STEP
GMEVCRBS.pls: GME_API_CREATE_BATCH
GMEVCRSS.pls: GME_API_CREATE_STEP
GMEVCTBS.pls: GME_API_CERTIFY_BATCH
GMEVCTSS.pls: GME_API_CERTIFY_BATCH_STEP
GMEVDBSS.pls: GME_API_DELETE_BATCH_STEP
GMEVGBHS.pls: GME_BATCH_HEADER_DBL
GMEVGBSS.pls: GME_BATCH_STEPS_DBL
GMEVGHSS.pls: GME_BATCH_HISTORY_DBL
GMEVGITS.pls: GME_INV_TXNS_GTMP_DBL
GMEVGLBS.pls: GME_LAB_BATCH_LOTS_DBL
GMEVGMDS.pls: GME_MATERIAL_DETAILS_DBL
GMEVGRGS.pls: GME_RESOURCE_TXNS_GTMP_DBL
GMEVGRTS.pls: GME_RESOURCE_TXNS_DBL
GMEVGSAS.pls: GME_BATCH_STEP_ACTIVITIES_DBL
GMEVGSDS.pls: GME_BATCH_STEP_DEPEND_DBL
GMEVGSIS.pls: GME_BATCH_STEP_ITEMS_DBL
GMEVGSOS.pls: GME_BATCH_SALES_ORDERS_DBL
GMEVGSRS.pls: GME_BATCH_STEP_RESOURCES_DBL
GMEVGSTS.pls: GME_BATCH_STEP_TRANSFERS_DBL
GMEVINSS.pls: GME_API_INSERT_STEP
GMEVPCBS.pls: GME_API_PARTIAL_CERT
GMEVPHBS.pls: GME_API_PHANTOM
GMEVRLBS.pls: GME_API_RELEASE_BATCH
GMEVRLSS.pls: GME_API_RELEASE_BATCH_STEP
GMEVROBS.pls: GME_REOPEN_BATCH_PVT
GMEVROSS.pls: GME_REOPEN_STEP_PVT
GMEVRRBS.pls: GME_API_REROUTE_BATCH
GMEVRSBS.pls: GME_API_RESCHEDULE_BATCH
GMEVRSSS.pls: GME_API_RESCHEDULE_BATCH_STEP
GMEVRXNS.pls: GME_RESOURCE_ENGINE_PVT
GMEVTSTS.pls: GME_API_TEST
GMEVTXNS.pls: GME_TRANS_ENGINE_PVT
GMEVTXTS.pls: GME_TEXT_DBL
GMEVUCBS.pls: GME_API_UNCERTIFY_BATCH
GMEVUCSS.pls: GME_API_UNCERTIFY_BATCH_STEP
GMEVURBS.pls: GME_API_UNRELEASE_BATCH
GMEVURSS.pls: GME_API_UNRELEASE_STEP
GMEVUSQS.pls: GME_API_UPDATE_STEP_QTY
GMDPRDTS.pls: GMD_RECIPE_DATA_PUB
GMDPCOMS.pls: GMD_COMMON_VAL
GMDSTEPS.pls: GMD_AUTO_STEP_CALC
GMDVSCLS.pls: GMD_COMMON_SCALE
GMDPOPNS.pls: GMD_FETCH_OPRN
GMDPRCFS.pls: GMD_RECIPE_FETCH_PUB
GMDPVRFS.pls: GMD_FETCH_VALIDITY_RULES
GMDPVRDS.pls: GMD_VAL_DATA_PUB
GMDPRVRS.pls: GMD_VALIDITY_RULES
GMDPRTVS.pls: GMDRTVAL_PUB
GMAGMETS.pls: GMA_GME_TEXT_TBL_PKG
GMEPTXNB.pls: UPDATE_LINE_ALLOCATION
GMEPTXNB.pls: DELETE_LINE_ALLOCATION
GMEVACBS.pls:GME_INSERT_BATCHSTEP
GMEVACBS.pls:GME_DELETE_BATCHSTEP
GMEVACBS.pls:GME_UPDATE_BATCHSTEP
GMEVACTS.pls:INSERT_BATCHSTEP_ACTIVITY
GMEVACTS.pls:UPDATE_BATCHSTEP_ACTIVITY
GMEVACTS.pls:DELETE_BATCHSTEP_ACTIVITY
2
Process Execution API Usage
The Process Execution APIs are written in PL/SQL. To use these APIs, you must
code your interface or wrapper. Your program is responsible for connecting to a
database before calling an API function. You can write log files before calling and
after returning from an API function. Each function returns an error code in the
parameter x_return_status that indicates whether the API was successful or failed.
The values are:
n
S for success
E for error
IN
NUMBER
p_validation_level
IN
NUMBER
p_init_msg_list
IN
BOOLEAN
p_commit
IN
BOOLEAN
OUT NUMBER
x_message_list
OUT VARCHAR2
x_return_status
OUT VARCHAR2
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
,x_return_status
,p_material_detail
,p_values_tab
,p_scale_phantom
,x_material_detail
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
p_api_version
p_validation_level
FALSE
p_commit
x_message_count
x_message_list
x_return_status
l_material_detail
p_values_tab
p_scale_phantom
l_material_detail);
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
=>
p_api_version
p_validation_level
FALSE
p_commit
x_message_count
x_message_list
x_return_status
l_material_detail_in
p_values_tab
p_scale_phantom
l_material_detail_out);
--|
|
--| TYPE
|
--| Public
|
--|
|
--| USAGE
|
--| Create_Batch
|
--|
|
--| DESCRIPTION
|
--| This is a PL/SQL wrapper function to call the Create Batch API.
|
--|
|
--| REQUIREMENTS
|
--|
This wrapper assumes that the user has initialized the application
|
--|
user variables. To do this the procedure fnd_global.apps_initialize
|
--|
needs to be invoked with the appropriate user id and responsibility
|
--|
|
--|
The user has to supply the following required values
|
--|
p_batch_type
0 - Batch, 10 - Firm Planned Order
|
--|
p_orgn_code
Plant in which the batch is created
|
--|
p_creation_mode
PRODUCT, RECIPE, OUTPUT or INPUT
|
--|
p_batch_size
The size of the batch to be created
|
--|
p_batch_size_uom
The Unit of measure code of the batch size|
--|
p_recipe_validity_rule_id The recipe validity rule ID with which the|
--|
batch has to be created. This field could |
--|
be omitted if any of the following combi- |
--|
nations are provided
|
--|
p_recipe_id or
|
--|
p_recipe_no, p_recipe_version or
|
--|
p_product_id (Item_Id) or
|
--|
p_product_no (Item_No)
|
--|
p_batch_no
This is required if the plant is set for |
--|
manual document ordering
|
--|
Out Variables
|
--+==========================================================================+
PROCEDURE create_batch
( p_api_version
,p_validation_level
,p_init_msg_list
,p_commit
,P_batch_type
,p_orgn_code
,p_creation_mode
,p_batch_size
,p_batch_size_uom
IN
IN
IN
IN
NUMBER
NUMBER
BOOLEAN
BOOLEAN
IN
IN
IN
IN
IN
NUMBER
VARCHAR2
VARCHAR2
NUMBER
VARCHAR2
DEFAULT
DEFAULT
DEFAULT
DEFAULT
gme_api_pub.api_version
gme_api_pub.max_errors
FALSE
FALSE
,p_plan_start_date
,p_plan_cmplt_date
,p_due_date
,p_update_inventory_ind
IN
IN
IN
IN
DATE
DATE
DATE
VARCHAR2
DEFAULT
DEFAULT
DEFAULT
DEFAULT
SYSDATE
SYSDATE
SYSDATE
'Y'
,p_recipe_validity_rule_id IN
NUMBER
DEFAULT NULL
,p_recipe_id
,p_recipe_no
,p_recipe_version
,p_product_no
,p_product_id
,p_batch_no
IN
IN
IN
IN
IN
IN
NUMBER
DEFAULT NULL
VARCHAR2 DEFAULT NULL
NUMBER
DEFAULT NULL
VARCHAR2 DEFAULT NULL
NUMBER
DEFAULT NULL
VARCHAR2 DEFAULT NULL
,p_ignore_qty_below_cap
,p_ignore_shortages
IN
IN
BOOLEAN
BOOLEAN
,x_batch_header
,x_unallocated_material
OUT
OUT
gme_batch_header%ROWTYPE
gme_api_pub.unallocated_materials_tab
,x_message_count
,x_message_list
,x_return_status
OUT
OUT
OUT
NUMBER
VARCHAR2
VARCHAR2 ) IS
DEFAULT TRUE
DEFAULT TRUE
l_batch_headerGME_BATCH_HEADER%ROWTYPE;
l_msg_index_outNUMBER;
BEGIN
/* Enable The Buffer */
DBMS_OUTPUT.ENABLE(1000000);
/* Let us build the batch row type variable with the input values */
l_batch_header.plant_code := p_orgn_code;
l_batch_header.batch_type := p_batch_type;
l_batch_header.batch_no:= p_batch_no;
l_batch_header.plan_start_date := p_plan_start_date;
l_batch_header.plan_cmplt_date := p_plan_cmplt_date;
l_batch_header.due_date := p_due_date;
l_batch_header.update_inventory_ind := p_update_inventory_ind;
IF p_recipe_validity_rule_id IS NOT NULL THEN
l_batch_header.recipe_validity_rule_id := p_recipe_validity_rule_id;
END IF;
gme_api_pub.create_batch(
p_api_version
,p_validation_level
,p_init_msg_list
,p_commit
=>
=>
=>
=>
p_api_version
p_validation_level
p_init_msg_list
p_commit
,x_message_count
,x_message_list
,x_return_status
=>
=>
=>
x_message_count
x_message_list
x_return_status
,p_batch_header
,x_batch_header
=>
=>
l_batch_header
x_batch_header
,p_batch_size
,p_batch_size_uom
,p_creation_mode
,p_recipe_id
,p_recipe_no
,p_recipe_version
,p_product_no
,p_product_id
=> p_batch_size
=> p_batch_size_uom
=> p_creation_mode
=> p_recipe_id
=> p_recipe_no
=> p_recipe_version
=> p_product_no
=> p_product_id
,p_ignore_qty_below_cap
,p_ignore_shortages
=>
=>
p_ignore_qty_below_cap
p_ignore_shortages
,x_unallocated_material
=>
x_unallocated_material );
' Item:'||x_unallocated_material(i).item_no||'
Allocated:'||x_unallocated_material(i).alloc_qty||
' Unalloc:'||x_unallocated_material(i).unalloc_
qty||' UOM:'||x_unallocated_material(i).alloc_uom);
END LOOP;
END IF;
END IF;
EXCEPTION
WHEN OTHERS THEN
x_return_status := FND_API.g_ret_sts_unexp_error;
x_message_count := 1;
x_message_list := SQLERRM;
dbms_output.put_line('Error '||TO_CHAR(SQLCODE)||': '||SQLERRM);
END Create_Batch;
3
Technical Overview
The public Process Execution APIs perform all validations necessary on input data
supplied in order to prevent the flow of invalid data into OPM. If any validation
errors occur, then that particular row is skipped and the process continues to the
next record. If the insert fails, then none of the detail records for the item in process
are inserted. After finishing validations on input data, the public API performs the
required function by calling the necessary routines.
The topics discussed in this chapter are:
n
Standard Parameters
Technical Overview
3-1
Name
GMEPAPIS.pls
GMEPAPIB.pls
Package
gme_api_pub
allocate_batch
allocate_line
cancel_batch
close_batch
close_step
certify_batch
certify_batch_step
convert_fpo
create_batch
create_phantom
delete_batchstep
delete_batchstepresource
delete_line_allocation
delete_material_line
delete_step
partial_cert_batch
end_cmplt_actual_rsc_txn
insert_batchstep
insert_batchstepresource
insert_incr_actual_rsrc_txn
Object Type
Name
insert_allocation
insert_material_line
insert_step
insert_timed_actual_rsrc_txn
release_batch
release_step
reopen_batch
reopen_step
reroute_batch
reschedule_batch
reschedule_step
scale_batch
start_cmplt_actual_rsrc_txn
theoretical_yield_batch
uncertify_batch
uncertify_batch_step
unrelease_batch
unrelease_step
update_actual_resource_usage
update_batchstep
update_batchstepresource
update_line_allocation
update_material_line
Technical Overview
3-3
Standard Parameters
Standard Parameters
API standard parameters are a collection of parameters that are common to most
APIs. The following paragraphs explain the standard parameters used in APIs and
their interpretation.
Some of the standard parameters apply to all APIs regardless of the nature of the
business function they perform. For example, p_api_version and x_return_status
are included in all APIs.
Some parameters are applicable for certain types of APIs and not applicable for
other types. For example, p_commit is applicable for APIs that change the database
state, and not applicable for read APIs.
Standard parameters are included in all APIs whenever applicable.
Standard IN parameters:
n
p_api_version
p_init_msg_list
p_commit
p_validation_level
x_return_status
x_msg_count
x_msg_data
Parameter
Type
IN/OUT
Required
Validation
p_api_
version
varchar2
IN
Standard Parameters
Parameter
Type
IN/OUT
Required
Validation
p_init_msg_
list
boolean
IN
p_commit
boolean
IN
x_return_
status
varchar2
OUT
x_msg_
count
number
OUT
x_msg_data
varchar2
OUT
Value-ID Conversion
IDs are usually used to represent primary and foreign entity keys, and for internal
processing of attributes. They are not meaningful and are hidden. Besides IDs,
attributes have values that represent them. Those values are meaningful and are
used for display purposes. In general, APIs operate only on IDs.
For example, an item is represented by an ID, the number column item_id. This ID
is its primary key and is used for all internal processing of the item. Besides this ID,
an item is represented by a value, the varchar2 column item_no. This value is
displayed when you choose an item. Therefore, an item can be identified by either
its ID or value, in this case item_no.
Technical Overview
3-5
Standard Parameters
Either ID or value, or both can be passed to an API. But, when both values are
passed, ID based parameters take precedence over value based parameters. For
example, if both parameters are passed, the value based parameter is ignored
and the ID based parameter is used.
When both the value and ID of an attribute are passed to an API, a message
informs the API caller that some of the input has been ignored.
This message is not an error message. The API continues with its regular
processing.
Each value has to resolve into one ID. Failure to resolve a value into an ID is an
error and is associated with an error message. The API aborts processing and
returns with a return status of error.
4
Business Objects
Allocate Batch
This procedure autoallocates ingredients in a batch and all phantom batches.
Following is the definition of Allocate Batch:
Parameter
Required
In/Out
Description
p_allocate_type
IN
p_release_type
IN
p_batch_header
IN
x_batch_header
OUT
p_del_exist_alloc
IN
OUT
x_unallocated_material Y
Description
batch_id
batch_no
Allocate Batch
Parameter
Description
plant_code
batch_type
Description
batch_id
batch_no
material_detail_id
line_type
line_no
item_id
item_no
Item Number.
alloc_qty
unalloc_qty
alloc_uom
Allocate Line
Allocate Line
The Allocate Line API refers to specifying the lots and locations of items used for a
batch. Allocation can be performed automatically by OPM or manually.
This API provides a way to autoallocate a particular ingredient line of batch.
Following is the definition of Allocate Line:
Parameter
Required
In/Out
Description
p_material_details
IN
p_allocate_type
IN
p_del_exist_alloc
IN
Description
material_detail_id
Cancel Batch
Cancel Batch
In OPM, batches and firm planned orders (FPOs) are created whenever a
production run for one or more products of a given recipe need to be manufactured.
After creation they are progressed through the various stages of the manufacturing
cycle:
n
Firm planned orders are converted to batches of the required size, number, or size and
number.
Batches are progressed from pending through WIP, completed and closed.
This is the normal business sequence, but there are times when it is necessary to go
back a stage in the cycle.
Once a firm planned order has been converted to batches, it is not possible to
unconvert the batches to a firm planned order. However, it is possible to cancel a
pending batch so that it is annulled.
Firm planned orders can also be cancelled in an identical manner to pending
batches. If the firm planned order is partially converted, for example a 2000kg firm
planned order has so far only been converted to batches totalling 1000kg, then the
unconverted residue is cancelled. The batches already created by partially
converting the firm planned order remains untouched.
If the batch being cancelled contains steps, then this API cancels all steps in the
batch. There is no publicly called Cancel Step API.
If a batch or firm planned order has been cancelled, then there is no way to uncancel
it.
Following is the definition of Cancel Batch:
Parameter
Required
In/Out
Description
p_batch_header
IN
x_batch_header
OUT
Cancel Batch
Parameter
Description
batch_id
batch_no
plant_code
batch_type
Close Batch
Close Batch
The Close Batch API is a business object that can close the batch. Closing a batch
prevents further editing.
Only a completed batch can be closed. All steps are closed at that time.
Following is the definition of Close Batch:
Parameter
Required
In/Out
Description
p_batch_header
IN
x_batch_header
OUT
Description
batch_id
batch_no
plant_code
batch_type
batch_close_date
Close Steps
Close Steps
The Close Step API is a business object that can close the batch step. Closing a batch
step prevents further editing.
When you close a batch step, any items associated with that step, with consumption
or yield type of Automatic by Step, are not editable. Only a completed batch steps
can be closed.
The immediately prior dependent step must have a status of closed to close the
batch step. The batch step row that is passed in must contain sufficient information
to identify the step, this can be batch_id and batchstepno or batchstep_id.
Following is the definition of Close Step:
Parameter
Required
In/Out
Description
p_batch_step
IN
x_batch_step
OUT
p_delete_pending
IN
Description
batchstep_id
batch_id
batchstep_no
step_close_date
Complete Batch
Complete Batch
The complete batch API is a business object that can complete the batch.
Completing a batch indicates that the batch has been completed and the products
and byproducts have been yielded. Completed batches still let adjustments to
ingredient, product, and byproduct quantities.
If any of the ingredients, products, or byproducts are not allocated, then the
complete batch routine returns back the unallocated material lines in the
unallocated materials structure.
Only batches in pending or WIP status can be certified. All steps are also certified at
this time. The batch header that is passed in must contain sufficient information to
identify the batch (firm planned orders are not eligible for certifying).
Following is the definition of Complete Batch:
Parameter
Required
In/Out
Description
p_del_incomplete_
manual
IN
p_ignore_shortages
IN
p_batch_header
IN
x_batch_header
OUT
x_unallocated_material Y
OUT
Description
batch_id
Complete Batch
Parameter
Description
batch_no
plant_code
batch_type
actual_start_date
Actual start date and time for batch. Entered in complete batch
only if the batch was pending. Defaults to current system date.
actual_cmplt_date
Description
batch_id
batch_no
material_detail_id
line_type
line_no
item_id
item_no
Item Number.
alloc_qty
unalloc_qty
Complete Batch
Parameter
Description
alloc_uom
Complete Steps
Complete Steps
The complete batch step API is a business object that can complete a single batch
step or multiple batch steps based on certain criteria. Completing a step is the way
that output quantities are specified (or defaulted) for items yielded in the step.
Actual resource usage for all the resources is also calculated. The API operates on
steps that have a status of WIP or pending. If this is the final step, then completing
it completes the batch if the GME:Step Controls Batch Status profile options is set to
Yes.
If any of the ingredients, products, or byproducts associated with the step that have
a consumption or yield type of Automatic by Step are not allocated, then the
complete batch step routine returns the unallocated material lines, or incomplete
manual in the unallocated materials structure.
Following is the definition of Complete Step:
Parameter
Required
In/Out
Description
p_del_incomplete_
manual
IN
p_ignore_shortages
IN
p_batch_step
IN
p_override_quality
IN
x_batch_step
OUT
x_unallocated_material Y
OUT
Complete Steps
Description
batch_id
batchstep_no
batchstep_id
actual_start_date
Actual start date and time for batch step. Entered in complete
step only if the step was pending. Defaults to current system
date.
actual_cmplt_date
Description
batch_id
batch_no
material_detail_id
line_type
line_no
item_id
item_no
Item Number.
Complete Steps
Parameter
Description
alloc_qty
unalloc_qty
alloc_uom
Required
In/Out
Description
p_enforce_vldt_check
IN
p_batch_header
IN
x_batch_header
OUT
p_batch_size
IN
p_num_batches
IN
p_validity_rule_id
IN
p_validity_rule_tab
IN
p_leadtime
IN
p_batch_offset
IN
p_offset_type
IN
p_plan_start_date
IN
p_plan_cmplt_date
IN
p_use_for_all
IN
Description
batch_id
batch_no
plant_code
batch_type
Description
validity_rule_id
Validity Rule ID
Create Batch
Create Batch
The Create Batch API is a publicly callable stored procedure that creates batches, lab
batches, and firm planned orders in OPM.
Batch creation is affected by calling the API with a set of parameters that indicates
the following:
n
Which recipe to use for the batch (lab batch or firm planned order).
If the batch, lab batch, or firm planned order is created successfully, then the API
returns with a status of S. If errors occur, then the return status is E for errors that
are normal but prevent the batch from being created, and U for errors that are
unexpected and prevent the batch from being created, such as database errors.
On successful creation, a fully populated batch header is returned to the caller with
any values that were not filled in, so that the caller has immediate knowledge of the
surrogates allocated.
Following is the definition of Create Batch:
Parameter
Required
In/Out
Description
p_batch_header
IN
x_batch_header
OUT
p_batch_size
IN
p_batch_size_uom
IN
p_creation_mode
IN
p_ignore_shortages
IN
Create Batch
Parameter
Required
In/Out
Description
p_recipe_id
IN
p_recipe_no
IN
p_recipe_version
IN
p_product_no
IN
p_product_id
IN
p_ignore_qty_below_
cap
IN
OUT
x_unallocated_material Y
Description
batch_no
plant_code
batch_type
plan_start_date
Planned start date and time for batch. Defaults to system date,
but can be overridden.
plan_cmplt_date
Create Batch
Parameter
Description
due_date
recipe_validity_rule_id
wip_whse_code
Description
batch_id
batch_no
material_detail_id
line_type
line_no
item_id
item_no
Item Number.
alloc_qty
unalloc_qty
alloc_uom
Create Phantom
Create Phantom
The Create Phantom API creates phantom batches based on the validity rule passed.
Following is the definition of Create Phantom:
Parameter
Required
In/Out
Description
p_material_details
IN
x_material_details
OUT
p_validity_rule_id
IN
p_ignore_shortages
IN
x_unallocated_material Y
OUT
p_batch_no
IN
Description
batch_id
line_type
line_no
Create Phantom
Parameter
Description
material_detail_id
Description
batch_id
batch_no
material_detail_id
line_type
line_no
item_id
item_no
Item Number.
alloc_qty
unalloc_qty
alloc_uom
Required
In/Out
Description
p_batch_no
IN
Batch number.
p_plant_code
IN
Organization code.
p_batchstep_activity_
id
IN
p_batchstep_no
IN
Step number.
p_activity
IN
Required
In/Out
Description
p_batch_no
IN
Batch number.
p_plant_code
IN
Organization code.
p_resource
IN
Resource name.
p_batchstep_no
IN
Step number.
p_activity
IN
Activity name.
p_batchstep_resource_
id
IN
Required
In/Out
Description
p_trans_id
IN
p_scale_phantom
IN
x_material_detail
OUT
x_def_tran_row
OUT
Required
In/Out
Description
p_material_detail
IN
Description
material_detail_id
line_no
line_type
batch_id
Delete Step
Delete Step
The Delete Step API deletes a step in the batch.
Following is the definition of Delete Step:
Parameter
Required
In/Out
Description
p_batch_step
IN
x_batch_step
OUT
Description
batchstep_id
batch_id
batchstep_no
Required
In/Out
Description
p_poc_trans_id
IN
p_end_date
IN
p_reason_code
IN
p_instance_id
IN
p_instance_no
IN
p_trans_date
IN
Incremental Backflushing
Incremental Backflushing
The Incremental Backflushing API is a business object that lets you incrementally
record production yield as it occurs and have ingredient consumption backflushed.
It can only be done on WIP or completed batches off of items with a yield or
consumption type of manual or incremental. You can not drive incremental
backflushing off of an item that has yield or consumption type of Automatic or
Automatic by Step. If any of the ingredients, products, or byproducts are not
allocated, then the incremental backflushing routine returns back the unallocated
material lines in the unallocated materials structure.
If batch_id is provided for the batch_header row and the material_details row, then
the batch_id provided in material_details is used. Subsequently, if the material_
detail_id is provided for the material_details row, then all batch_ids are ignored,
and the batch_id is calculated from the specified material_detail_id.
Following is the definition of Incremental Backflushing:
Parameter
Required
In/Out
Description
p_material_details
IN
p_qty
IN
p_trans_date
IN
p_qty_type
IN
Valid values are 0 - by increment qty, 1 new actual qty, and 2 - percentage of
plan.
p_backflush_phantoms
IN
p_ignore_shortages
IN
p_batch_header
IN
x_batch_header
OUT
p_adjust_cmplt
IN
Incremental Backflushing
Parameter
Required
x_unallocated_material Y
In/Out
Description
OUT
Description
batch_id
batch_no
plant_code
batch_type
Description
batch_id
batch_no
material_detail_id
line_type
Incremental Backflushing
Parameter
Description
line_no
item_id
item_no
Item Number.
alloc_qty
unalloc_qty
Quantity to be allocated.
alloc_uom
Required
In/Out
Description
p_batch_no
IN
Batch number.
p_plant_code
IN
Organization code.
p_ignore_qty_below_
cap
IN
p_batchstep_no
IN
Step number.
p_batchstep_activity
IN
p_batchstep_
resource_tab
IN
x_batchstep_
activity
OUT
Required
In/Out
Description
p_batch_no
IN
Batch number.
p_plant_code
IN
Organization code.
p_batchstep_no
IN
Step number.
p_activity
IN
Activity name.
p_ignore_qty_below_
cap
IN
p_batchstep_resource_
rec
IN
x_batchstep_resource_
rec
OUT
Description
batchstep_resource_id
batchstep_activity_id
cost_analysis_code
Parameter
Description
cost_cmpntcls_id
prim_rsrc_ind
scale_type
Scale type.
plan_rsrc_count
actual_rsrc_count
resource_qty_uom
capacity_uom
plan_rsrc_usage
actual_rsrc_usage
plan_rsrc_qty
actual_rsrc_qty
usage_uom
plan_start_date
actual_start_date
plan_cmplt_date
actual_cmplt_date
Description
batchstep_resource_id
Parameter
Description
batchstep_activity_id
cost_analysis_code
cost_cmpntcls_id
prim_rsrc_ind
scale_type
Scale type.
plan_rsrc_count
actual_rsrc_count
resource_qty_uom
capacity_uom
plan_rsrc_usage
actual_rsrc_usage
plan_rsrc_qty
actual_rsrc_qty
usage_uom
plan_start_date
actual_start_date
plan_cmplt_date
actual_cmplt_date
Required
In/Out
Description
p_batchstep_rsrc_id
IN
p_plant_code
IN
p_batch_no
IN
p_batchstep_no
IN
p_activity
IN
p_resource
IN
p_trans_date
IN
p_start_date
IN
p_end_date
IN
p_usage
IN
p_reason_code
IN
p_instance_id
IN
Parameter
Required
In/Out
Description
x_poc_trans_id
OUT
p_instance_no
IN
Required
In/Out
Description
p_tran_row
IN
p_lot_no
IN
p_sublot_no
IN
p_create_lot
IN
p_ignore_shortage
IN
p_scale_phantom
IN
x_material_detail
OUT
x_tran_row
OUT
Parameter
Required
In/Out
Description
x_def_tran_row
OUT
Description
batch_id
The unique identifier for the batch where the allocation is being
added.
material_detail_id
The unique identifier for the material line where the allocation
is being added.
lot_id
The lot where the allocation is being added. Required for lot
controlled items. If the Lot ID is not passed, then the API uses
the p_lot_no and p_sublot_no to derive the lot_id.
whse_code
location
alloc_qty
trans_qty
trans_qty2
completed_ind
Parameter
Description
trans_date
reason_code
Required
In/Out
Description
p_material_detail
IN
p_batchstep_no
IN
x_material_detail
OUT
Description
batch_id
line_no
item_id
line_type
plan_qty
item_um
actual_qty
Parameter
Description
release_type
scrap_factor
scale_type
phantom_type
cost_alloc
text_code
ID which joins any rows of text in the table to the text table for
this application.
rounding_direction
contribute_yield_ind
contribute_step_qty_ind
wip_plan_qty
Insert Step
Insert Step
The Insert Step API inserts a new step into a batch. To insert a step, you must pass
in an operation.
Following is the definition of Insert Step:
Parameter
Required
In/Out
Description
p_batch_step
IN
x_batch_step
OUT
p_batch_header
IN
Description
batch_id
batchstep_no
oprn_id
plan_step_qty
actual_step_qty
The actual is not stored when the step is created. Either a Null
or zero is stored; will store the value stored today.
plan_start_date
Insert Step
Parameter
Description
actual_start_date
due_date
plan_cmplt_date
Based on the step planned start date and plus the time required
for step to complete.
actual_cmplt_date
step_close_date
step_status
steprelease_type
text_code
The ID that joins any rows of text in this table to the Text Table
for this application.
Required
In/Out
Description
p_batchstep_rsrc_id
IN
p_plant_code
IN
p_batch_no
IN
p_batchstep_no
IN
p_activity
IN
p_resource
IN
p_trans_date
IN
p_start_date
IN
p_end_date
IN
p_reason_code
IN
p_instance_id
IN
p_instance_no
IN
x_poc_trans_id
OUT
Release Batch
Release Batch
The Release Batch API is a business object that converts pending batches to work in
process (WIP) batches in OPM.
Batch release is affected by calling the API with a set of parameters that indicate
which batch to release and also an indication of whether the release can proceed in
the presence of inventory shortages.
The API applies equally to batches and lab batches, but any attempt to release a
firm planned order is rejected, as are attempts to release batches or lab batches that
have a status other than pending.
If the batch or lab batch is released successfully, then the API returns with a status
of S. If errors occur, then the return status is E for errors that are normal but prevent
the batch from being released, and U for errors that are unexpected and also prevent
the batch from being released, such as database errors.
On successful release, an updated batch header is returned to the caller with various
values updated (batch_status, actual_start_date) so there is immediate knowledge
of the new data.
Following is the definition of Release Batch:
Parameter
Required
In/Out
Description
p_ignore_shortages
IN
p_batch_header
IN
x_batch_header
OUT
x_unallocated_material Y
OUT
p_ignore_unalloc
IN
Release Batch
Description
batch_id
batch_no
plant_code
batch_type
actual_start_date
Actual start date and time for batch. If no date is passed in, it
defaults to the current system date and time.
Description
batch_id
batch_no
material_detail_id
line_type
line_no
item_id
item_no
Item Number.
alloc_qty
Release Batch
Parameter
Description
unalloc_qty
alloc_uom
Release Steps
Release Steps
The Release Step API is a business object that can release a single batch step or
multiple batch steps based on certain criteria. Releasing a step is how input
quantities are specified, or defaulted, for items used in the step. The API operates
on steps that have a status of pending and if prior steps are release type of
automatic, then these steps in the dependency chain are released before the selected
step is released. If the batch is pending and the GME:Step Controls Batch Status
profile option is set to Yes, then the batch is released prior to releasing the step.
If an ingredient is associated to the step and has a consumption type of Automatic
by Step, then that ingredient line is released. If that ingredient is not allocated, then
there is an attempt to allocate. Unallocated items and inventory shortages are
reported at this time.
Only batch steps in pending can be released. The batch step that is passed in must
contain sufficient information to identify the batch step (either batch_id and
batchstep_no or batchstep_id).
Following is the definition of Release Step:
Parameter
Required
In/Out
Description
p_ignore_shortages
IN
p_batch_step
IN
x_batch_step
OUT
x_unallocated_material Y
OUT
p_ignore_unalloc
IN
Release Steps
Parameter
Description
batchstep_id
batch_id
batchstep_no
actual_start_date
Actual start date and time for batch step. If no date is passed in,
it defaults to the current system date and time.
Description
batch_id
batch_no
material_detail_id
line_type
line_no
item_id
item_no
Item Number.
alloc_qty
unalloc_qty
Quantity to be allocated.
alloc_uom
Reopen Batch
Reopen Batch
Reopening a batch changes the status of the batch from closed to complete.
Only batches in a closed state can be reopened. The batch header that is passed in
must contain sufficient information to identify the batch (firm planned orders are
not eligible for reopening). You cannot reopen a batch where the transactions have
been purged, the batch has been migrated, the actual cost has been run and frozen,
or the GL posting is complete.
Following is the definition of Reopen Batch:
Parameter
Required
In/Out
Description
p_batch_header
IN
x_batch_header
OUT
p_reopen_steps
IN
Description
batch_id
batch_no
plant_code
batch_type
Reopen Steps
Reopen Steps
Reopening a batch step changes the status of the step from close to completed and
updates the step_close_date to Null.
This API only reopens the specified batch step (passed parameter).
Reopening a batch step can be done only on a batch that is not closed. The batch
step that is passed in must contain sufficient information to identify at least batch_
step_id.
Following is the definition of Reopen Step:
Parameter
Required
In/Out
Description
p_batch_step
IN
x_batch_step
OUT
Description
batchstep_id
batch_id
batchstep_no
Reroute Batch
Reroute Batch
The Reroute Batch API is a business object that can reroute a batch or firm planned
order to a different recipe with the same formula. Batches can only be rerouted in
pending status.
Following is the definition of Reroute Batch:
Parameter
Required
In/Out
Description
p_batch_header
IN
x_batch_header
OUT
p_validity_rule_id
IN
Description
batch_id
batch_no
plant_code
batch_type
Reschedule Batch
Reschedule Batch
The Reschedule Batch API is a business object that can reschedule a batch or firm
planned order to different date. A batch can only be rescheduled while in pending
or WIP state. A firm planned order can only be rescheduled when in a pending
state.
Following is the definition of Reschedule Batch:
Parameter
Required
In/Out
Description
p_batch_header
IN
x_batch_header
OUT
Description
batch_id
batch_no
plant_code
batch_type
plan_start_date
New planned start date and time for batch. This is passed in by
you, and can only be specified if the batch is pending.
plan_cmplt_date
New planned completion date and time for batch. This is passed
in by you.
Reschedule Step
Reschedule Step
The Reschedule Step API reschedules the step and all subsequent steps, if
requested.
Following is the definition of Reschedule Step:
Parameter
Required
In/Out
Description
p_batch_step
IN
x_batch_step
OUT
p_reschedule_other
IN
Description
batch_id
batchstep_no
batchstep_id
plan_start_date
New planned start date and time for step. This is passed in by
you, and can only be specified if the step is pending.
plan_cmplt_date
New planned completion date and time for step. This is passed
in by you.
Required
In/Out
Description
p_batch_header
IN
x_batch_header
OUT
Description
batch_id
batch_no
plant_code
batch_type
Required
In/Out
Description
p_batch_step
IN
x_batch_step
OUT
Description
batch_id
batchstep_no
batchstep_id
Scale Batch
Scale Batch
The Scale Batch API scales batches up or down, including phantom batches.
Following is the definition of Scale Batch:
Parameter
Required
In/Out
Description
p_scale_factor
IN
p_primaries
IN
p_batch_header
IN
x_batch_header
OUT
x_over_allocations
OUT
Description
batch_id
batch_no
plant_code
batch_type
Scale Batch
Description
batch_id
batch_no
material_detail_id
line_type
line_no
item_id
item_no
Item Number.
alloc_qty
unalloc_qty
alloc_uom
Required
In/Out
Description
p_batchstep_rsrc_id
IN
p_plant_code
IN
p_batch_no
IN
p_batchstep_no
IN
p_activity
IN
P_trans_date
IN
P_start_date
IN
P_reason_code
IN
P_instance_id
IN
P_instance_no
IN
Parameter
Required
In/Out
Description
x_rsrc_txn_id
OUT
x_poc_trans_id
OUT
Required
In/Out
Description
p_scale_factor
IN
p_batch_header
IN
x_batch_header
OUT
Description
batch_id
batch_no
plant_code
batch_type
Unrelease Batch
Unrelease Batch
The Unrelease Batch API reverses the completed transactions for the ingredient
lines. Unreleasing a batch sets the batch status to pending.
Only batches in WIP state can be unreleased. The batch header that is passed in
must contain sufficient information to identify the batch. Firm planned orders are
not eligible for unreleasing.
Following is the definition of Unrelease Batch:
Parameter
Required
In/Out
Description
p_batch_header
IN
x_batch_header
OUT
p_preserve_allocations
IN
Description
batch_id
batch_no
plant_code
batch_type
Unrelease Steps
Unrelease Steps
The Unrelease Steps API is a business object that can unrelease a batch step based
on certain criteria. Unreleasing a step sets the step back to pending status, and
reverses completed transactions for any ingredients consumed in the step that have
a consumption type of Automatic by Step.
Following is the definition of Unrelease Step:
Parameter
Required
In/Out
Description
p_batch_step
IN
x_batch_step
OUT
p_preserve_allocations
IN
Description
batch_id
batchstep_no
batchstep_id
Required
In/Out
Description
p_batchstep_rsrc_id
IN
p_plant_code
IN
p_batch_no
IN
p_batchstep_no
IN
p_activity
IN
p_resource
IN
p_trans_date
IN
p_start_date
IN
p_end_date
IN
p_usage
IN
p_reason_code
IN
p_instance_id
IN
p_instance_no
IN
Parameter
Required
In/Out
Description
x_poc_trans_id
OUT
Required
In/Out
Description
p_batch_no
IN
Batch number.
p_plant_code
IN
Organization code.
p_batchstep_no
IN
Step number.
p_batchstep_activity
IN
x_batchstep_
activity
OUT
Required
In/Out
Description
p_batch_no
IN
Batch number.
p_plant_code
IN
Organization code.
p_batchstep_no
IN
Step number.
p_activity
IN
Activity name.
p_resource
IN
Resource name.
p_ignore_qty_below_
cap
IN
p_batchstep_resource_
rec
IN
x_batchstep_resource_
rec
OUT
Parameter
Description
batchstep_resource_id
batchstep_activity_id
cost_analysis_code
cost_cmpntcls_id
prim_rsrc_ind
scale_type
Scale type.
plan_rsrc_count
actual_rsrc_count
resource_qty_uom
capacity_uom
plan_rsrc_usage
actual_rsrc_usage
plan_rsrc_qty
actual_rsrc_qty
usage_uom
plan_start_date
actual_start_date
plan_cmplt_date
actual_cmplt_date
Parameter
Description
batchstep_resource_id
batchstep_activity_id
cost_analysis_code
cost_cmpntcls_id
prim_rsrc_ind
scale_type
Scale type.
plan_rsrc_count
actual_rsrc_count
resource_qty_uom
capacity_uom
plan_rsrc_usage
actual_rsrc_usage
plan_rsrc_qty
actual_rsrc_qty
usage_uom
plan_start_date
actual_start_date
plan_cmplt_date
actual_cmplt_date
Required
In/Out
Description
p_tran_row
IN
p_lot_no
IN
p_sublot_no
IN
p_create_lot
IN
p_ignore_shortage
IN
p_scale_phantom
IN
x_material_detail
OUT
Parameter
Required
In/Out
Description
x_tran_row
OUT
x_def_tran_row
OUT
Description
trans_id
lot_id
whse_code
The warehouse code that you want to change to. If the whse_
code is changed, then the location must be revalidated.
location
alloc_qty
trans_qty
trans_qty2
completed_ind
Trans_Date
Reason_Code
Required
In/Out
Description
p_material_detail
IN
x_material_detail
OUT
p_values_tab
IN
p_scale_phantom
IN
Description
material_detail_id
batch_id
plan_qty
actual_qty
release_type
scrap_factor
Parameter
Description
scale_type
phantom_type
cost_alloc
text_code
ID which joins any rows of text in the table to the text table for
this application.
rounding_direction
contribute_yield_ind
contribute_step_qty_ind
wip_plan_qty
A
Messages and Errors
Handling Messages
APIs put result messages into a message list. Programs calling APIs can then get the
messages from the list and process them by either issuing them, loading them in a
database table, or writing them to a log file. Messages are stored in an encoded
format to enable API callers to find out message names by using the standard
functions provided by the message dictionary. It also stores these messages in
database tables and reports off these tables in different languages. The structure of
the message list is not public. Neither API developers nor API callers can access this
list except through calling the API message utility routines mentioned below.
The following utility functions are defined in the FND_MSG_PUB package, in the
file AFASMSGS.pls:
Initialize Initializes the API message list
Add Adds a message to the API message list
Get Gets a message from the API message list
Count_Msg Returns the number of messages in the API message list
Delete Deletes one or more messages from the API message list
Reset Resets the index used in getting messages
Count_And_Get Returns the number of messages in the API message list. If this
number is one, then it also returns the message data.
Handling Messages
To add a message to the API message list, developers can 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
can then call FND_MSG_PUB.Add to fetch 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 can use the procedure FND_
MSG_PUB.Get. This procedure operates in five modes:
First Gets the first message in the API message list
Next Gets the next message in the API message list
Last Gets the last message in the API message list
Previous Gets the previous message in the API message list
Specific Gets a specific message from the API message list
For overall better performance and reduction in the number of calls a program
needs to make in order to execute an API, it is recommended that APIs provide
their callers with the following information:
n
message count
message data
The message count holds the number of messages in the API message list. If this
number is one, then the message data holds the message in an encoded format.
x_msg_count
x_msg_data
OUT
OUT
NUMBER
VARCHAR2
Example:
PROCEDURE allocate_line (
p_material_details
IN
,p_alloc_type
IN
,p_api_version
IN
,p_validation_level
IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT
,x_message_list
OUT
,x_return_status
OUT
,p_del_exist_alloc
IN
gme_material_details%ROWTYPE
NUMBER DEFAULT 9
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
BOOLEAN := FALSE) IS
Handling Messages
l_api_name
CONSTANT VARCHAR2 (30)
l_material_details
gme_material_details%ROWTYPE;
l_batch_hdr
GME_BATCH_HEADER%ROWTYPE;
BEGIN
gme_debug.log_initialize('AllocateLine');
-- Initialize message list and count if needed
IF p_init_msg_list THEN
fnd_msg_pub.initialize;
gme_api_pub.error_count := 0;
END IF;
:= 'ALLOCATE_LINE';
Handling Messages
Save_batch');
l_batch_hdr.batch_id := p_material_details.batch_id;
save_batch(l_batch_hdr, x_return_status);
IF x_return_status = FND_API.G_RET_STS_SUCCESS THEN
COMMIT;
ELSE
gme_api_pub.log_message ('BATCH_SAVE_FAILED');
RAISE FND_API.g_exc_error;
END IF;
END IF;
IF error_count = 0 THEN
log_message ('GME_API_LINE_ALLOCATED');
END IF;
END IF;
gme_debug.put_line('Completed '||l_api_name ||' at '||to_
char(sysdate,'MM/DD/YYYY HH24:MI:SS'));
fnd_msg_pub.count_and_get (
p_count => x_message_count
,p_data => x_message_list);
EXCEPTION
WHEN FND_API.g_exc_error THEN
x_return_status := FND_API.G_RET_STS_ERROR;
fnd_msg_pub.count_and_get (
p_encoded => FND_API.g_false
,p_count => x_message_count
,p_data => x_message_list);
WHEN FND_API.g_exc_unexpected_error THEN
x_return_status := FND_API.g_ret_sts_unexp_error;
fnd_msg_pub.count_and_get (
p_encoded => FND_API.g_false
,p_count => x_message_count
,p_data => x_message_list);
WHEN OTHERS THEN
x_return_status := FND_API.g_ret_sts_unexp_error;
fnd_msg_pub.add_exc_msg (l_package_name, l_api_name);
fnd_msg_pub.count_and_get (
p_encoded => FND_API.g_false
,p_count => x_message_count
,p_data => x_message_list);
END allocate_line;
S for success
E for error
Message Name
BATCH_ALREADY_SAVED
BATCH_STATUS_NOT_UPDATED
GME_ACTIVITY_NOT_FOUND
GME_ACTV_DATES_NOT_ALLOWED
GME_ACTV_PLAN_DATE
Message Text
Message Name
GME_ALL_MATL_STEP_NOT_ASSOC
GME_API_ACTUAL_CANT_GO_NEG
GME_API_ACTUAL_COST_DONE_ERROR
GME_API_BATCH_ALLOCATED
GME_API_BATCH_CANCELLED
GME_API_BATCH_CERTIFIED
GME_API_BATCH_CLOSED
GME_API_BATCH_CREATED
GME_API_BATCH_FETCH_ERROR
GME_API_BATCH_HEADER_UPD_ERROR
GME_API_BATCH_LINES_LOCKED
GME_API_BATCH_RELEASED
GME_API_BATCH_REOPENED
GME_API_BATCH_REROUTED
GME_API_BATCH_STEP_FETCH_ERR
GME_API_BATCH_STEP_LINE_LCK
GME_API_BATCH_STEP_REOPEN_ERR
GME_API_BATCH_STEP_UPD_ERR
GME_API_BATCH_UNCERTIFIED
GME_API_BATCH_UNRELEASED
GME_API_CLOSE_STEP_STATUS
GME_API_COST_PERIOD_CLOSED
GME_API_COST_PERIOD_OPEN
Message Text
Message Name
GME_API_CREATE_BY_PROD_FAIL
GME_API_DEP_STEP_N_CLS
GME_API_DEP_STEP_REOPEN
GME_API_DEP_STEP_WIP
GME_API_GL_POSTED
GME_API_INCOMP_MANUAL_TRANS
GME_API_INV_BATCH_CERT_STEP
GME_API_INV_BATCH_CLOSE_STEP
GME_API_INV_BATCH_EDIT_STEP
GME_API_INV_BATCH_REL_STEP
GME_API_INV_BATCH_RESCHED
GME_API_INV_BATCH_STATUS_PC
GME_API_INV_BATCH_STATUS_REOP
GME_API_INV_BATCH_TYPE
GME_API_INV_BATCH_UNCERT_STEP
Message Text
Message Name
GME_API_INV_BATCH_UNRELE_STEP
GME_API_INV_DEP_STEP_UNRELE
GME_API_INV_PLAN_QTY_PC
GME_API_INV_RELEASE_TYPE
GME_API_INV_STAT_STEP_CERT
GME_API_INV_STAT_STEP_CLS
GME_API_INV_STAT_STEP_CNCL
GME_API_INV_STAT_STEP_EDIT
GME_API_INV_STAT_STEP_REL
GME_API_INV_STEP_STAT_RESCH
GME_API_INV_STEP_STAT_UNCERT
GME_API_INV_STEP_STAT_UNRELE
GME_API_INV_STEP_STATUS_REOP
GME_API_INVALID_BATCH_CANCEL
Message Text
Message Name
GME_API_INVALID_BATCH_CERTIFY
GME_API_INVALID_BATCH_REL
GME_API_INVALID_BATCH_REROUTE
GME_API_INVALID_BATCH_UNCERT
GME_API_INVALID_BATCH_UNREL
GME_API_INVALID_FORMULA
GME_API_INVALID_INCR_TYPE
GME_API_INVALID_RULE
GME_API_INVALID_STEP_UNREL
GME_API_INVALID_VALIDITY
GME_API_LINE_ALLOCATED
GME_API_LOCKING_FAILURE
GME_API_MARKED_FOR_DELETION
GME_API_MATL_DTL_FETCH_ERROR
GME_API_MATL_DTL_SETUP_FAILURE
GME_API_MATL_DTL_UPD_ERROR
GME_API_PARTIAL_CERTIFIED
GME_API_QTY_CANT_BE_ZERO
GME_API_REL_STEP_FUTURE_DATE
Message Text
Message Name
GME_API_RESCH_NO_DATES_PASSED
GME_API_RESCH_STEP_NO_DATE_CHG
GME_API_RESCH_STEP_NO_DATES
GME_API_RSRC_QTY_BELOW_CAP
GME_API_SAME_VALIDITY_RULE
Setup failed.
GME_API_SETUP_FAILURE
GME_API_START_OUT_VALIDITY
GME_API_STEP_ACTV_FTCH_ERR
GME_API_STEP_ACTV_UPD_ERR
Step is deleted.
GME_API_STEP_DELETE
GME_API_STEP_REOPENED
GME_API_STEP_UPD_ERROR
GME_API_TRANSACTIONS_PURGED
GME_API_UNABLE_TO_GET_CONSTANT
GME_API_UNALLOC_MATERIALS
GME_API_VALIDITY_DIFF_FORM
GME_API_WHSE_CLOSED
GME_API_WSHE_LOOKUP_FAILURE
GME_BAD_RECIPE_RETRIEVAL
Message Text
Message Name
GME_BATCH_IN_USE
GME_BATCH_NON_INVENTORY
GME_BATCH_STEP_CERTIFIED
GME_BATCH_STEP_CLOSED
GME_BATCH_STEP_NOT_FOUND
GME_BATCH_STEP_RELEASED
GME_BATCH_STEP_UNCERTIFIED
GME_BATCH_STEP_UNRELEASED
GME_CALC_CHARGE_CONV_ERROR
GME_DATE_IN_CLSD_PRD
GME_DATES_EXCEED_VALDTY_RULE
GME_DOC_NUM_NOT_PASSED
GME_DUP_BATCH
GME_FIRM_PLAN_STEP_ACT
GME_FORMID_CHG_NOT_ALLOWED
GME_FPO_NO_CREATE
GME_INSUF_VAL_RULE
GME_INV_COST_ALLOC_INS
GME_INV_COST_UPD_OPT
A-11
Message Text
Message Name
GME_INV_FORMULALINE
GME_INV_NEG_NOT_ALLOW
GME_INV_PHANT_UPD_REL
GME_INV_PHANTOM_TYPE
GME_INV_SHORT_EXISTS
GME_INV_STAT_UPD_PHANTOM_TYPE
GME_INV_STAT_UPD_PLAN_QTY
GME_INV_STAT_UPD_REL
GME_INV_STAT_UPD_SCRAP
GME_INV_STAT_UPD_WIP_PLAN
GME_INV_STATUS_INSERT_STEP
GME_INV_STEP_STATUS_ASQC
GME_INVAL_VAL_RULE_DATES
GME_INVALID_API_VERSION
GME_INVALID_BATCH_STATUS
GME_INVALID_BATCH_TYPE
GME_INVALID_DATE_RANGE
GME_INVALID_INSTANCE_ID
Message Text
Message Name
GME_INVALID_INSTANCE_NO
GME_INVALID_LINE_NO
GME_INVALID_LINE_TYPE
GME_INVALID_PLAN_QTY
GME_INVALID_PLANT
GME_INVALID_SCALE_TYPE
GME_INVALID_SCRAP_FACTOR
GME_INVALID_TEXT_CODE
GME_INVALID_WIP_PLAN_QTY
GME_ITEMID_CHG_NOT_ALLOWED
GME_LINE_NO_CHG_NOT_ALLOWED
GME_LINE_TYPE_CHG_NOT_ALLOWED
GME_MATL_DEL_INV_STAT
GME_MATL_INS_INV_STAT
GME_MATL_UPD_INV_STAT
GME_MISS_LINES_CONT_STEP
GME_NEG_USAGE_NT_ALWD
GME_NO_ACTIVITIES
A-13
Message Text
Message Name
GME_NO_DATA_FOUND
GME_NO_DEL_PHANT_ING
GME_NO_DEL_PHANT_PROD
GME_NO_KEYS
GME_NO_OPRN_DEFINED
GME_NO_PLANT_CODE_DEFINED
GME_NO_RESOURCES
GME_NO_STEP_FETCH_UNALL
GME_ONE_ING_PROD_REQD
GME_ONE_STEP_REQD
GME_PHANT_BATCH_EXISTS
GME_PLAN_ACTIVITY_REQD
GME_PLAN_RSRC_REQD
GME_PRIM_PROD_DEL_ERR
GME_QTY_UNMATCH_ALLOC
GME_RECORD_LOCKED
GME_RESOURCE_NOT_ATTACH
GME_RSRC_ACTUAL_DATE
Message Text
Message Name
GME_RSRC_COUNT_REQD
GME_RSRC_NOT_FOUND
GME_RSRC_PLAN_DATE
GME_RSRC_QTY_REQD
GME_RSRC_USG_NT_CNV_SYUOM
GME_RSRCID_NOT_FOUND
GME_RTXN_FOR_FPO_NT_ALWD
GME_RTXN_FOR_UPDINV_NT_ALWD
GME_START_DATE_REQD
GME_STEP_ACTIVITY_NOT_FOUND
GME_STEP_NOT_PENDING
GME_STEP_OVERLAP_ERROR
GME_STEP_QTY_LTHAN_ZERO
GME_STEP_REQD
GME_TRANS_REQD_FLD_MISSING
A-15
Message Text
Message Name
GME_TRANS_UPD_DATE
GME_UNEXPECTED_ERROR
GME_ZERO_ACT_FACT
INPUT_PARMS_MISS
INVALID_BATCH_TYPE_CLS_STEP
NO_DEFAULT_LOT_FOUND
PC_INV_BATCHSTEP_NO
PM_BADENDDATE
PM_BADSTARTDATE
No Transactions found.
PM_DEFAULT_TRANS_LOST
PM_INDIV_ALREADY_ALLOCD
Invalid item.
PM_INVALID_ITEM
PM_INVALID_PHANTOM_ACTION
PM_LOT_INDIV
PM_NO_ALLOC_CLASS
PM_NOTAPHANTOM
PM_NOTLOT_LOCT
PM_PHANTOM_EXISTS
PM_UNEXPLODED_PHANTOMS
Setup Error.
SETUP_ERROR
SY_NOFUTUREDATE
UNABLE_TO_LOAD_UOM
B
Listing of GMEPAPIS.pls
REM dbdrv: sql ~PROD ~PATH ~FILE none none none package &phase=pls \
REM dbdrv: checkfile:~PROD:~PATH:~FILE
SET VERIFY OFF
WHENEVER SQLERROR EXIT FAILURE ROLLBACK;
REM **********************************************************************
REM *
*
REM * FILE:
GMEPAPIS.pls
*
REM * PURPOSE: Package Specification for the GME PUBLIC API routines
*
REM * AUTHOR: Paul J Schofield, OPM Development
*
REM * DATE:
February 1st 2001
*
REM * HISTORY:
*
REM * ========
*
REM * 01FEB01 P.J.Schofield
*
REM *
Created
*
REM * 21MAR01 Thomas Daniel
*
REM *
Added unallocated materials record type definition
*
REM * 07MAY01 Thomas Daniel
*
REM *
Added Certify_Step, Uncertify_Step, Theoretical_Yield,
*
REM *
Reroute_Batch and Resource Consolidation routines
*
REM *
Created
*
REM * 08MAY01 Bharati Satpute
*
REM *
Added Close Batch, Close Steps routines Created
*
REM * 15MAY01 Shikha Nagar
*
REM *
Added Partial Certification Routines
*
REM * 23MAY01 Thomas Daniel
*
REM *
Added insert step routine
*
REM * 23MAY01 Bharati Satpute
*
REM *
Added Unrelease step routine
*
REM * 24MAY01 Thomas Daniel
*
REM *
Added Reschedule step routine
*
REM * 31MAY01 Olivier Daboval
*
REM *
Added Reopen_batch routine
*
Listing of GMEPAPIS.pls
B-1
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
REM
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
06JUN01
06JUN01
18JUN01
14AUG01
21AUG01
27AUG01
07JAN02
25APR02
03MAY02
21MAY02
11JUL02
29JUL02
22AUG02
5NOV02
26JAN03
15FEB03
25FEB03
19MAR03
22APR02
Olivier Daboval
*
Added reopen_step routine
*
Shrikant Nene
*
Changed gme_text_tbl to gme_text_table
*
Shrikant Nene
*
Added release_step routine
*
Thomas Daniel
*
Added call to material line APIs.
*
Pawan Kumar
*
Added call to convert_fpo APIs.
*
Pawan Kumar
*
Added call to scale_batch and theoretical_yield_batch.
*
BUG 2159185 - Added parameter
*
p_update_batch to determine if the batch planned end
*
date should be updated if the rescheduling goes past the *
batch's planned end date or if an error message should
*
be returned. Modified procedure reschedule_step.
*
BUG 2342448 - Thomas Daniel
*
Removed the word batch in the name of the procedures
*
certify_step and uncertify_step. Also removed the out
*
parameter from the delete_material_line procedure.
*
BUG 2359928 - Thomas Daniel
*
Added the new insert_line_allocation API.
*
BUG 2367604 - Thomas Daniel
*
Added the parameter p_delete_pending for close step.
*
Bug 2404032 - Shrikant Nene
*
Removed 2 parameters p_batch_size_uom ,p_schedule_method *
From convert_fpo procedure
*
Bug#2386578 - Shrikant Nene
*
Added new parameter p_batch_no to create_phantom procedure*
BUG 2498487 - Shrikant Nene
*
p_instance_id and p_instance_no
*
parameters are made optional in all the resource txn apis *
Also p_trans_date parameter is made optional in all the
*
end_cmplt_actual_rsrc_txn procedure
Bharati Satpute Added nocopy changes
Pawan Kumar
Bug - 2761758 - Added parameter p_trans_date *
to procedure partial_cert_batch
*
Shikha Nagar Bug2426663 Added update and delete procedures *
for line allocations
Shikha Nagar Bug2767914 - Added new procedures for rsrc API*
insert_resource update_resource and delete_resource
*
Antonia Newbury Bug2770619 - Added new procedures for
*
activity API - insert, update and delete
*
Pawan Kumar bug 2912743 added poc_trans_id to procedures
REM *
insert_timed_actual_rsrc_txn ,insert_incr_actual_rsrc_txn,
REM *
start_cmplt_actual_rsrc_txn, update_actual_resource_usage
REM **********************************************************************
/*************************************************************************
* This file contains the headers for the Process Execution (GME) APIs in *
* Oracle Process Manufacturing (OPM). Each procedure has a common set of *
* parameters to which API-specific parameters are appended.
*
*************************************************************************/
CREATE OR REPLACE PACKAGE gme_api_pub AS
/* $Header: GMEPAPIS.pls 115.60 2003/04/23 15:52:17 pxkumar noship $ */
api_version
CONSTANT NUMBER
:= 1;
max_errors
CONSTANT NUMBER
:= 100;
inv_short_err
CONSTANT VARCHAR2 (1)
:= 'V';
unalloc_items_err
CONSTANT VARCHAR2 (1)
:= 'N';
incomp_man_alloc_err
CONSTANT VARCHAR2 (1)
:= 'I';
negative_inventory
CONSTANT VARCHAR2 (1)
:= 'G';
setup_done
BOOLEAN
:=
FALSE;
user_name
VARCHAR2 (240);
user_ident
NUMBER;
login_id
NUMBER;
default_lot
VARCHAR2 (240);
default_loct
VARCHAR2 (240);
yield_type
VARCHAR2 (240);
yield_uom
VARCHAR2 (240);
allow_neg_inv
VARCHAR2 (240);
step_control
VARCHAR2 (240);
error_count
NUMBER
DEFAULT
0;
co_code
VARCHAR2 (4);
plant_code
VARCHAR2 (4);
copy_routing_text
VARCHAR2 (4);
copy_formula_text
VARCHAR2 (4);
TIMESTAMP
DATE;
release_type
NUMBER;
auto_release
CONSTANT NUMBER (5)
:= 0;
manual_release
CONSTANT NUMBER (5)
:= 1;
incremental_release
CONSTANT NUMBER (5)
:= 2;
step_release
CONSTANT NUMBER (5)
:= 3;
auto_auto_alloc
CONSTANT NUMBER (5)
:= 1;
user_auto_alloc
CONSTANT NUMBER (5)
:= 0;
epsilon
NUMBER;
batch_scale_factor
NUMBER;
routing_scale_factor
NUMBER;
Listing of GMEPAPIS.pls
B-3
warn_message
VARCHAR2 (240);
gmd_recipe_fetch_pub.recipe_rout_tbl;
gmd_recipe_fetch_pub.recipe_rout_matl_tbl;
gmd_recipe_fetch_pub.recipe_step_tbl;
step_dependencies
activities
resources
materials
return_code
recipe_id
gmd_recipe_fetch_pub.routing_depd_tbl;
gmd_recipe_fetch_pub.oprn_act_tbl;
gmd_recipe_fetch_pub.oprn_resc_tbl;
gmdfmval_pub.formula_detail_tbl;
NUMBER;
NUMBER;
/*==============================================================================
==
Procedure
log_message
Description
This procedure is used accross all the procedures to log a message to the
message stack.
Parameters
p_mesage_code (R)
The message which is being put onto the stack.
p_token1_name (R)
The name of the token1 in the message if any.
p_token1_value (R)
The value of the token1 in the message if it exists.
p_token2_name (R)
The name of the token2 in the message if any.
p_token2_value (R)
The value of the token2 in the message if it exists.
p_token3_name (R)
The name of the token3 in the message if any.
p_token3_value (R)
The value of the token3 in the message if it exists.
================================================================================
*/
PROCEDURE log_message (
p_message_code
IN
,p_token1_name
IN
,p_token1_value
IN
,p_token2_name
IN
,p_token2_value
IN
,p_token3_name
IN
,p_token3_value
IN
VARCHAR2
VARCHAR2
VARCHAR2
VARCHAR2
VARCHAR2
VARCHAR2
VARCHAR2
:=
:=
:=
:=
:=
:=
NULL
NULL
NULL
NULL
NULL
NULL);
/*==============================================================================
==
FUNCTION
setup
Description
Listing of GMEPAPIS.pls
B-5
This function is used accross all the procedures to setup the profile
values
and constants. This function returns FALSE if any of the constants or
profiles
are not set properly.
Return Values
TRUE
If the setup is done successfully.
FALSE
If their are any errors in the setup.
================================================================================
*/
FUNCTION setup
RETURN BOOLEAN;
/*==============================================================================
==
Procedure
save_batch
Description
This procedure is used to consolidate all the transactions from the
temporary
tables and write them to the main tables.
Parameters
p_batch_header (R)
The batch header row to identify the batch
Following columns are used from this row.
batch_id (R) OR
plant_code (R)
batch_type (R)
batch_no (R)
x_return_status
outcome of the API call
S - Success
E - Error
U - Unexpected Error
p_commit Indicates whether to commit. This is defaulted to FALSE
so that all current code works as is.
================================================================================
*/
PROCEDURE save_batch
p_batch_header
,x_return_status
,p_commit
(
IN
OUT NOCOPY
IN
gme_batch_header%ROWTYPE
VARCHAR2
BOOLEAN := FALSE);
/*==============================================================================
==
Procedure
create_batch
Description
This procedure creates batch, then check for Items failing allocation and
inventory shortages.
Parameters
p_batch_header (R)
The batch header row to identify the batch
Following columns are used from this row.
plant_code (R)
recipe_validity_rule_id (R)
batch_type (R)
update_inventory_ind (R)
batch_no (R In case of manual document ordering)
plan_start_date (O)
plan_cmplt_date (O)
due_date (O)
wip_whse_code (O)
p_batch_size (R)
Batch Size (Total input, total output or product
quantity)
p_batch_size_uom (R)
UOM for p_batch_size
p_ignore_shortages (R)
Do not check for the inventory shortages
p_creation_mode (R)
How the batch is created
RECIPE
PRODUCT
TOTAL_OUTPUT
TOTAL_INPUT
p_recipe_id (O)
Recipe_id for which the batch is to be created.
p_recipe_no (O)
Recipe number along with recipe_version for
which the
batch is to be created.
p_recipe_version (O)
Version of the recipe for which the batch is t
be created.
p_product_no (O)
Item number for which the batch is to be
created.
p_product_id (O)
Item ID for which the batch is to be created.
p_ignore_qty_below_cap (O)Whether the batch is to be created or not, when
resource
quantity goes below minimum capacity of the
resource.
True (Default)
False
Listing of GMEPAPIS.pls
B-7
x_batch_header
x_unallocated_material
data
x_return_status
================================================================================
*/
PROCEDURE create_batch (
p_api_version
,p_validation_level
,p_init_msg_list
,p_commit
,x_message_count
,x_message_list
,x_return_status
,p_batch_header
,x_batch_header
,p_batch_size
,p_batch_size_uom
,p_creation_mode
,p_recipe_id
,p_recipe_no
,p_recipe_version
,p_product_no
,p_product_id
,p_ignore_qty_below_cap
,p_ignore_shortages
,x_unallocated_material
tab);
IN
IN
IN
IN
OUT
OUT
OUT
IN
OUT
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
OUT
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_header%ROWTYPE
gme_batch_header%ROWTYPE
NUMBER
VARCHAR2
VARCHAR2
NUMBER := NULL
VARCHAR2 := NULL
NUMBER := NULL
VARCHAR2 := NULL
NUMBER := NULL
BOOLEAN := TRUE
BOOLEAN
gme_api_pub.unallocated_materials_
/*==============================================================================
==
Procedure
create_phantom
Description
This procedure creates phantom batch based on the validity rule passsed
Parameters
p_material_details (R)
p_batch_no
(O)
p_validity_rule_id (R)
p_ignore_shortages (R)
x_material_details
the data
x_unallocated_material
x_return_status
================================================================================
*/
PROCEDURE create_phantom (
p_api_version
,p_validation_level
,p_init_msg_list
,p_commit
,x_message_count
,x_message_list
,x_return_status
,p_material_detail
,p_batch_no
,x_material_detail
,p_validity_rule_id
,p_ignore_shortages
,x_unallocated_material
tab);
IN
IN
IN
IN
OUT
OUT
OUT
IN
IN
OUT
IN
IN
OUT
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_material_details%ROWTYPE
VARCHAR2 DEFAULT NULL
gme_material_details%ROWTYPE
NUMBER
BOOLEAN
gme_api_pub.unallocated_materials_
/*==============================================================================
==
Procedure
release_batch
Description
This procedure releases batch and all the phantom batches
Before releaseing the batch, it tries to auto-allocate batch, check
for inventory shortages.
Listing of GMEPAPIS.pls
B-9
Parameters
p_batch_header (R)
p_ignore_shortages (R)
p_ignore_unalloc (R)
x_batch_header
x_unallocated_material
data
x_return_status
================================================================================
*/
PROCEDURE release_batch (
p_api_version
,p_validation_level
,p_init_msg_list
,p_commit
,x_message_count
,x_message_list
,x_return_status
,p_batch_header
,x_batch_header
,p_ignore_shortages
,x_unallocated_material
,p_ignore_unalloc
IN
IN
IN
IN
OUT
OUT
OUT
IN
OUT
IN
OUT
IN
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_header%ROWTYPE
gme_batch_header%ROWTYPE
BOOLEAN
gme_api_pub.unallocated_materials_tab
BOOLEAN DEFAULT FALSE);
/*==============================================================================
==
Procedure
release_step
Description
This procedure releases step. If the batch is not in WIP state already and
the
GME: Step control batch status is set to true, this procedure will call
release_batch.
Before releaseing the step, it tries to auto-allocate batch, check
for inventory shortages.
Parameters
p_batch_step (R)
p_ignore_shortages (R)
p_ignore_unalloc (R)
x_batch_step
x_unallocated_material
data
x_return_status
================================================================================
*/
PROCEDURE release_step (
p_api_version
,p_validation_level
,p_init_msg_list
,p_commit
,p_batch_step
,x_message_count
,x_message_list
,x_return_status
,x_batch_step
,x_unallocated_material
,p_ignore_shortages
,p_ignore_unalloc
IN
IN
IN
IN
IN
OUT
OUT
OUT
OUT
OUT
IN
IN
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
gme_batch_steps%ROWTYPE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_steps%ROWTYPE
gme_api_pub.unallocated_materials_tab
BOOLEAN := FALSE
BOOLEAN := FALSE);
/*==============================================================================
==
Procedure
unrelease_batch
Description
This procedure unreleases batch and all the phantom batches
Parameters
p_batch_header (R)
x_return_status
data
================================================================================
*/
PROCEDURE unrelease_batch (
p_api_version
IN
,p_validation_level
IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT
,x_message_list
OUT
,x_return_status
OUT
,p_batch_header
IN
,x_batch_header
OUT
,p_preserve_allocations
IN
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NOCOPY NUMBER
NOCOPY VARCHAR2
NOCOPY VARCHAR2
gme_batch_header%ROWTYPE
NOCOPY gme_batch_header%ROWTYPE
BOOLEAN);
/*==============================================================================
==
Procedure
unrelease_step
Description
This procedure unreleases step.
Parameters
p_batch_step (R)
x_return_status
data
================================================================================
*/
PROCEDURE unrelease_step (
p_api_version
,p_validation_level
,p_init_msg_list
,p_commit
,x_message_count
,x_message_list
,x_return_status
,p_batch_step
,x_batch_step
,p_preserve_allocations
IN
IN
IN
IN
OUT
OUT
OUT
IN
OUT
IN
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_steps%ROWTYPE
gme_batch_steps%ROWTYPE
BOOLEAN);
/*==============================================================================
==
Procedure
certify_batch
Description
This procedure completes (certifies) batch and all the phantom batches.
It also certifies all the steps.
While completing the batch, checks for inventory shortages.
Parameters
p_batch_header (R)
completion)
actual_cmplt_date (O)
p_ignore_shortages (R)
Do not check for the inventory shortages
p_del_incomplete_manual (R) Delete incomplete manual transactions
x_batch_header
data
x_unallocated_material
exists, or
x_return_status
================================================================================
*/
PROCEDURE certify_batch (
p_api_version
,p_validation_level
,p_init_msg_list
,p_commit
,x_message_count
,x_message_list
,x_return_status
,p_del_incomplete_manual
,p_ignore_shortages
,p_batch_header
,x_batch_header
,x_unallocated_material
tab);
IN
IN
IN
IN
OUT
OUT
OUT
IN
IN
IN
OUT
OUT
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
BOOLEAN := FALSE
BOOLEAN := FALSE
gme_batch_header%ROWTYPE
gme_batch_header%ROWTYPE
gme_api_pub.unallocated_materials_
/*==============================================================================
==
Procedure
certify_step
Description
This procedure completes (certifies) step. If this is the last step and
GME: Step controls Batch status is set then It also calls complete_batch.
While completing the step, checks for inventory shortages.
Parameters
p_batch_step (R)
completion)
actual_cmplt_date (O)
p_ignore_shortages (R)
Do not check for the inventory shortages
p_del_incomplete_manual (R) Delete incomplete manual transactions
x_batch_step
data
x_unallocated_material
exists, or
x_return_status
================================================================================
*/
PROCEDURE certify_step (
p_api_version
,p_validation_level
,p_init_msg_list
,p_commit
,x_message_count
,x_message_list
,x_return_status
,p_batch_step
,x_batch_step
,x_unallocated_material
,p_del_incomplete_manual
,p_ignore_shortages
,p_override_quality
IN
IN
IN
IN
OUT
OUT
OUT
IN
OUT
OUT
IN
IN
IN
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_steps%ROWTYPE
gme_batch_steps%ROWTYPE
gme_api_pub.unallocated_materials_tab
BOOLEAN := FALSE
BOOLEAN := FALSE
BOOLEAN := FALSE);
/*==============================================================================
==
Procedure
uncertify_batch
Description
This procedure reverts a completed batch to WIP and all the phantom
batches.
Parameters
p_batch_header (R)
x_batch_header
x_return_status
data
================================================================================
*/
PROCEDURE uncertify_batch (
p_api_version
IN
,p_validation_level IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT NOCOPY
,x_message_list
OUT NOCOPY
,x_return_status
OUT NOCOPY
,p_batch_header
IN
,x_batch_header
OUT NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_header%ROWTYPE
gme_batch_header%ROWTYPE);
/*==============================================================================
==
Procedure
uncertify_step
Description
This procedure reverts a step to WIP.
Parameters
p_batch_step (R)
completion)
actual_cmplt_date (O)
x_batch_step
x_return_status
data
S - Success
E - Error
U - Unexpected Error
================================================================================
*/
PROCEDURE uncertify_step (
p_api_version
IN
,p_validation_level IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT
,x_message_list
OUT
,x_return_status
OUT
,p_batch_step
IN
,x_batch_step
OUT
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_steps%ROWTYPE
gme_batch_steps%ROWTYPE);
/*==============================================================================
==
Procedure
close_batch
Description
This procedure closes batch and all the phantom batches.
It also closes all the steps.
Parameters
p_batch_header (R)
x_batch_header
x_return_status
data
================================================================================
*/
PROCEDURE close_batch (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
,p_init_msg_list
,p_commit
,x_message_count
,x_message_list
,x_return_status
,p_batch_header
,x_batch_header
IN
IN
IN
OUT
OUT
OUT
IN
OUT
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_header%ROWTYPE
gme_batch_header%ROWTYPE);
/*==============================================================================
==
Procedure
close_step
Description
This procedure closes step.
Parameters
p_batch_step (R)
p_delete_pending (R)
x_batch_step
x_return_status
data
================================================================================
*/
PROCEDURE close_step (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,x_message_count
OUT NOCOPY NUMBER
,x_message_list
OUT NOCOPY VARCHAR2
,x_return_status
OUT NOCOPY VARCHAR2
,p_batch_step
IN
gme_batch_steps%ROWTYPE
,p_delete_pending IN
BOOLEAN := FALSE
,x_batch_step
OUT NOCOPY
gme_batch_steps%ROWTYPE);
/*==============================================================================
==
Procedure
cancel_batch
Description
This procedure cancels batch and all the phantom batches.
It also cancels all the steps.
Parameters
p_batch_header (R)
x_batch_header
x_return_status
data
================================================================================
*/
PROCEDURE cancel_batch
p_api_version
,p_validation_level
,p_init_msg_list
,p_commit
,x_message_count
,x_message_list
,x_return_status
,p_batch_header
,x_batch_header
(
IN
IN
IN
IN
OUT
OUT
OUT
IN
OUT
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_header%ROWTYPE
gme_batch_header%ROWTYPE);
/*==============================================================================
==
Procedure
reopen_batch
Description
This procedure reopens batch and all the phantom batches.
It also reopens all the steps, if requested so.
Parameters
p_batch_header (R)
p_reopen_steps (O)
x_batch_header
x_return_status
data
================================================================================
*/
PROCEDURE reopen_batch (
p_api_version
IN
,p_validation_level IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT
,x_message_list
OUT
,x_return_status
OUT
,p_batch_header
IN
,p_reopen_steps
IN
,x_batch_header
OUT
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_header%ROWTYPE
BOOLEAN := FALSE
gme_batch_header%ROWTYPE);
/*==============================================================================
==
Procedure
reopen_step
Description
This procedure reopens step.
Parameters
p_batch_step (R)
x_batch_header
x_return_status
data
S - Success
E - Error
U - Unexpected Error
================================================================================
*/
PROCEDURE reopen_step (
p_api_version
IN
,p_validation_level IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT
,x_message_list
OUT
,x_return_status
OUT
,p_batch_step
IN
,x_batch_step
OUT
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_steps%ROWTYPE
gme_batch_steps%ROWTYPE);
/*==============================================================================
==
Procedure
reroute_batch
Description
This procedure reroutes batch (typically change the route associated with
the batch).
Parameters
p_batch_header (R)
p_validity_rule_id (R)
x_batch_header
x_return_status
data
================================================================================
*/
PROCEDURE reroute_batch (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
,p_init_msg_list
,p_commit
,x_message_count
,x_message_list
,x_return_status
,p_batch_header
,p_validity_rule_id
,x_batch_header
IN
IN
IN
OUT
OUT
OUT
IN
IN
OUT
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_header%ROWTYPE
NUMBER
gme_batch_header%ROWTYPE);
/*==============================================================================
==
Procedure
reschedule_batch
Description
This procedure reschedules batch and all the phantom batches.
It also reschedules all the steps, if requested so.
Parameters
p_batch_header (R)
x_batch_header
x_return_status
data
================================================================================
*/
PROCEDURE reschedule_batch
p_api_version
IN
,p_validation_level IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT
,x_message_list
OUT
,x_return_status
OUT
,p_batch_header
IN
(
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NOCOPY NUMBER
NOCOPY VARCHAR2
NOCOPY VARCHAR2
gme_batch_header%ROWTYPE
,x_batch_header
/*==============================================================================
==
Procedure
reschedule_step
Description
This procedure reschedules step and all the subsequent steps, if requested
so.
Parameters
p_batch_step (R)
p_reschedule_other (O)
x_batch_step
data
x_return_status
================================================================================
*/
PROCEDURE reschedule_step (
p_api_version
IN
,p_validation_level IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT NOCOPY
,x_message_list
OUT NOCOPY
,x_return_status
OUT NOCOPY
,p_batch_step
IN
,p_reschedule_other IN
,x_batch_step
OUT NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_steps%ROWTYPE
BOOLEAN := TRUE
gme_batch_steps%ROWTYPE);
/*==============================================================================
==
Procedure
scale_batch
Description
This procedure scaless batch up or down and all the phantom batches.
Parameters
p_batch_header (R)
p_scale_factor (R)
p_primaries (R)
p_qty_type (O)
quantities
x_batch_header
x_over_allocations
data
down
the batch, and the quantities are going below
allocations
x_return_status
================================================================================
*/
PROCEDURE scale_batch (
p_api_version
IN
,p_validation_level IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT
,x_message_list
OUT
,x_return_status
OUT
,x_over_allocations OUT
,p_batch_header
IN
,x_batch_header
OUT
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_api_pub.unallocated_materials_tab
gme_batch_header%ROWTYPE
gme_batch_header%ROWTYPE
,p_scale_factor
,p_primaries
,p_qty_type
IN
IN
IN
NUMBER
VARCHAR2
NUMBER DEFAULT 1);
/*==============================================================================
==
Procedure
theoretical_yield_batch
Description
This procedure calculates theoretical yield for the batch, and updates the
quantities for the product lines.
Parameters
p_batch_header (R)
p_scale_factor (R)
x_batch_header
x_return_status
data
================================================================================
*/
PROCEDURE theoretical_yield_batch
p_api_version
IN
,p_validation_level IN
,p_init_msg_list
IN
,x_message_count
OUT NOCOPY
,x_message_list
OUT NOCOPY
,p_commit
IN
,x_return_status
OUT NOCOPY
,p_batch_header
IN
,p_scale_factor
IN
(
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
NUMBER
VARCHAR2
BOOLEAN := FALSE
VARCHAR2
gme_batch_header%ROWTYPE
NUMBER);
/*==============================================================================
==
Procedure
allocate_batch
Description
This procedure auto-allocates batch and all the phantom batches.
Parameters
p_batch_header (R)
p_alloc_type (O)
auto-allocation
p_release_type (O)
p_del_exist_alloc (O)
allocationg.
x_batch_header
x_unallocated_material
data
get
allocated.
outcome of the API call
S - Success
E - Error
U - Unexpected Error
N - Items failed auto allocation
x_return_status
================================================================================
*/
PROCEDURE allocate_batch (
p_api_version
IN
,p_validation_level
IN
,p_init_msg_list
IN
,p_commit
IN
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
,x_message_count
,x_message_list
,x_return_status
,p_batch_header
,x_unallocated_material
,p_release_type
,p_alloc_type
,p_del_exist_alloc
OUT
OUT
OUT
IN
OUT
IN
IN
IN
NOCOPY NUMBER
NOCOPY VARCHAR2
NOCOPY VARCHAR2
gme_batch_header%ROWTYPE
NOCOPY gme_api_pub.unallocated_materials_tab
NUMBER DEFAULT 9
NUMBER DEFAULT 9
BOOLEAN DEFAULT FALSE);
/*==============================================================================
==
Procedure
allocate_line
Description
This procedure auto-allocates material detail line.
Parameters
p_material_details (R)
p_alloc_type (O)
auto-allocation
p_del_exist_alloc (O)
allocationg.
x_unallocated_material
get
x_return_status
allocated.
outcome of the API call
S - Success
E - Error
U - Unexpected Error
N - Items failed auto allocation
================================================================================
*/
PROCEDURE allocate_line (
p_material_details
,p_alloc_type
,p_api_version
,p_validation_level
,p_init_msg_list
,p_commit
,x_message_count
,x_message_list
,x_return_status
,p_del_exist_alloc
IN
gme_material_details%ROWTYPE
IN
NUMBER DEFAULT 9
IN
NUMBER := gme_api_pub.api_version
IN
NUMBER := gme_api_pub.max_errors
IN
BOOLEAN := FALSE
IN
BOOLEAN := FALSE
OUT NOCOPY NUMBER
OUT NOCOPY VARCHAR2
OUT NOCOPY VARCHAR2
IN
BOOLEAN := FALSE);
/*==============================================================================
==
Procedure
convert_fpo
Description
This procedure is used to convert the firm planned order to one of many
batches.
Parameters
p_batch_header (R)
p_batch_size (R)
p_num_batches (R)
p_validity_rule_id (R)
(if
converting to 1 batch or p_use_for_all is set to
True)
p_validity_rule_tab (O)
multiple batches)
p_leadtime (O)
p_batch_offset (O)
p_offset_type (O)
p_plan_start_date (R)
p_plan_cmplt_date (O)
p_use_for_all
(O)
x_return_status
U - Unexpected Error
N - Items failed auto allocation
V - Inventory shortages exist
================================================================================
*/
PROCEDURE convert_fpo (
p_api_version
,p_validation_level
,p_init_msg_list
,p_commit
,x_message_count
,x_message_list
,p_enforce_vldt_check
,x_return_status
,p_batch_header
,x_batch_header
,p_batch_size
,p_num_batches
,p_validity_rule_id
,p_validity_rule_tab
,p_leadtime
,p_batch_offset
,p_offset_type
,p_plan_start_date
,p_plan_cmplt_date
,p_use_for_all
IN
IN
IN
IN
OUT
OUT
IN
OUT
IN
OUT
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
BOOLEAN
VARCHAR2
gme_batch_header%ROWTYPE
gme_batch_header%ROWTYPE
NUMBER
NUMBER
NUMBER
gme_api_pub.recipe_validity_rule_tab
NUMBER DEFAULT 0
NUMBER DEFAULT 0
NUMBER DEFAULT 0
gme_batch_header.plan_start_date%TYPE
gme_batch_header.plan_cmplt_date%TYPE
BOOLEAN := TRUE);
/*==============================================================================
==
Procedure
delete_step
Description
This procedure deletes the step associated with the batch
Parameters
p_batch_step (R)
x_return_status
================================================================================
*/
PROCEDURE delete_step (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,x_message_count
OUT NOCOPY NUMBER
,x_message_list
OUT NOCOPY VARCHAR2
,x_return_status
OUT NOCOPY VARCHAR2
,p_batch_step
IN
gme_batch_steps%ROWTYPE);
/*==============================================================================
==
Procedure
insert_step
Description
This procedure inserts the new step to the batch
Parameters
p_batch_step (R)
x_batch_step
data
x_return_status
================================================================================
*/
PROCEDURE insert_step (
p_api_version
IN
,p_validation_level
IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT
,x_message_list
OUT
,x_return_status
OUT
,p_batch_header
IN
,p_batch_step
IN
,x_batch_step
OUT
NOCOPY
NOCOPY
NOCOPY
NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_batch_header%ROWTYPE
gme_batch_steps%ROWTYPE
gme_batch_steps%ROWTYPE);
/*==============================================================================
==
Procedure
partial_cert_batch
Description
This procedure is used to incrementally backflush the qty to the material
line.
Parameters
p_batch_header (R)
p_material_details (R)
line.
p_qty (R)
p_qty_type (R)
p_backflush_phantoms (R)
associated
p_ignore_shortages (R)
p_adjust_cmplt (R)
x_unallocated_material
get
x_return_status
allocated.
outcome of the API call
S - Success
E - Error
U - Unexpected Error
V - Inventory shortages
N - Items failed auto allocation
================================================================================
*/
PROCEDURE partial_cert_batch (
p_api_version
IN
,p_validation_level
IN
,p_init_msg_list
IN
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
,p_commit
,x_message_count
,x_message_list
,x_return_status
,p_batch_header
,p_material_details
,p_qty
,p_qty_type
,p_trans_date
,p_backflush_phantoms
,p_ignore_shortages
,p_adjust_cmplt
,x_unallocated_material
tab);
IN
OUT
OUT
OUT
IN
IN
IN
IN
IN
IN
IN
IN
OUT
BOOLEAN := FALSE
NOCOPY NUMBER
NOCOPY VARCHAR2
NOCOPY VARCHAR2
gme_batch_header%ROWTYPE
gme_material_details%ROWTYPE
NUMBER
NUMBER
DATE
BOOLEAN DEFAULT FALSE
BOOLEAN DEFAULT FALSE
BOOLEAN DEFAULT TRUE
NOCOPY gme_api_pub.unallocated_materials_
/*==============================================================================
==
Procedure
insert_material_line
Description
This procedure is used to insert the material line to the batch.
Parameters
p_material_detail (R)
line.
p_batchstep_no (O)
be associated.
x_material_detail
assigned.
x_return_status
================================================================================
*/
PROCEDURE insert_material_line (
p_api_version
IN
,p_validation_level
IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT NOCOPY
,x_message_list
OUT NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
,x_return_status
,p_material_detail
,p_batchstep_no
,x_material_detail
/*==============================================================================
==
Procedure
update_material_line
Description
This procedure is used to update the material line in the batch.
Parameters
p_material_detail (R)
update.
p_values_tab (R)
updated.
p_scale_phantom (O)
x_material_detail
assigned.
x_return_status
================================================================================
*/
PROCEDURE update_material_line (
p_api_version
IN
,p_validation_level
IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT NOCOPY
,x_message_list
OUT NOCOPY
,x_return_status
OUT NOCOPY
,p_material_detail
IN
,p_values_tab
IN
,p_scale_phantom
IN
,x_material_detail
OUT NOCOPY
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_material_details%ROWTYPE
gme_api_pub.field_values_tab
BOOLEAN := FALSE
gme_material_details%ROWTYPE);
/*==============================================================================
==
Procedure
delete_material_line
Description
This procedure is used to delete the material line in the batch.
Parameters
p_material_detail (R)
x_return_status
================================================================================
*/
PROCEDURE delete_material_line (
p_api_version
IN
,p_validation_level
IN
,p_init_msg_list
IN
,p_commit
IN
,x_message_count
OUT NOCOPY
,x_message_list
OUT NOCOPY
,x_return_status
OUT NOCOPY
,p_material_detail
IN
NUMBER := gme_api_pub.api_version
NUMBER := gme_api_pub.max_errors
BOOLEAN := FALSE
BOOLEAN := FALSE
NUMBER
VARCHAR2
VARCHAR2
gme_material_details%ROWTYPE);
/*==============================================================================
==
Procedure
insert_line_allocation
Description
This procedure is used to insert a pending or complete line allocation for
an
existing batch material line.
Parameters
p_tran_row (R)
p_lot_no (O)
id
p_sublot_no (O)
id
is not passed in)
to be scaled.
The updated material line.
The updated transaction row.
The default transaction row with any
outcome of the API call
S - Success
E - Error
U - Unexpected Error
================================================================================
*/
PROCEDURE insert_line_allocation (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_tran_row
IN
gme_inventory_txns_gtmp%ROWTYPE
,p_lot_no
IN
VARCHAR2 DEFAULT NULL
,p_sublot_no
IN
VARCHAR2 DEFAULT NULL
,p_create_lot
IN
BOOLEAN DEFAULT FALSE
,p_ignore_shortage
IN
BOOLEAN DEFAULT FALSE
,p_scale_phantom
IN
BOOLEAN DEFAULT FALSE
,x_material_detail
OUT NOCOPY gme_material_details%ROWTYPE
,x_tran_row
OUT NOCOPY gme_inventory_txns_gtmp%ROWTYPE
,x_def_tran_row
OUT NOCOPY gme_inventory_txns_gtmp%ROWTYPE
,x_message_count
OUT NOCOPY NUMBER
,x_message_list
OUT NOCOPY VARCHAR2
,x_return_status
OUT NOCOPY VARCHAR2);
/*==============================================================================
==
Procedure
update_actual_rsrc_usage
Description
This procedure is used to insert a complete resource txn allocation for a
resource.This procedure removes all the existing resource txn for the
specified
resource.This API can be used only for a WIP or Complete step.
Parameters
p_batchstep_rsrc_id (O)
p_plant_code (R)
p_batch_no (R)
p_batchstep_no (R)
p_activity (R)
p_resource (R)
p_trans_date (R)
p_start_date (R)
p_end_date (R)
p_usage (R)
p_reason_code (R)
p_instance_id (O)
p_instance_no (O)
x_return_status
================================================================================
*/
PROCEDURE update_actual_rsrc_usage (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_batchstep_rsrc_id IN
NUMBER
,p_plant_code
IN
VARCHAR2 := NULL
,p_batch_no
IN
VARCHAR2 := NULL
,p_batchstep_no
IN
NUMBER := NULL
,p_activity
IN
VARCHAR2 := NULL
,p_resource
IN
VARCHAR2 := NULL
,p_trans_date
IN
DATE
,p_start_date
IN
DATE
,p_end_date
IN
DATE
,p_usage
IN
NUMBER
,p_reason_code
IN
VARCHAR2
,p_instance_id
IN
NUMBER := NULL
,p_instance_no
IN
NUMBER := NULL
,x_poc_trans_id
OUT NOCOPY
NUMBER
,x_message_count
OUT NOCOPY NUMBER
,x_message_list
OUT NOCOPY VARCHAR2
,x_return_status
OUT NOCOPY VARCHAR2);
/*==============================================================================
==
Procedure
insert_incr_actual_rsrc_txn
Description
This procedure is used to incrementally insert a complete resource txn
allocation for a
resource.This API can be used only for a WIP or Complete step.
Parameters
p_batchstep_rsrc_id (R)
p_plant_code (O)
p_batch_no (O)
p_batchstep_no (O)
p_activity (O)
p_resource (O)
p_trans_date (R)
p_start_date (R)
p_end_date (R)
p_usage (R)
p_reason_code (R)
p_instance_id (O)
p_instance_no (O)
x_return_status
================================================================================
*/
PROCEDURE insert_incr_actual_rsrc_txn (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_batchstep_rsrc_id IN
NUMBER
,p_plant_code
IN
VARCHAR2 := NULL
,p_batch_no
IN
VARCHAR2 := NULL
,p_batchstep_no
IN
NUMBER := NULL
,p_activity
IN
VARCHAR2 := NULL
,p_resource
IN
VARCHAR2 := NULL
,p_trans_date
IN
DATE
,p_start_date
IN
DATE
,p_end_date
IN
DATE
,p_usage
,p_reason_code
,p_instance_id
,p_instance_no
,x_poc_trans_id
,x_message_count
,x_message_list
,x_return_status
IN
NUMBER
IN
VARCHAR2
IN
NUMBER := NULL
IN
NUMBER := NULL
OUT NOCOPY
NUMBER
OUT NOCOPY NUMBER
OUT NOCOPY VARCHAR2
OUT NOCOPY VARCHAR2);
/*==============================================================================
==
Procedure
insert_timed_actual_rsrc_txn
Description
This procedure is used to insert a complete resource txn allocation for a
resource.usage is calculated from txn dates supplied.
This API can be used only for a WIP or Complete step.
Parameters
p_batchstep_rsrc_id (R)
p_plant_code (O)
p_batch_no (O)
p_batchstep_no (O)
p_activity (O)
p_resource (O)
p_trans_date (R)
p_start_date (R)
p_end_date (R)
p_reason_code (R)
p_instance_id (O)
p_instance_no (O)
x_return_status
================================================================================
*/
PROCEDURE insert_timed_actual_rsrc_txn (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_batchstep_rsrc_id IN
NUMBER
,p_plant_code
,p_batch_no
,p_batchstep_no
,p_activity
,p_resource
,p_trans_date
,p_start_date
,p_end_date
,p_reason_code
,p_instance_id
,p_instance_no
,x_poc_trans_id
,x_message_count
,x_message_list
,x_return_status
IN
VARCHAR2 := NULL
IN
VARCHAR2 := NULL
IN
NUMBER := NULL
IN
VARCHAR2 := NULL
IN
VARCHAR2 := NULL
IN
DATE
IN
DATE
IN
DATE
IN
VARCHAR2
IN
NUMBER := NULL
IN
NUMBER := NULL
OUT NOCOPY
NUMBER
OUT NOCOPY NUMBER
OUT NOCOPY VARCHAR2
OUT NOCOPY VARCHAR2);
/*==============================================================================
==
Procedure
start_cmplt_actual_rsrc_txn
Description
This procedure is used to start a complete resource txn for a resource.
usage of the txn is 0 as the txn has just started.end_cmplt_actual_rsrc_
txn
API is used to complete a started txn
Parameters
p_batchstep_rsrc_id (R)
batch step resource id of a resoure
p_plant_code (O)
Plant code of the batch.
p_batch_no (O)
Batch no.
p_batchstep_no (O)
Batch Step no .
p_activity (O)
Activity.
p_resource (O)
Resource.
p_trans_date (R)
Transaction date
p_start_date (R)
start date of txn
p_reason_code (R)
reason code for adding a completed txn
p_instance_id (O)
instance id - for WPS use
p_instance_no (O)
instance no - for WPS use
x_return_status
outcome of the API call
S - Success
E - Error
U - Unexpected Error
================================================================================
*/
PROCEDURE start_cmplt_actual_rsrc_txn (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_batchstep_rsrc_id IN
NUMBER
,p_plant_code
IN
VARCHAR2 := NULL
,p_batch_no
IN
VARCHAR2 := NULL
,p_batchstep_no
IN
NUMBER := NULL
,p_activity
IN
VARCHAR2 := NULL
,p_resource
IN
VARCHAR2 := NULL
,p_trans_date
IN
DATE
,p_start_date
IN
DATE
,p_reason_code
IN
VARCHAR2
,p_instance_id
IN
NUMBER := NULL
,p_instance_no
IN
NUMBER := NULL
,x_poc_trans_id
OUT NOCOPY
NUMBER
,x_message_count
OUT NOCOPY NUMBER
,x_message_list
OUT NOCOPY VARCHAR2
,x_return_status
OUT NOCOPY VARCHAR2);
/*==============================================================================
==
Procedure
end_cmplt_actual_rsrc_txn
Description
This procedure is used to end a rsrc txn that was started earlier using
start_cmplt_actual_rsrc_txn API. The usage of specified txn must be 0.
Parameters
p_poc_trans_id (R)
p_trans_date (O)
p_end_date (R)
p_usage (R)
p_reason_code (R)
p_instance_id (O)
p_instance_no (O)
x_return_status
================================================================================
*/
PROCEDURE end_cmplt_actual_rsrc_txn (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_poc_trans_id
IN
NUMBER
,p_trans_date
IN
DATE := NULL
,p_end_date
IN
DATE
,p_reason_code
IN
VARCHAR2
,p_instance_id
IN
NUMBER := NULL
,p_instance_no
IN
NUMBER := NULL
,x_message_count
OUT NOCOPY NUMBER
,x_message_list
OUT NOCOPY VARCHAR2
,x_return_status
OUT NOCOPY VARCHAR2);
/*==============================================================================
==
Procedure
update_line_allocation
Description
This procedure is used to update a pending or complete line allocation for
an
existing batch material line.
Parameters
p_tran_row (R)
required
p_lot_no (O)
id
p_sublot_no (O)
id
is not passed in)
p_create_lot (O)TRUE, if the lot has to be created on fly for
prod/by-prod.
p_ignore_shortage (O)
TRUE, if any shortages have to be ignored.
p_scale_phantom (O)
TRUE, if the allocation is for phantom and it
has
to be scaled.
x_material_detail
The updated material line.
x_tran_row
The updated transaction row.
x_def_tran_row
The default transaction row with any
adjustments.
x_return_status
================================================================================
*/
PROCEDURE update_line_allocation (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_tran_row
IN
gme_inventory_txns_gtmp%ROWTYPE
,p_lot_no
IN
VARCHAR2 DEFAULT NULL
,p_sublot_no
IN
VARCHAR2 DEFAULT NULL
,p_create_lot
IN
BOOLEAN DEFAULT FALSE
,p_ignore_shortage
IN
BOOLEAN DEFAULT FALSE
,p_scale_phantom
IN
BOOLEAN DEFAULT FALSE
,x_material_detail
OUT NOCOPY gme_material_details%ROWTYPE
,x_tran_row
OUT NOCOPY gme_inventory_txns_gtmp%ROWTYPE
,x_def_tran_row
OUT NOCOPY gme_inventory_txns_gtmp%ROWTYPE
,x_message_count
OUT NOCOPY NUMBER
,x_message_list
OUT NOCOPY VARCHAR2
,x_return_status
OUT NOCOPY VARCHAR2);
/*==============================================================================
==
Procedure
delete_line_allocation
Description
This procedure is used to delete a pending or complete line allocation for
an
existing batch material line.
Parameters
p_trans_id (R)
p_scale_phantom
(O)
has
x_material_detail
x_def_tran_row
adjustments.
x_return_status
to be scaled.
The updated material line.
The default transaction row with any
outcome of the API call
S - Success
E - Error
U - Unexpected Error
================================================================================
*/
PROCEDURE delete_line_allocation (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_trans_id
IN
NUMBER
,p_scale_phantom
IN
BOOLEAN DEFAULT FALSE
,x_material_detail
OUT NOCOPY gme_material_details%ROWTYPE
,x_def_tran_row
OUT NOCOPY gme_inventory_txns_gtmp%ROWTYPE
,x_message_count
OUT NOCOPY NUMBER
,x_message_list
OUT NOCOPY VARCHAR2
,x_return_status
OUT NOCOPY VARCHAR2);
/*==============================================================================
==
Procedure
insert_batchstep_resource
Description
This procedure is used to insert a resource for an activity of a step
Parameters
p_batchstep_resource (R)
p_plant_code (O)
p_batch_no (O)
p_batchstep_no(O)
p_activity (O)
p_ignore_qty_below_cap (R)
capacity
x_batchstep_resource (O)
update etc
x_return_status
================================================================================
*/
PROCEDURE insert_batchstep_resource (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_batchstep_resource_rec IN
GME_BATCH_STEP_RESOURCES%ROWTYPE
,p_plant_code
IN
VARCHAR2 := NULL
,p_batch_no
IN
VARCHAR2 := NULL
,p_batchstep_no
IN
NUMBER
:= NULL
,p_activity
IN
VARCHAR2 := NULL
,p_ignore_qty_below_cap IN
BOOLEAN
,x_batchstep_resource_rec
OUT
GME_BATCH_STEP_RESOURCES%ROWTYPE
,x_message_count
OUT
NUMBER
,x_message_list
OUT
VARCHAR2
,x_return_status
OUT
VARCHAR2);
/*==============================================================================
==
Procedure
update_batchstep_resource
Description
This procedure is used to update an existing resource of an activity of a
step
Parameters
p_batchstep_resource (R)
rsrc to be updated for an activity
p_plant_code (O)
organization code
p_batch_no (O)
batch number
p_batchstep_no(O)
batch step number
p_activity (O)
batch step activity
p_ignore_qty_below_cap (R) controls - allow rsrc_qty going below rsrc
capacity
x_batchstep_resource (O)
newly updated rsrc row, can be used for update
etc
x_return_status
outcome of the API call
S - Success
E - Error
U - Unexpected Error
================================================================================
*/
PROCEDURE update_batchstep_resource (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_batchstep_resource_rec
IN
GME_BATCH_STEP_RESOURCES%ROWTYPE
,p_plant_code
IN
VARCHAR2 := NULL
,p_batch_no
IN
VARCHAR2 := NULL
,p_batchstep_no
,p_activity
,p_ignore_qty_below_cap
,x_batchstep_resource_rec
,x_message_count
OUT
,x_message_list
OUT
,x_return_status
OUT
IN
IN
IN
OUT
NUMBER := NULL
VARCHAR2 := NULL
BOOLEAN
GME_BATCH_STEP_RESOURCES%ROWTYPE
NUMBER
VARCHAR2
VARCHAR2);
/*==============================================================================
==
Procedure
delete_batchstep_resource
Description
This procedure is used to delete an existing resource of an activity of a
step
Parameters
p_batchstep_resource_id (R) uniquely identifies a rsrc
p_plant_code (O)
organization code
p_batch_no (O)
batch number
p_batchstep_no(O)
batch step number
p_activity (O)
batch step activity
p_reosurce (O)
batch step activity resource
x_return_status
outcome of the API call
S - Success
E - Error
U - Unexpected Error
================================================================================
*/
PROCEDURE delete_batchstep_resource (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_batchstep_resource_id IN
NUMBER
,p_plant_code
IN
VARCHAR2 := NULL
,p_batch_no
IN
VARCHAR2 := NULL
,p_batchstep_no
IN
NUMBER := NULL
,p_activity
IN
VARCHAR2 := NULL
,p_resource
IN
VARCHAR2 := NULL
,x_message_count
OUT
NUMBER
,x_message_list
OUT
VARCHAR2
,x_return_status
OUT
VARCHAR2);
/*==============================================================================
==
Procedure
insert_batchstep_activity
Description
This procedure is used to insert an activity for a step
Parameters
p_batchstep_activity (R)
activity to be inserted for a step
p_batchstep_resource_tab (R) one or more resources to be inserted for the
activity
p_plant_code (O)
organization code
p_batch_no (O)
batch number
p_batchstep_no(O)
batch step number
p_ignore_qty_below_cap (R) controls - allow rsrc_qty going below rsrc
capacity
x_batchstep_activity
newly inserted activity row, can be used for
update etc
x_return_status
outcome of the API call
S - Success
E - Error
U - Unexpected Error
================================================================================
*/
PROCEDURE insert_batchstep_activity (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_batchstep_activity IN
GME_BATCH_STEP_ACTIVITIES%ROWTYPE
,p_batchstep_resource_tab IN
gme_api_create_step.resources_tab
,p_plant_code
IN
VARCHAR2 := NULL
,p_batch_no
IN
VARCHAR2 := NULL
,p_batchstep_no
IN
NUMBER
:= NULL
,p_ignore_qty_below_cap
IN
BOOLEAN
,x_batchstep_activity OUT GME_BATCH_STEP_ACTIVITIES%ROWTYPE
,x_message_count
OUT
NUMBER
,x_message_list
OUT
VARCHAR2
,x_return_status
OUT
VARCHAR2 );
/*==============================================================================
==
Procedure
update_batchstep_activity
Description
This procedure is used to update an activity for a step
Parameters
p_batchstep_activity (R)
p_plant_code (O)
p_batch_no (O)
p_batchstep_no(O)
x_batchstep_activity
x_return_status
activity to be updated
organization code
batch number
batch step number
updated activity row
outcome of the API call
S - Success
E - Error
U - Unexpected Error
================================================================================
*/
PROCEDURE update_batchstep_activity (
p_api_version
IN
NUMBER := gme_api_pub.api_version
,p_validation_level
IN
NUMBER := gme_api_pub.max_errors
,p_init_msg_list
IN
BOOLEAN := FALSE
,p_commit
IN
BOOLEAN := FALSE
,p_batchstep_activity IN
GME_BATCH_STEP_ACTIVITIES%ROWTYPE
,p_plant_code
IN
VARCHAR2 := NULL
,p_batch_no
IN
VARCHAR2 := NULL
,p_batchstep_no
IN
NUMBER
:= NULL
,x_batchstep_activity OUT GME_BATCH_STEP_ACTIVITIES%ROWTYPE
,x_message_count
OUT
NUMBER
,x_message_list
OUT
VARCHAR2
,x_return_status
OUT
VARCHAR2 );
/*==============================================================================
==
Procedure
delete_batchstep_activity
Description
This procedure is used to delete an activity from a step. Note that
either the
activity_id must be provided or the combination of plant_code, batch_no,
batchstep_no,
and activity in order to uniquely identify an activity to be deleted.
Parameters
Glossary
Application Programming Interface (API)
A documented, supported method for communicating within or between modules.
Business Object
An independent item of significance in the business world. An example of a
business object is a sales order.
Business Process API
An API that performs a transaction for the calling module, e.g., to hire an employee,
enter an order, or cost a material movement transaction.
Entity
An item of significance in the business world, that has no meaning without
reference to a business object. An example of an entity is a sales order header. A
Sales Order Header is an entity of the business object sales order.
Group API
An API intended for use by other authorized Oracle Applications.
Module
A module is a collection of one or more business objects and the associated
transactions. A module publishes APIs for other modules and accesses other
modules through their published APIs. An example of a module is Oracle
Inventory.
Public API
An API intended for use by all applications.
Glossary-1
Private API
An API intended for use by the owning module only.
Glossary-2
Index
A
AFASMSGS.pls, A-1
Allocate Batch, 1-6, 4-1
Allocate Line, 1-6, 4-3
allocate_batch, 3-2
allocate_line, 3-2
API Wrapper Code, 2-3
Application Programming Interface (API), 1
B
Batch File, 1-4
Business Object, 1
Business Objects, 4-1
Business Process API, 1
C
Cancel Batch, 1-6, 4-4
cancel_batch, 3-2
certify_batch, 3-2
certify_batch_step, 3-2
Close Batch, 1-6, 4-6
Close Steps, 1-6, 4-7
close_batch, 3-2
close_step, 3-2
Code Re-Use, 1-4
Complete Batch, 1-6, 4-8
Complete Steps, 1-7, 4-11
Consistent Behavior, 1-4
Convert FPO to Batches, 1-7, 4-14
convert_fpo, 3-2
Create Batch, 1-7, 4-16
D
Delete Batch, 1-7
Delete Batchstep Activity, 1-7, 4-21
Delete Batchstep Resource, 4-22
Delete Line Allocation, 4-23
Delete Line Allocations, 1-7
Delete Material Detail Line, 1-8, 4-24
Delete Step, 1-8, 4-25
delete_batchstep, 3-2
DELETE_BATCHSTEP_ACTIVITY, 1-14
delete_batchstepresource, 3-2
delete_line_allocation, 1-14, 3-2
delete_material_line, 3-2
delete_step, 3-2
E
Ease of Integration, 1-4
End Completed Resource Transaction, 1-8, 4-26
end_cmplt_actual_rsc_txn, 3-2
Entity, 1
Error Messages, A-5
F
FND_API, 1-3
FND_MESSAGE, 1-3
FND_MSG_PUB, A-1
FND_PUB_MSG, 1-3
Index-1
G
GET MESSAGES, 1-5
GMA_GME_TEXT_TBL_PKG, 1-13
GMD_AUTO_STEP_CALC, 1-13
GMD_COMMON_SCALE, 1-13
GMD_COMMON_VAL, 1-13
GMD_FETCH_OPRN, 1-13
GMD_FETCH_VALIDITY_RULES, 1-13
GMD_RECIPE_DATA_PUB, 1-13
GMD_RECIPE_FETCH_PUB, 1-13
GMD_VAL_DATA_PUB, 1-13
GMD_VALIDITY_RULES, 1-13
GMDRTVAL_PUB, 1-13
GME_API_ALLOCATE_BATCH_PVT, 1-11
GME_API_ALLOCATE_LINE_PVT, 1-11
GME_API_CERTIFY_BATCH, 1-12
GME_API_CERTIFY_BATCH_STEP, 1-12
GME_API_CLOSE_BATCH, 1-12
GME_API_CLOSE_STEP, 1-12
GME_API_CONVERT_FPO, 1-12
GME_API_CREATE_BATCH, 1-12
GME_API_CREATE_STEP, 1-12
GME_API_DELETE_BATCH_STEP, 1-12
GME_API_GRP, 1-11
GME_API_INSERT_STEP, 1-12
GME_API_MATERIAL_DETAILS, 1-11
GME_API_PARTIAL_CERT, 1-12
GME_API_PHANTOM, 1-12
GME_API_PUB, 1-11
gme_api_pub, 3-2
GME_API_RELEASE_BATCH, 1-12
GME_API_RELEASE_BATCH_STEP, 1-13
GME_API_REROUTE_BATCH, 1-13
GME_API_RESCHEDULE_BATCH, 1-13
GME_API_RESCHEDULE_BATCH_STEP, 1-13
GME_API_SCALE_BATCH, 1-13
GME_API_TEST, 1-13
GME_API_UNCERTIFY_BATCH, 1-13
GME_API_UNCERTIFY_BATCH_STEP, 1-13
GME_API_UNRELEASE_BATCH, 1-13
GME_API_UNRELEASE_STEP, 1-13
GME_API_UPDATE_STEP_QTY, 1-13
Index-2
GME_BATCH_HEADER_DBL, 1-12
GME_BATCH_HISTORY_DBL, 1-12
GME_BATCH_SALES_ORDERS_DBL, 1-12
GME_BATCH_STEP_ACTIVITIES_DBL, 1-12
GME_BATCH_STEP_DEPEND_DBL, 1-12
GME_BATCH_STEP_ITEMS_DBL, 1-12
GME_BATCH_STEP_RESOURCES_DBL, 1-12
GME_BATCH_STEP_TRANSFERS_DBL, 1-12
GME_BATCH_STEPS_DBL, 1-12
GME_CANCEL_BATCH_PVT, 1-12
GME_CANCEL_STEP_PVT, 1-12
GME_DEBUG, 1-11
GME_DELETE_BATCHSTEP, 1-14
GME_INSERT_BATCHSTEP, 1-14
GME_INV_TXNS_GTMP_DBL, 1-12
GME_LAB_BATCH_LOTS_DBL, 1-12
GME_MATERIAL_DETAILS_DBL, 1-12
GME_REOPEN_BATCH_PVT, 1-13
GME_REOPEN_STEP_PVT, 1-13
GME_RESOURCE_ENGINE_PVT, 1-13
GME_RESOURCE_TXNS_DBL, 1-12
GME_RESOURCE_TXNS_GTMP_DBL, 1-12
GME_TEXT_DBL, 1-13
GME_TRANS_ENGINE_GRP, 1-11
GME_TRANS_ENGINE_PVT, 1-13
GME_TRANS_ENGINE_UTIL, 1-11
GME_UPDATE_BATCHSTEP, 1-14
GMEPAPIS.pls, B-1
GMFPCSTB.pls, 3-2
GMFPCSTS.pls, 3-2
Group API, 1
I
importing formula information, 1-2
Incremental Backflushing, 1-8, 4-27
Insert Batchstep Activity, 1-8, 4-30
Insert Batchstep Resource, 1-8, 4-31
Insert Incremental Completed Transaction, 1-8,
4-34
Insert Line Allocation, 1-8, 4-36
Insert Material Detail Line, 1-9, 4-39
Insert Step, 1-9, 4-41
Insert Timed Resource Transaction, 1-9, 4-43
insert_allocation, 3-3
insert_batchstep, 3-2
INSERT_BATCHSTEP_ACTIVITY,
insert_batchstepresource, 3-2
insert_incr_actual_rsrc_txn, 3-2
insert_material_line, 3-3
insert_step, 3-3
insert_timed_actual_rsrc_txn, 3-3
Insulation from Changes, 1-4
Item Cost
Structure, 3-2
N
NLS_LANGUAGE, A-5
O
Online User Interface (UI),
Oracle Messages, 1-5
reroute_batch, 3-3
Reschedule Batch, 1-9, 4-52
Reschedule Step, 1-10, 4-53
reschedule_batch, 3-3
reschedule_step, 3-3
Revert to WIP Batch, 1-10, 4-54
Revert to WIP Steps, 1-10, 4-55
Robust Validation, 1-4
S
Scale Batch, 1-10, 4-56
scale_batch, 3-3
Standard Input Parameters, 2-2
Start Completed Resource Transaction, 1-10, 4-58
start_cmplt_actual_rsrc_txn, 3-3
Stored procedures, 1-2
support policy, 1-3
M
Module,
1-14
T
1-5
P
p_api_version, 2-2, 3-4
p_commit, 2-2, 3-5
p_init_msg_list, 2-2, 3-5
p_validation_level, 2-2
partial_cert_batch, 3-2
PL/SQL, 1-2
Private API, 2
Public API, 1
R
Release Batch, 1-9, 4-44
Release Steps, 1-9, 4-47
release_batch, 3-3
release_step, 3-3
Reopen Batch, 1-9, 4-49
Reopen Steps, 1-9, 4-50
reopen_batch, 3-3
reopen_step, 3-3
Reroute Batch, 1-9, 4-51
U
uncertify_batch, 3-3
uncertify_batch_step, 3-3
Unrelease Batch, 1-10, 4-61
Unrelease Steps, 1-10, 4-62
unrelease_batch, 3-3
unrelease_step, 3-3
Update Actual Resource Usage, 1-10, 4-63
Update Batchset Resource, 1-11
Update Batchstep Activity, 1-11, 4-65
Update Batchstep Resource, 4-66
Update Line Allocations, 1-11, 4-69
Update Material Detail Line, 1-11, 4-72
update_actual_resource_usage, 3-3
update_batchstep, 3-3
UPDATE_BATCHSTEP_ACTIVITY, 1-14
update_batchstepresource, 3-3
update_line_allocation, 1-13, 3-3
update_material_line, 3-3
Index-3
X
x_message_count, 2-2
x_message_list, 2-2
x_msg_count, 3-5
x_msg_data, 3-5
x_return_status, 2-2, 3-5
Index-4