Int Api
Int Api
DMAR1-PE-200026H-UPDATED
Copyright
Copyright © 2002-2014 Intergraph® Corporation. All Rights Reserved. Intergraph is part of Hexagon.
Including software, file formats, and audiovisual displays; may be used pursuant to applicable software license agreement; contains
confidential and proprietary information of Intergraph and/or third parties which is protected by copyright law, trade secret law, and
international treaty, and may not be provided or otherwise made available without proper authorization from Intergraph Corporation.
Documentation
Documentation shall mean, whether in electronic or printed form, User's Guides, Installation Guides, Reference Guides,
Administrator's Guides, Customization Guides, Programmer's Guides, Configuration Guides and Help Guides delivered with a
particular software product.
Other Documentation
Other Documentation shall mean, whether in electronic or printed form and delivered with software or on Intergraph Smart Support,
SharePoint, or box.net, any documentation related to work processes, workflows, and best practices that is provided by Intergraph
as guidance for using a software product.
Terms of Use
a. Use of a software product and Documentation is subject to the End User License Agreement ("EULA") delivered with the
software product unless the Licensee has a valid signed license for this software product with Intergraph Corporation. If the
Licensee has a valid signed license for this software product with Intergraph Corporation, the valid signed license shall take
precedence and govern the use of this software product and Documentation. Subject to the terms contained within the
applicable license agreement, Intergraph Corporation gives Licensee permission to print a reasonable number of copies of the
Documentation as defined in the applicable license agreement and delivered with the software product for Licensee's internal,
non-commercial use. The Documentation may not be printed for resale or redistribution.
b. For use of Documentation or Other Documentation where end user does not receive a EULA or does not have a valid license
agreement with Intergraph, Intergraph grants the Licensee a non-exclusive license to use the Documentation or Other
Documentation for Licensee’s internal non-commercial use. Intergraph Corporation gives Licensee permission to print a
reasonable number of copies of Other Documentation for Licensee’s internal, non-commercial. The Other Documentation may
not be printed for resale or redistribution. This license contained in this subsection b) may be terminated at any time and for any
reason by Intergraph Corporation by giving written notice to Licensee.
Disclaimer of Warranties
Except for any express warranties as may be stated in the EULA or separate license or separate terms and conditions, Intergraph
Corporation disclaims any and all express or implied warranties including, but not limited to the implied warranties of merchantability
and fitness for a particular purpose and nothing stated in, or implied by, this document or its contents shall be considered or deemed
a modification or amendment of such disclaimer. Intergraph believes the information in this publication is accurate as of its
publication date.
The information and the software discussed in this document are subject to change without notice and are subject to applicable
technical product descriptions. Intergraph Corporation is not responsible for any error that may appear in this document.
The software, Documentation and Other Documentation discussed in this document are furnished under a license and may be used
or copied only in accordance with the terms of this license. THE USER OF THE SOFTWARE IS EXPECTED TO MAKE THE FINAL
EVALUATION AS TO THE USEFULNESS OF THE SOFTWARE IN HIS OWN ENVIRONMENT.
Intergraph is not responsible for the accuracy of delivered data including, but not limited to, catalog, reference and symbol data.
Users should verify for themselves that the data is accurate and suitable for their project work.
Export Controls
Intergraph Corporation’s software products and any third-party Software Products obtained from Intergraph Corporation, its
subsidiaries, or distributors (including any Documentation, Other Documentation or technical data related to these products) are
subject to the export control laws and regulations of the United States. Diversion contrary to U.S. law is prohibited. These Software
Products, and the direct product thereof, must not be exported or re-exported, directly or indirectly (including via remote access)
under the following circumstances:
a. To Cuba, Iran, North Korea, Sudan, or Syria, or any national of these countries.
b. To any person or entity listed on any U.S. government denial list, including but not limited to, the U.S. Department of Commerce
Denied Persons, Entities, and Unverified Lists, http://www.bis.doc.gov/complianceandenforcement/liststocheck.htm, the U.S.
Department of Treasury Specially Designated Nationals List, http://www.treas.gov/offices/enforcement/ofac/, and the U.S.
Department of State Debarred List, http://www.pmddtc.state.gov/compliance/debar.html.
c. To any entity when Licensee knows, or has reason to know, the end use of the Software Product is related to the design,
development, production, or use of missiles, chemical, biological, or nuclear weapons, or other un-safeguarded or sensitive
nuclear uses.
d. To any entity when Licensee knows, or has reason to know, that an illegal reshipment will take place.
e. Any questions regarding export or re-export of these Software Products should be addressed to Intergraph Corporation’s Export
Compliance Department, Huntsville, Alabama 35894, USA.
Trademarks
Intergraph, the Intergraph logo, Intergraph Smart, PDS, SmartPlant, SmartMarine, FrameWorks, I-Sketch, IntelliShip, ISOGEN,
SmartSketch, SPOOLGEN, SupportManager, SupportModeler, Sapphire, and FreeView are trademarks or registered trademarks of
Intergraph Corporation or its subsidiaries in the United States and other countries. Microsoft and Windows are registered trademarks
of Microsoft Corporation. MicroStation is a registered trademark of Bentley Systems, Inc. Other brands and product names are
trademarks of their respective owners.
Introduction .................................................................................................................................................. 9
Naming Conventions ............................................................................................................................. 10
How to Call the Packages ..................................................................................................................... 10
What is Returned in p_result?............................................................................................................... 12
Optional Commit ................................................................................................................................... 12
Special Feature for Units ...................................................................................................................... 13
Index ........................................................................................................................................................... 61
Documentation Comments
Send documentation comments or suggestions to [email protected]
(mailto:[email protected]?subject=documentation comments).
Introduction
This documentation describes the SmartPlant Materials application programming interface (API)
packages that are provided for the Inquiries / Quotes and Agreements business objects.
These packages are used to update selected columns of tables containing information for
inquiries, quotes, and agreements. Because a record of type table is used as a parameter, the
packages allow you to update varying numbers of columns using a single call.
These updates are processed in the same way as in the corresponding SmartPlant Materials
screens. This implies, all validity checks that are performed on the screens are done here as
well.
For example, the Currency box can only contain units that have been defined for the
CURRENCY unit group. The API package will not allow you to set the currency to a unit defined
for a unit group such as VOLUME or WEIGHT.
If any update triggers updates of other columns on a screen, this will happen here too.
For example, if the Quote Date box is changed on P.30.22, the Validity Date box is calculated
again taking into account the value of the Validity box.
Prior to updating any value in a box, all data is validated. The update is performed only if no
error is found. All errors that are found will be listed so that an iterative process of correcting
data is avoided.
Some API packages also provide the possibility to insert records. Currently, this is restricted to
the insertion of the following records:
Splits and alternates for quote details
Purchase orders of type PO, MP, and CO
Agreement line items
Item shipments
Split tags
Attached other costs and their description
Attached comments
Attached progress payment sets
Attached text and terms (term type Inquiry)
When inserting a record, you only have to pass to the parameters to the procedure, the column
names, and their values that you want to fill or that may not be set to NULL. The remaining
columns are set to NULL or filled with default values.
The following orders for the corporate warehouse are not fully supported by the API
packages:
You cannot create an order for the corporate warehouse.
You cannot insert order line items or item shipments for such an order.
Naming Conventions
All packages are named m_api_xxx. You must replace xxx with the table short name of the table
columns that are to be changed.
For example, the package for changing columns in table m_quote_summaries is referred as
m_api_qs, with qs as the short name of this table. The only exception to this rule is package
m_api_misc. This package contains various tables for which you can only update a few
columns.
For information on the available packages, see Appendix: Packages and Supported Columns
(on page 15).
Example
If you want to update the escalation_percent, quote_recv_date, and currency_code columns in
the m_quote_summaries table where the quote has a primary key of 5590, you can use a
procedure with the following syntax:
CREATE OR REPLACE PROCEDURE my_proc
IS
l_col_rec m_api_qs.t_col_rec;
result VARCHAR2(255);
BEGIN
l_col_rec.col_name(1) := 'ESCALATION_PERCENT';
l_col_rec.col_value(1) := '5.3';
l_col_rec.col_name(2) := 'QUOTE_RECV_DATE';
l_col_rec.col_value(2) := '18-SEP-2000';
l_col_rec.col_name(3) := 'CURRENCY_CODE';
l_col_rec.col_value(3) := 'USD';
END;
/
Use uppercase for the column names.
Example
If m_api_qs.upd_qs is called, and it returns the following value:
Result = 201,104 - ESCALATION_PERCENT,102 - ESCALATION_DAYS,101 -
NO_BID_IND,106 - CURRENCY_CODE,INTEREST,
This means:
The given quote summary does not exist (201).
The value for ESCALATION_PERCENT is not a numeric one (104).
The value for ESCALATION_DAYS is too large (102).
NO_BID_IND cannot be set to NULL (101).
The value for CURRENCY_CODE is not valid; perhaps a unit not belonging to the
CURRENCY unit group has been passed to the package (106).
A column named INTEREST is not supported by this package.
For information on the available error codes, see Appendix C: Error Codes (see "Appendix:
Error Codes" on page 55).
Optional Commit
It is up to you to decide whether you want your changes to be committed to the database
immediately or later.
To this end, the p_commit_ind parameter has been provided in some packages. You do not
have to pass this parameter to the procedures. The default setting is Y, which means data is
committed immediately by the API procedures.
If you pass the value N instead, the API procedures will not commit the data.
Example calls:
m_api_poh.upd_poh (us_id, pk_id, l_col_rec, result); -> Data will be
committed.
m_api_poli.ins_poli (us_id, pk_id, l_col_rec, result, ‘Y’); -> Data will
be committed.
m_api_ish.upd_ish (us_id, pk_id, l_col_rec, result, ‘N’); -> Data will
NOT be committed.
Currently, this feature is supported by all procedures of the following APIs:
m_api_ish
m_api_poh
m_api_poli
m_api_qd
m_api_uoc
Examples
Unit in the database Unit passed to the API Comment
P_US_ID NUMBER(12) IN
P_INQ_ID NUMBER(12) IN
P_COL_ARR RECORD IN
P_US_ID NUMBER(12) IN
P_QS_ID NUMBER(12) IN
P_COL_ARR RECORD IN
P_US_ID NUMBER(12) IN
P_QD_ID NUMBER(12) IN
P_COL_ARR RECORD IN
Argument p_excel_ind is not used outside SmartPlant Materials. This argument can either be
left out, or filled in with the default value. It is only implemented for use of the package from
inside SmartPlant Materials.
MANUFACTURER Manufacturer
IDENT_DEV: Passing this column to the procedure, the software checks whether the
ZP_DEVATTR project default is set to a valid value. If so, the attribute determined by the project
default is either attached to the quote detail (with the value passed to the procedure) or, if
already assigned, its value is overridden by the value passed to the procedure.
P_US_ID NUMBER(12) IN
P_QD_ID NUMBER(12) IN
P_COL_ARR RECORD IN
MANUFACTURER Manufacturer
IDENT_DEV: Passing this column to the procedure, the software checks whether the
ZP_DEVATTR project default is set to a valid value. If so, the attribute determined by the project
default is either attached to the quote detail (with the value passed to the procedure) or, if
already assigned, its value is overridden by the value passed to the procedure.
P_US_ID NUMBER(12) IN
P_QD_ID NUMBER(12) IN
P_US_ID NUMBER(12) IN
P_POH_ID NUMBER(12) IN
P_COL_ARR RECORD IN
MANUFACTURER Manufacturer
PO_NUMBER PO Number
P_US_ID NUMBER(12) IN
P_COL_ARR RECORD IN
PO_NUMBER PO Number
P_US_ID NUMBER(12) IN
P_POH_ID NUMBER(12) IN
P_NLS_ID NUMBER(12) IN
P_COL_ARR RECORD IN
DESCRIPTION Description
P_US_ID NUMBER(12) IN
P_POH_ID NUMBER(12) IN
P_COL_ARR RECORD IN
DESCRIPTION Description
P_US_ID NUMBER(12) IN
P_POLI_ID NUMBER(12) IN
P_COL_ARR RECORD IN
MANUFACTURER Manufacturer
POLI_DIMENSIONS Dimensions
Function poh_id
Argument Name Type In/Out
P_PROJ_ID m_po_headers.proj_id IN
P_ORIGIN_CODE m_origins.origin_code IN
P_ORDER_TYPE m_po_headers.order_type IN
P_PO_NUMBER m_po_headers.po_number IN
P_PO_SUPP m_po_headers.po_supp IN
Function poli_id
Argument Name Type In/Out
P_PROJ_ID m_po_line_items.proj_id IN
P_POH_ID m_po_line_items.poh_id IN
P_POLI_POS m_po_line_items.poli_pos IN
P_POLI_SUB_POS m_po_line_items.poli_sub_pos IN
Function r_id
Argument Name Type In/Out
P_PROJ_ID m_reqs.proj_id IN
P_ORIGIN_CODE m_origins.origin_code IN
P_R_CODE m_reqs.r_code IN
P_R_SUPP m_reqs.r_supp IN
P_ACTUAL_IND m_reqs.actual_ind IN
Function rli_id
Argument Name Type In/Out
P_PROJ_ID m_req_line_items.proj_id IN
P_R_ID m_req_line_items.r_id IN
P_RLI_POS m_req_line_items.rli_pos IN
P_RLI_SUB_POS m_req_line_items.rli_sub_pos IN
Procedure ins_poli
Argument Name Type In/Out
P_US_ID NUMBER(12) IN
P_POH_ID NUMBER(12) IN
P_COL_ARR RECORD IN
IDENT_CODE Ident Code All valid ident codes; only valid for
‘PO’, ‘MP’, and ‘CO’ not
referencing previous line item
MANUFACTURER Manufacturer
POLI_DIMENSIONS Dimensions
TAG_NUMBER Tag Number Only valid for ’PO’, ’MP’, and ‘CO’
not referencing a previous line
item; Default ’---’
The order has not been approved so far or the order is already approved, but a split has
already occurred on the order line item level prior to the approval (in this last case, you
cannot add detail tags on the item shipment level).
No split is occurred on the item shipment level (for example, the approval of the order has
been taken back but expediting has already created detail tags).
The order is not a blanket order and not a change order of a blanket order
To create a detail tag using this procedure, you must connect to the project in which you want to
create the split.
The p_poli_id parameter must be filled with the primary key of the order line item that represents
the master tag.
P_US_ID NUMBER(12) IN
P_POLI_ID NUMBER(12) IN
P_US_ID NUMBER(12) IN
P_ISH_ID NUMBER(12) IN
P_COL_ARR RECORD IN
COMMENTS Comment
ITEM_SHIP_DIMENSIONS Dimension
P_US_ID NUMBER(12) IN
P_POLI_ID NUMBER(12) IN
P_COL_ARR RECORD IN
COMMENTS Comment
ITEM_SHIP_DIMENSIONS Dimension
P_US_ID NUMBER(12) IN
P_ISH_ID NUMBER(12) IN
P_US_ID NUMBER(12) IN
P_UOC_ID NUMBER(12) IN
P_COL_ARR RECORD IN
P_US_ID NUMBER(12) IN
P_UOC_ID NUMBER(12) IN
P_NLS_ID NUMBER(2) IN
P_COL_ARR RECORD IN
DESCRIPTION Description
P_US_ID NUMBER(12) IN
P_TERM_TYPE VARCHAR2(3) IN
P_PK_ID NUMBER(12) IN
P_COL_ARR RECORD IN
P_US_ID NUMBER(12) IN
P_UOC_ID NUMBER(12) IN
P_NLS_ID NUMBER(2) IN
P_COL_ARR RECORD IN
DESCRIPTION Description
P_US_ID NUMBER(12) IN
P_QC_ID NUMBER(12) IN
P_COL_ARR RECORD IN
P_US_ID NUMBER(12) IN
P_ATTV_ID NUMBER(12) IN
P_COL_ARR RECORD IN
PROMISE_WEEKS PW 0 – 999
P_US_ID NUMBER(12) IN
P_PK_ID1 NUMBER(12) IN
P_TABLE_NAME VARCHAR2(30) IN
P_COL_ARR RECORD IN
USED_COMMENT Comment
P_US_ID NUMBER(12) IN
P_PK_TYPE VARCHAR2(5) IN
P_PK_ID NUMBER(12) IN
P_COL_ARR RECORD IN
P_US_ID NUMBER(12) IN
P_PK_TYPE VARCHAR2(5) IN
P_PK_ID NUMBER(12) IN
P_COL_ARR RECORD IN
DESCRIPTION Description
P_PROJ_ID VARCHAR2(10) IN
P_OPIJ_CODE VARCHAR2(10) IN
P_OPJ_TYPE VARCHAR2(2) IN
P_IMPORT_PATH VARCHAR2(128) IN
P_IMPORT_FILE VARCHAR2(30) IN
P_CIP_NAME VARCHAR2(100) IN
P_USER_COMMENT VARCHAR2(80) IN
P_RESET_IND VARCHAR2(1) IN
P_MAP_IDENT_IND VARCHAR2 IN
P_COMPANY_CODE VARCHAR2 IN
P_OPIJ_ID NUMBER(12) IN
P_INVOICE_REC RECORD IN
proj_id VARCHAR2 IN
ivc_number VARCHAR2 IN
poh_id NUMBER IN
dp_id NUMBER IN
ca_id NUMBER IN
approved_by VARCHAR2 IN
invoice_owner VARCHAR2 IN
po_pp_ind NUMBER IN
rfa_ind VARCHAR2 IN
invoice_amount NUMBER IN
ret_amount NUMBER IN
paid_amount NUMBER IN
invoice_status VARCHAR2 IN
invoice_create_date DATE IN
period_to DATE IN
period_from DATE IN
DATE IN
invoice_paid_date DATE IN
rfa_date DATE IN
approved_date DATE IN
erp_status VARCHAR2 IN
erp_status_date DATE IN
erp_message VARCHAR2 IN
sup_id NUMBER IN
pno_id NUMBER IN
currency_id NUMBER IN
lien_wav_rec_ind VARCHAR2 IN
final_payment_ind VARCHAR2 IN
paid_ind VARCHAR2 IN
invoice_actions VARCHAR2 IN
P_COMMIT VARCHAR2 IN
P_PROJ_ID VARCHAR2 IN
P_INV_DET_REC RECORD IN
proj_id VARCHAR2 IN
ivc_id NUMBER IN
poli_id NUMBER IN
uoc_id NUMBER IN
attp_id NUMBER IN
dp_id NUMBER IN
ivci_id NUMBER IN
ivc_amount NUMBER IN
invoice_qty NUMBER IN
P_COMMIT VARCHAR2 IN
P_PROJ_ID VARCHAR2 IN
P_IVC_NUMBER VARCHAR2 IN
P_SUP_CODE VARCHAR2 IN
P_PROJ_ID VARCHAR2 IN
P_RET_PERCENT NUMBER IN
P_RET_AMOUNT NUMBER IN
Neither the p_ret_percent nor p_ret_amount must be null to store retention percentage.
P_IVC_NUMBER VARCHAR2 IN
P_SUP_CODE VARCHAR2 IN
P_PROJ_ID VARCHAR2 IN
P_IVC_NUMBER VARCHAR2 IN
P_SUP_CODE VARCHAR2 IN
P_IVC_FIELD VARCHAR2 IN
P_PROJ_ID VARCHAR2 IN
P_IVC_NUMBER VARCHAR2 IN
P_SUP_CODE VARCHAR2 IN
P_STATUS VARCHAR2 IN
P_PROJ_ID VARCHAR2 IN
N Not Submitted
S Submitted
NA Needs Assignment
P Pending
A Approval
R Rejected
PA Paid
P_PROJ_ID VARCHAR2 IN
P_IVC_NUMBER VARCHAR2 IN
P_SUP_CODE VARCHAR2 IN
P_ERP_STATUS VARCHAR2 IN
P_ERP_STATUS_DATE DATE IN
P_ERP_MESSAGE VARCHAR2 IN
P_PROJ_ID VARCHAR2 IN
P_IVC_NUMBER VARCHAR2 IN
P_SUP_CODE VARCHAR2 IN
P_COLUMN_NAME VARCHAR2 IN
P_COLUMN_VALUE VARCHAR2 IN
If the column has the date format, enter the value for P_COLUMN_VALUE in
DD-MM-YYYY fromat.
For example, if you want to update the ERP_ERROR_MSG column in the M_INVOICES table
with the ERP Interface error, the call to this procedure must be set as in the following:
Execute upd_invoice_fields('IVC_1','SUP_1','ERP_ERROR_MSG','ERROR!!
Invoice Amount is invalid.');
201 Object (inquiry, quote, quote detail, ...) does not exist.
539 Either unit price type or unit / supply / install price can be
set.
540 Either unit price type or ‘Other Cost %’, ‘Cost Value per
Unit’, ‘Cost Value Total’ can be set.
541 Insert not allowed on order for FIM (Free Issued Material)
warehouses.
602 - yyy Column only updateable for blanket orders and notices of
commitment.
In addition to these error numbers, the following messages raised by ORACLE® can occur:
ORA-01400: cannot insert NULL into ("M_SYS"."table_name"."column_name")
ORA-00001: unique constraint (M_SYS.table_short_name_UK) violated
ORA-00001: unique constraint (M_SYS.table_short_name_PK) violated
ORA-20000: MAR-25353 #1CREATE_SPLIT no data found 100 (please see chapters A.3.3
Procedure: ins_detail_qd, A.5.3 Procedure: ins_detail_poli, and A.6.3 Procedure:
ins_detail_ish, respectively, for reasons).
A P
A.1 Table Preface • 7
m_inquiries, Package
m_api_inq • 15 S
A.10 Table
m_invoices, Package Special Feature for Units • 13
m_api_invoice • 47
A.2 Table W
m_quote_summaries, Package What is Returned in p_result? • 12
m_api_qs • 16
A.3 Table
m_quote_details, Package
m_api_qd • 17
A.4 Table
m_po_headers, Package
m_api_poh • 22
A.5 Table
m_po_line_items, Package
m_api_poli • 28
A.6 Table
m_item_ships, Package
m_api_ish • 35
A.7 Table
m_used_other_costs, Package
m_api_uoc • 40
A.8 Package
m_api_misc • 43
A.9 Package
m_api_opi_import • 46
Appendix
Error Codes • 55
Packages and Supported Columns • 15
Supported Date Formats • 53
H
How to Call the Packages • 10
I
Introduction • 9
N
Naming Conventions • 10
O
Optional Commit • 12