smartplant materials api guide for inquiries and agreements

61
SmartPlant Materials API Guide for Inquiries and Agreements Version 2011 R1 SP1 (7.1.1) November 2013 / April 2014 DMAR1-PE-200026H-UPDATED

Upload: others

Post on 29-May-2022

15 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SmartPlant Materials API Guide for Inquiries and Agreements

SmartPlant Materials API Guide for Inquiries and Agreements

Version 2011 R1 SP1 (7.1.1)

November 2013 / April 2014

DMAR1-PE-200026H-UPDATED

Page 2: SmartPlant Materials API Guide for Inquiries and Agreements

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.

U.S. Government Restricted Rights Legend Use, duplication, or disclosure by the government is subject to restrictions as set forth below. For civilian agencies: This was developed at private expense and is "restricted computer software" submitted with restricted rights in accordance with subparagraphs (a) through (d) of the Commercial Computer Software - Restricted Rights clause at 52.227-19 of the Federal Acquisition Regulations ("FAR") and its successors, and is unpublished and all rights are reserved under the copyright laws of the United States. For units of the Department of Defense ("DoD"): This is "commercial computer software" as defined at DFARS 252.227-7014 and the rights of the Government are as specified at DFARS 227.7202-3.

Unpublished - rights reserved under the copyright laws of the United States.

Intergraph Corporation 300 Intergraph Way Huntsville, AL 35813

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 licenseagreement 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.

2 SmartPlant Materials API Guide for Inquiries and Agreements

Page 3: SmartPlant Materials API Guide for Inquiries and Agreements

Limitation of Damages IN NO EVENT WILL INTERGRAPH CORPORATION BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL INCIDENTAL, SPECIAL, OR PUNITIVE DAMAGES, INCLUDING BUT NOT LIMITED TO, LOSS OF USE OR PRODUCTION, LOSS OF REVENUE OR PROFIT, LOSS OF DATA, OR CLAIMS OF THIRD PARTIES, EVEN IF INTERGRAPH CORPORATION HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

UNDER NO CIRCUMSTANCES SHALL INTERGRAPH CORPORATION’S LIABILITY EXCEED THE AMOUNT THAT INTERGRAPH CORPORATION HAS BEEN PAID BY LICENSEE UNDER THIS AGREEMENT AT THE TIME THE CLAIM IS MADE. EXCEPT WHERE PROHIBITED BY APPLICABLE LAW, NO CLAIM, REGARDLESS OF FORM, ARISING OUT OF OR IN CONNECTION WITH THE SUBJECT MATTER OF THIS DOCUMENT MAY BE BROUGHT BY LICENSEE MORE THAN TWO (2) YEARS AFTER THE EVENT GIVING RISE TO THE CAUSE OF ACTION HAS OCCURRED.

IF UNDER THE LAW RULED APPLICABLE ANY PART OF THIS SECTION IS INVALID, THEN INTERGRAPH LIMITS ITS LIABILITY TO THE MAXIMUM EXTENT ALLOWED BY SAID LAW.

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 sensitivenuclear 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.

SmartPlant Materials API Guide for Inquiries and Agreements 3

Page 4: SmartPlant Materials API Guide for Inquiries and Agreements

4 SmartPlant Materials API Guide for Inquiries and Agreements

Page 5: SmartPlant Materials API Guide for Inquiries and Agreements

Contents Preface .......................................................................................................................................................... 7

Documentation Comments ..................................................................................................................... 7

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

Appendix: Packages and Supported Columns ...................................................................................... 15

A.1 Table: m_inquiries, Package: m_api_inq ....................................................................................... 15 A.2 Table: m_quote_summaries, Package: m_api_qs ......................................................................... 16 A.3 Table: m_quote_details, Package: m_api_qd ................................................................................ 17

A.3.1 Procedure: upd_qd ............................................................................................................... 17 A.3.2 Procedure: ins_qd ................................................................................................................. 19 A.3.3 Procedure: ins_detail_qd ...................................................................................................... 22

A.4 Table: m_po_headers, Package: m_api_poh ................................................................................. 22 A.4.1 Procedure: upd_poh ............................................................................................................. 22 A.4.2 Procedure: ins_poh ............................................................................................................... 24 A.4.3 Procedure: upd_nls ............................................................................................................... 27 A.4.4 Procedure: ins_nls ................................................................................................................ 27

A.5 Table: m_po_line_items, Package: m_api_poli .............................................................................. 28 A.5.1 Procedure: upd_poli .............................................................................................................. 28 A.5.2 Procedure: ins_poli ............................................................................................................... 30 A.5.3 Procedure: ins_detail_poli ..................................................................................................... 34

A.6 Table: m_item_ships, Package: m_api_ish .................................................................................... 35 A.6.1 Procedure: upd_ish ............................................................................................................... 35 A.6.2 Procedure: ins_ish ................................................................................................................ 37 A.6.3 Procedure: ins_detail_ish ...................................................................................................... 39

A.7 Table: m_used_other_costs, Package: m_api_uoc ....................................................................... 40 A.7.1 Procedure: upd_uoc .............................................................................................................. 40 A.7.2 Procedure: upd_uocn ............................................................................................................ 41 A.7.3 Procedure: ins_uoc ............................................................................................................... 41 A.7.4 Procedure: ins_uocn ............................................................................................................. 42

A.8 Package: m_api_misc .................................................................................................................... 43 A.8.1 Table: m_qs_cecs, Procedure: upd_qc ................................................................................ 43 A.8.2 Table: m_att_vdrs, Procedure: upd_attv ............................................................................... 43 A.8.3 Table: m_used_comments, Procedure: ins_uc .................................................................... 44 A.8.4 Table: m_att_ppes, Procedure: ins_attp ............................................................................... 44 A.8.5 Table: m_att_terms, Procedure: ins_attt ............................................................................... 45

A.9 Package: m_api_opi_import ........................................................................................................... 46 A.9.1 Procedure: create_opi_job .................................................................................................... 46 A.9.2 Procedure: start_opi_job ....................................................................................................... 46

A.10 Table: m_invoices, Package: m_api_invoice ............................................................................... 47 A.10.1 Function: import_inv ............................................................................................................ 47

SmartPlant Materials API Guide for Inquiries and Agreements 5

Page 6: SmartPlant Materials API Guide for Inquiries and Agreements

Contents

A.10.2 Function: import_inv_det ..................................................................................................... 49 A.10.3 Procedure: upd_ret_percent ............................................................................................... 49 A.10.4 Function: get_invoice_status .............................................................................................. 50 A.10.5 Function: get_invoice_field_value ....................................................................................... 50 A.10.6 Procedure: upd_invoice_status........................................................................................... 50 A.10.7 Procedure: upd_erp_fields .................................................................................................. 51 A.10.8 Procedure: upd_invoice_fields ............................................................................................ 51

Appendix: Supported Date Formats ........................................................................................................ 53

Appendix: Error Codes ............................................................................................................................. 55

Index ........................................................................................................................................................... 61

6 SmartPlant Materials API Guide for Inquiries and Agreements

Page 7: SmartPlant Materials API Guide for Inquiries and Agreements

This document describes the APIs for inquiries and agreements in SmartPlant Materials.

Documentation Comments Send documentation comments or suggestions to [email protected] (mailto:[email protected]?subject=documentation comments).

Preface

SmartPlant Materials API Guide for Inquiries and Agreements 7

Page 8: SmartPlant Materials API Guide for Inquiries and Agreements

Preface

8 SmartPlant Materials API Guide for Inquiries and Agreements

Page 9: SmartPlant Materials API Guide for Inquiries and Agreements

S E C T I O N 1

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.

Introduction

SmartPlant Materials API Guide for Inquiries and Agreements 9

Page 10: SmartPlant Materials API Guide for Inquiries and Agreements

Introduction You cannot update quantities on these orders.

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).

How to Call the Packages To update a column, the packages can use the following syntax:

m_api_xxx.upd_xxx (us_id, pk_id, l_col_rec, result);

To insert a record, the packages can be called using the following syntax:

m_api_xxx.ins_xxx (us_id, ... , l_col_rec, result);

Here the xxx must be replaced by the table short name or by misc.

The packages require user security information to read project defaults or privileges. Therefore, the us_id parameter is mandatory. This parameter is equivalent to the value of the column USID that you can find in the lower block of the SmartPlant Materials logon screen.

The pk_id must be replaced by the value for the primary key of the table.

l_col_rec is a record that can be defined as:

l_col_rec m_api_xxx.t_col_rec;

t_col_rec is defined in the packages as follwoing:

TYPE t_col_table IS TABLE OF VARCHAR2(255)

INDEX BY BINARY_INTEGER;

TYPE t_col_rec IS RECORD

(col_name t_col_table,

col_value t_col_table

);

The result is a parameter of type OUT which indicates if the updates or inserts were performed successfully.

The number and type of the parameters following us_id for insert procedures differ from package to package depending on the table in which a record is inserted. For information on the available packages, see Appendix: Packages and Supported Columns (on page 15).

10 SmartPlant Materials API Guide for Inquiries and Agreements

Page 11: SmartPlant Materials API Guide for Inquiries and Agreements

Introduction 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';

m_api_qs.upd_qs (5001, 5590, l_col_rec, result);

dbms_output.put_line ('Result = ' || result);

END;

/

Use uppercase for the column names.

SmartPlant Materials API Guide for Inquiries and Agreements 11

Page 12: SmartPlant Materials API Guide for Inquiries and Agreements

Introduction

What is Returned in p_result? If all the parameters passed are correct and the update is successful, a blank (‘ ‘) is returned in the p_result parameter.

Otherwise, p_result contains all the errors that were found for the given data. In most cases, a numeric error message is completed by the name of the faulty column.

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

12 SmartPlant Materials API Guide for Inquiries and Agreements

Page 13: SmartPlant Materials API Guide for Inquiries and Agreements

Introduction m_api_poli

m_api_qd

m_api_uoc

Special Feature for Units Unlike many code fields in SmartPlant Materials, units are not restricted to uppercase. Because this is not necessarily supported by all software outside SmartPlant Materials, units are processed as follows:

First, the software tries to find the unit that is passed. If this unit is not found, the software tries to find the unit using uppercase in the comparison.

Examples

Unit in the database Unit passed to the API Comment

kg kg Unit is found directly

KG kg Unit is found because of compare using uppercase

kg KG Unit is found because of compare using uppercase

SmartPlant Materials API Guide for Inquiries and Agreements 13

Page 14: SmartPlant Materials API Guide for Inquiries and Agreements

Introduction

14 SmartPlant Materials API Guide for Inquiries and Agreements

Page 15: SmartPlant Materials API Guide for Inquiries and Agreements

A P P E N D I X A

In This Appendix A.1 Table: m_inquiries, Package: m_api_inq ................................ 15 A.2 Table: m_quote_summaries, Package: 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 A.10 Table: m_invoices, Package: m_api_invoice ........................ 47

A.1 Table: m_inquiries, Package: m_api_inq

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_INQ_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

Column Name Prompt on P.30.11 Allowable values

ISSUE_DATE Issue Date

BID_RETURN_DATE Bid Return Date

Appendix: Packages and Supported Columns

SmartPlant Materials API Guide for Inquiries and Agreements 15

Page 16: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns

A.2 Table: m_quote_summaries, Package: m_api_qs

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_QS_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

Column Name Prompt on P.30.22 Allowable values

CONFIRM_RFQ_RECV_IND Conf RFQ Recvd ‘Y’, ‘N’

CURRENCY_CODE Currency All units in the ‘currency’ unit group

DISCOUNT_PERCENT Discount % 0 – 999.99

ESCALATION_DAYS Validity 0 –999

ESCALATION_NOTICE Escalation Notice

ESCALATION_PERCENT Escalation % 0 – 999.99

INTEREST_RATE Interest Rate 0 – 999.99

NO_BID_IND No Bid ‘Y’, ‘N’

QUOTE_DATE Quote Date

QUOTE_RECV_BY Quote Recv By All SmartPlant Materials users

QUOTE_RECV_DATE Quote Recv Date

QUOTE_REF_NUMBER Quote Ref Number

RESTOCKING_PERCENT Restocking % 0 – 999.99

16 SmartPlant Materials API Guide for Inquiries and Agreements

Page 17: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.30.22 Allowable values

SEND_TO_SUPP_DATE Issue Date

VOL_CODE Volume Unit All units in the ’volume’ unit group

WEIGHT_CODE Weight Unit All units in the ’weight’ unit group

A.3 Table: m_quote_details, Package: m_api_qd A.3.1 Procedure: upd_qd

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_QD_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

P_EXCEL_IND VARCHAR2 IN; DEFAULT ‘N’

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.

Column Name Prompt on P.30.22 Allowable values

CATALOG_NUMBER Catalog Number

CURRENCY_CODE Currency All units in the ‘currency’ unit group

CY_CODE Ctry of Origin All countries defined on A.10.34

SmartPlant Materials API Guide for Inquiries and Agreements 17

Page 18: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.30.22 Allowable values

DISCOUNT_AMOUNT Discount Amount 0 – 999999999.9999

DISCOUNT_BASE Discount Base ‘A’, ‘P’

DISCOUNT_PERCENT Discount % 0 – 999.99

EXPORT_LICENSE_NUMBER

Export License Number

EXPORT_LICENSE_REQ_IND

Exp Lic Req ‘Y’, ‘N’; the default depends on the ZP_EXPLICR project default

FIRST_SHIP First Ship 0 – 99

FREIGHT_VALUE Delivery Place

FRT_CODE Incoterm All incoterms defined on P.10.34

INSTALL_PRICE Install Price 0 – 999999999.9999

LAST_SHIP Last Ship 0 – 99

LAST_SHIP_DATE Last Ship Date Any valid date

MANUFACTURER Manufacturer

MODIFICATION_PRICE Modification Price 0 – 999999999.9999

PACKING_DIMENSIONS Packing Dimensions

PACKING_PRICE Packing Price 0 – 999999999.9999

PACKING_VOLUME Packing Volume 0 – 999999999.999

PERCENT_DOMESTIC_PROD

% Dom. Prod. 0 – 100

PRICE_BASE Price Base ‘Q’, ‘W’

QD_UNIT_PRICE Unit Price 0 – 999999999.9999

QD_UNIT_WEIGHT Unit Weight 0 – 999999999999.999

QTY_CODE Quantity Unit All units in the ‘quantity’, ‘volume’, and ‘weight’ unit groups

18 SmartPlant Materials API Guide for Inquiries and Agreements

Page 19: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.30.22 Allowable values

QUOTED_QTY Quoted Quantity 0 – 999999999999.999

REQ_DELV_DATE Req Delivery Date Any valid date

RESTOCKING_PERCENT Restocking % 0 – 999.99

RESTOCKING_PRICE Restocking Price 0 – 999999999.9999

SUPPLY_PRICE Supply Price 0 – 999999999.9999

UNIT_PRICE_TYPE Unit Price Type NULL, ‘I’, ‘E’, ‘Q’, ‘R’

VOL_CODE Volume Unit All units in the ‘volume’ unit group

WEIGHT_CODE Weight Unit All units in the ‘weight’ unit group

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.

A.3.2 Procedure: ins_qd This procedure is to be used for inserting splits and alternates.

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_QD_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

P_QD_ID is the quote detail for which a split or alternate is to be inserted.

Column Name Prompt in P.30.22 Allowable values

ALTERNATE_NUMBER Alt 0 – 9; default 0

SmartPlant Materials API Guide for Inquiries and Agreements 19

Page 20: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt in P.30.22 Allowable values

CATALOG_NUMBER Catalog Number

CURRENCY_CODE Currency All units in the ‘currency’ unit group

CY_CODE Ctry of Origin All countries defined on A.10.34

DISCOUNT_AMOUNT Discount Amount 0 – 999999999.9999; default 0

DISCOUNT_BASE Discount Base ‘A’, ‘P’

DISCOUNT_PERCENT Discount % 0 – 999.99; default 0

EXPORT_LICENSE_NUMBER Export License Number

EXPORT_LICENSE_REQ_IND Exp Lic Req ‘Y’, ‘N’; the default depends on the ZP_EXPLICR project default

FIRST_SHIP First Ship 0 – 99; default 0

FREIGHT_VALUE Delivery Place

FRT_CODE Incoterm All incoterms defined on P.10.34

INSTALL_PRICE Install Price 0 – 999999999.9999; default 0

LAST_SHIP Last Ship 0 – 99; default 0

LAST_SHIP_DATE Last Ship Date Any valid date

MANUFACTURER Manufacturer

MODIFICATION_PRICE Modification Price 0 – 999999999.9999; default 0

PACKING_DIMENSIONS Packing Dimensions

PACKING_PRICE Packing Price 0 – 999999999.9999; default 0

PACKING_VOLUME Packing Volume 0 – 999999999.999; default 0

PERCENT_DOMESTIC_PROD % Dom. Prod. 0 – 100; the default is 0 or 100, depending on the

20 SmartPlant Materials API Guide for Inquiries and Agreements

Page 21: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt in P.30.22 Allowable values

ZP_EXPLICR project default

PRICE_BASE Price Base ‘Q’, ‘W’

QD_UNIT_PRICE Unit Price 0 – 999999999.9999

QD_UNIT_WEIGHT Unit Weight 0 – 999999999999.999

QTY_CODE Quantity Unit All units in the ‘quantity’, ‘volume’, and ‘weight’ unit groups

QUOTED_QTY Quoted Quantity 0 – 999999999999.999

REQ_DELV_DATE Req Delivery Date Any valid date

RESTOCKING_PERCENT Restocking % 0 – 999.99; default 0

RESTOCKING_PRICE Restocking Price 0 – 999999999.9999; default 0

SPLIT_QD_SEQ Split Seq 0 – 99999

SUPPLY_PRICE Supply Price 0 – 999999999.9999; default 0

UNIT_PRICE_TYPE Unit Price Type NULL, ‘I’, ‘E’, ‘Q’, ‘R’

VOL_CODE Volume Unit All units in the ‘volume’ unit group

WEIGHT_CODE Weight Unit All units in the ‘weight’ unit group

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.

SmartPlant Materials API Guide for Inquiries and Agreements 21

Page 22: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns

A.3.3 Procedure: ins_detail_qd This procedure is used to create a detail tag for a tagged item (functionality is provided in the procurement, expediting, traffic, and site screens through the ‘Split Tag’ button).

A detail tag can only be created for a quote detail if the following conditions are met:

The item rule of the item type of the ident on this quote detail is ‘TAB’, ‘TFM’, ‘TOM’, ‘TWM’, or ‘SWT’.

The tag number is unlike ‘---‘ and unlike ‘UNTAGGED’.

The quote detail is not a detail tag.

Alternates are not yet created.

Splits are not yet created.

To create a detail tag using this procedure, you must be connected to the project in which you want to create the split.

The p_qd_id parameter must be filled with the primary key of the quote detail that represents the master tag.

The p_new_qd_id and p_new_qd_id2 parameters contain the primary keys of the newly created quote details (detail tags).

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_QD_ID NUMBER(12) IN

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

P_NEW_QD_ID NUMBER(12) OUT

P_NEW_QD_ID2 NUMBER(12) OUT

A.4 Table: m_po_headers, Package: m_api_poh A.4.1 Procedure: upd_poh

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_POH_ID NUMBER(12) IN

22 SmartPlant Materials API Guide for Inquiries and Agreements

Page 23: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Argument Name Type In/Out

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

Column Name Prompt on P.50.07 Allowable values

BUYER Buyer All SmartPlant Materials users with the ‘BUYER’ privilege (in the current project)

CCP_CODE Contact Any supplier’s employee defined on A.10.29

CLIENT_PO_NUMBER Client PO Num

COMMENTS_SETTLED_IND Comments Settled ‘Y’, ‘N’

CY_CODE Country Code All countries defined on A.10.34

EV_CODE Exped. View All views defined on P.10.71

EXPEDITER Expediter All SmartPlant Materials users with the ‘EXPEDITER’ privilege (in the current project)

EXPED_ILV_CODE Exp Level All expediting levels defined on P.10.55

ILV_CODE Insp Level All inspection levels defined on P.10.55

JOB_NUMBER Account Code All account codes defined on A.10.30

LAST_CONTACT_DATE Last Contact (P.70. 71) Any valid date

MANUFACTURER Manufacturer

SmartPlant Materials API Guide for Inquiries and Agreements 23

Page 24: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.50.07 Allowable values

NEXT_CONTACT_DATE Next Contact (P.70. 71) Any valid date

ORG_ETA_SITE_DATE ETA Site Any valid date

PERFORMANCE_SCORE Perf Score

PO_ISSUE_DATE Issued Any valid date

PO_NUMBER PO Number

POINT_OF_ORIGIN Point of Origin

READY_FOR_APPROVAL_IND

Ready for Approval ‘Y’, ‘N’

RECV_ACKNOWLEDGE_DATE

Recv Acknow Any valid date

SUP_CODE Supplier Depending on the ZP_PROJSUP project default, either all suppliers (ZP_PROJSUP = ‘N’) or only project suppliers (ZP_PROJSUP = ‘Y’); in any case, only suppliers allowed for 'PO & Inquiry' (P.20.01) and the status of which is approved (P.20.01) are valid

TECH_EVAL_COMP_DATE Tech Eval Comp Date Any valid date

TRAFFIC Traffic All SmartPlant Materials users with the ‘TRAFFIC’ privilege (in the current project)

A.4.2 Procedure: ins_poh Use this procedure to insert orders of types ‘PO’ and ‘MP’. Change orders (type ‘CO’) can only be created for (manual) purchase orders, not for blanket orders or notices of commitment. Manual POs referencing a blanket order cannot be created.

If you want to create a change order, only the ORDER_TYPE and PARENT_ORDER columns are mandatory. All other values are copied from the referenced, previous order. But if any of the other fields are to be changed, you can pass them to the procedure, and they are placed on the new change order.

The primary key of the newly created order is returned to the calling program (p_poh_id parameter).

24 SmartPlant Materials API Guide for Inquiries and Agreements

Page 25: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_POH_ID NUMBER(12) OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

Column Name Prompt in P.50.07 Allowable values

BUYER Buyer All SmartPlant Materials users with the ‘BUYER’ privilege (in the current project)

CCP_CODE Contact Any supplier’s employee defined on A.10.29

CLIENT_PO_NUMBER Client PO Num

CURRENCY_CODE Currency All units in the ‘currency’ unit group; only valid for ‘PO’, ‘MP’

CY_CODE Country Code All countries defined on A.10.34

EV_CODE Exped. View All views defined on P.10.71

EXPEDITER Expediter All SmartPlant Materials users with the ‘EXPEDITER’ privilege (in the current project)

EXPED_ILV_CODE Exp Level All expediting levels defined on P.10.55

ILV_CODE Insp Level All inspection levels defined on P.10.55

SmartPlant Materials API Guide for Inquiries and Agreements 25

Page 26: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt in P.50.07 Allowable values

ISSUED_BY Issued by All origins defined on A.10.33; only for ‘PO’, ‘MP’

JOB_NUMBER Account Code All account codes defined on A.10.30

ORDER_TYPE Type ‘PO’, ‘MP’, ‘CO’

ORIGIN Origin All origins defined on A.10.33; only for ‘PO’, ‘MP’

ORG_ETA_SITE_DATE ETA Site Any valid date

PARENT_ORDER Primary key of any approved order of types ‘PO’, ‘MP’; mandatory field when inserting a change order

PO_NUMBER PO Number

POINT_OF_ORIGIN Point of Origin

RM_CODE Routing Method All routing methods defined on P.10.53; only for ‘PO’, ‘MP’

SUP_CODE Supplier Depending on the ZP_PROJSUP project default, either all suppliers (ZP_PROJSUP = ‘N’) or only project suppliers (ZP_PROJSUP = ‘Y’);not applicable for orders of ‘CO'; in any case, only suppliers allowed for 'PO & Inquiry' (P.20.01) and the status of which is approved (P.20.01) are valid

TRAFFIC Traffic All SmartPlant Materials users with the ‘TRAFFIC’ privilege (in the current project)

26 SmartPlant Materials API Guide for Inquiries and Agreements

Page 27: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns

A.4.3 Procedure: upd_nls

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_POH_ID NUMBER(12) IN

P_NLS_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

Column Name Prompt in P.50.07 Allowable values

DESCRIPTION Description

SHORT_DESC Short Desc

A.4.4 Procedure: ins_nls

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_POH_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

SmartPlant Materials API Guide for Inquiries and Agreements 27

Page 28: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.50.07 Allowable values

DESCRIPTION Description

NLS_ID Nls All languages defined on A.10.01 Languages

SHORT_DESC Short Desc

A.5 Table: m_po_line_items, Package: m_api_poli A.5.1 Procedure: upd_poli

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_POLI_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

Column Name Prompt on P.50.07 Allowable values

ACCEPTED_IND Accepted ‘Y’, ‘N’

CATALOG_NUMBER Catalog Number

CURRENCY_CODE Currency All units in the ‘currency’ unit group

CY_CODE Ctry of Origin All countries defined on A.10.34

EXPORT_LICENSE_NUMBER Exp Lic Number

28 SmartPlant Materials API Guide for Inquiries and Agreements

Page 29: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.50.07 Allowable values

EXPORT_LICENSE_RECEIVED_DATE Exp Lic Recv Any valid date

EXPORT_LICENSE_REQ_IND Exp Lic Req ‘Y’, ‘N’

FIRST_SHIP First Ship 0 – 99

FREIGHT_VALUE Delivery Place

FRT_CODE Incoterm All incoterms defined on P.10.34

INSTALL_PRICE Install Price 0 – 99999999999.9999

JOB_NUMBER Account Code All account codes defined on A.10.30

LAST_SHIP Last Ship 0 –99

MANUFACTURER Manufacturer

PERCENT_US_CONTENT % Dom. Prod. 0 – 100

POLI_CLOSE_DATE Closed Any valid date

POLI_DIMENSIONS Dimensions

POLI_QTY Quantity 0 – 99999999.99

POLI_UNIT_PRICE Unit Price 0 – 99999999999.9999

POLI_UNIT_WEIGHT Unit Weight 0 – 99999999.99

POLI_VOLUME Volume 0 – 99999999.99

PRICE_BASE Price Base ‘Q’, ‘W’

PROM_CONTR_DATE Prom Contract Any valid date

QTY_CODE Quantity Unit All units in the ‘quantity’, ‘volume’, and ‘weight’ unit groups

REVISED_PROMISE_DATE Rev Prom Any valid date

SUPPLY_PRICE Supply Price 0 – 99999999999.9999

TEC_PASSED_IND Tec Pass ‘Y’, ‘N’

SmartPlant Materials API Guide for Inquiries and Agreements 29

Page 30: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.50.07 Allowable values

VOL_CODE Volume Unit All units in the ‘volume’ unit group

WEIGHT_CODE Weight Unit All units in the ‘weight’ unit group

A.5.2 Procedure: ins_poli A.5.2.1. General Information This procedure inserts order line items. You can only insert line items on orders of type ’PO’ and ‘MP’. You can also create line items for change orders referencing a (manual) purchase order. You cannot insert line items on change orders referring to a blanket order or a notice of commitment. You cannot create line items for manual POs to which a blanket order has been assigned either. The order header of the line item must not be approved.

When inserting an order line item, the corresponding item shipment is created automatically at the same time. If you need to overwrite any value on such an item shipment, you must make use of the upd_ish procedure in the m_api_ish package. For this reason, this procedure does not only return the primary key of the newly created order line item, but also the primary key of the corresponding item shipment. In case more than one item shipment has been created, the primary key of the first item shipment is returned. This occurs, for example, when inserting a line item on a change order and multiple item shipments have been created for the corresponding order line on the order of type ‘PO’.

When you insert an order line item that references a requisition line item, ident and tag numbers are taken over from the requisition.

You can create a tag number by using the ITY_CODE and TAG_NUMBER column names. If you fill ITY_CODE with an item type the item rule of which is ‘TAB’, ‘TFM’, ‘TOM’, or ‘TWM’ and fill TAG_NUMBER, a tag number is created in the same way as on P.50.07.

In the case of a change order, the value of the POLI_QTY field is regarded as the new value for the order line item. For example, if you have ordered a quantity of 10 on the original order and now you want to cancel a quantity of 3, you must pass 7 to the procedure because 7 is the new quantity to be ordered.

For change orders (apart from PARENT_POLI), only those fields that you want to change have to be passed to the procedure if referencing a previous order line item. All other values are taken over from the referenced, previous line item.

Inserting completely new line items on a change order works in the same way as for purchase orders.

When inserting line items for (manual) purchase orders, you do not have to pass all columns to the procedure. For many fields, default values are assumed. For details see the list in following chapter.

30 SmartPlant Materials API Guide for Inquiries and Agreements

Page 31: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns A.5.2.2. Determination of Primary Keys For retrieving the primary key of an order, an order line item, or a requisition line item, the poh_id, poli_id, and rli_id (and r_id) functions are provided in the m_pck_uk package.

If a negative value is returned, the order, requisition, or line item cannot be found.

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

SmartPlant Materials API Guide for Inquiries and Agreements 31

Page 32: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns 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

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_POLI_ID NUMBER(12) OUT

P_ITEM_SHIP_ID NUMBER(12) OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

Column Name Prompt on P.50.07 Allowable values

ACCEPTED_IND Accepted ‘Y’, ‘N’

CATALOG_NUMBER Catalog Number

CURRENCY_CODE Currency All units in the ‘currency’ unit group

CY_CODE Ctry of Origin All countries defined on A.10.34

EXPORT_LICENSE_NUMBER

Exp Lic Number

32 SmartPlant Materials API Guide for Inquiries and Agreements

Page 33: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.50.07 Allowable values

EXPORT_LICENSE_RECEIVED_DATE

Exp Lic Recv Any valid date

EXPORT_LICENSE_REQ_IND

Exp Lic Req ‘Y’, ‘N’; the default depends on the ZP_EXPLICR project default

FREIGHT_VALUE Delivery Place

FRT_CODE Incoterm All incoterms defined on P.10.34

IDENT_CODE Ident Code All valid ident codes; only valid for ‘PO’, ‘MP’, and ‘CO’ not referencing previous line item

INSTALL_PRICE Install Price 0 – 99999999999.9999; default 0

ITY_CODE Item Type All item types defined on A.10.15

JOB_NUMBER Account Code All account codes defined on A.10.30

LAYOUT_SHORT Layout Short (S.80.25)

LAYOUT_LONG Layout Long (S.80.25)

MANUFACTURER Manufacturer

PARENT_POLI Only for ‘CO’: Primary key of line item that is to be replaced; in case another ‘CO’ already exists, this may either be the primary key of the original line item or the primary key of the line item on the ‘CO’

PERCENT_US_CONTENT % Dom. Prod. 0 – 100; default 0 or 100 depending on the ZP_EXPLICR project default

POLI_DIMENSIONS Dimensions

POLI_POS Pos 1 – 9999999; filled with next available value in the case of a new line item on a CO (not referencing a previous line item) if not passed over

POLI_QTY Quantity 0 – 99999999.999; default 0

SmartPlant Materials API Guide for Inquiries and Agreements 33

Page 34: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.50.07 Allowable values

POLI_SUB_POS Sub 1 – 99999; filled with next available value in the case of a new line item on a CO (not referencing a previous line item) if not passed over

POLI_UNIT_PRICE Unit Price 0 – 99999999999.9999; default 0

POLI_UNIT_WEIGHT Unit Weight 0 – 99999999.999; default 0

POLI_VOLUME Volume 0 – 99999999.999; default 0

PRICE_BASE Price Base ‘Q’, ‘W’; default ‘Q’

PROM_CONTR_DATE Prom Contract Any valid date

QTY_CODE Quantity Unit All units in the ‘quantity’, ‘volume’, and ‘weight’ unit groups

REQ_LINE_ITEM Only for ‘PO’: Primary key of any requisition line item that has been released to procurement, can be used for purchase, and is part of the same project as the order

SUPPLY_PRICE Supply Price 0 – 99999999999.9999; default 0

TAG_NUMBER Tag Number Only valid for ’PO’, ’MP’, and ‘CO’ not referencing a previous line item; Default ’---’

VOL_CODE Volume Unit All units in the ‘volume’ unit group

WEIGHT_CODE Weight Unit All units in the ‘weight’ unit group

A.5.3 Procedure: ins_detail_poli This procedure can be used for creating a detail tag for a tagged item (functionality provided in the procurement, expediting, traffic, and site screens through the ‘Split Tag’ button).

A detail tag can only be created on the order line item level if the following conditions are met:

The item rule of the item type for the ident on this order line item is ‘TAB’, ‘TFM’, ‘TOM’, ‘TWM’, or ‘SWT’.

The tag number is unlike ‘---‘ and unlike ‘UNTAGGED’.

The order line item is not a detail tag.

One requisition line item at most is associated with the order line item.

34 SmartPlant Materials API Guide for Inquiries and Agreements

Page 35: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns 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.

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_POLI_ID NUMBER(12) IN

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

A.6 Table: m_item_ships, Package: m_api_ish A.6.1 Procedure: upd_ish

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_ISH_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

SmartPlant Materials API Guide for Inquiries and Agreements 35

Page 36: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.70.72 Allowable values

ACTUAL_CONTRACT_DATE PO Actual Any valid date

ACTUAL_FAB_COMP_DATE Actual Fab Comp Any valid date

ACTUAL_FAB_START_DATE Actual Fab Start Any valid date

ACTUAL_ON_SITE_DATE Actual On Site Any valid date

ACTUAL_SHIP_DATE Actual Ship Any valid date

COMMENTS Comment

DD_CODE Delivery Designation All delivery designations of A.10.39

EXPORT_LICENSE_REQ_IND Exp Lic Req ‘Y’, ‘N’

FAB_COMPLETE_PERCENT Comp % 0 – 100

FAB_LOCATION Fab Location

FAB_SHOP_CNTRL_NUMBER Fab Ctrl Number

FIFTY_PERCENT_FAB_COMP 50% Comp Any valid date

FINAL_INSPECT_DATE Final Inspect Any valid date

ITEM_SHIP_DIMENSIONS Dimension

ITEM_SHIP_QTY Quantity 0 – 999999999999.999

ITEM_SHIP_VOLUME Item Ship Volume 0 – 999999999999.999

ITEM_SHIP_WEIGHT Item Ship Weight 0 – 999999999999.999

MAJ_MATL_ORDER_DATE Maj Matl Order Any valid date

MAJ_MATL_RECV_DATE Maj Matl Recv Any valid date

PRED_ON_SITE_DATE Pred On Site Any valid date

PRED_SHIP_DATE Pred Ship Any valid date

PROM_CONTRACT_DATE Prom Contract Any valid date

PROM_FAB_COMP_DATE Prom Fab Comp Any valid date

PROM_INSPECT_DATE Prom Inspect Any valid date

36 SmartPlant Materials API Guide for Inquiries and Agreements

Page 37: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.70.72 Allowable values

PROM_SHIP_DATE Prom Ship Any valid date

QTY_CODE Qty Unit All units in the ‘weight’, ‘volume’, and ‘quantity’ unit groups; Update only allowed for detail tags

READY_ACTUAL Ready Actual Any valid date

READY_PREDICTED Ready Predicted Any valid date

REQ_SITE_DATE Req On Site Any valid date

REV_PROM_SHIP_DATE Curr/Rev Prom Ship Any valid date

RM_CODE Routing Method All routing methods of P.10.53

VOL_CODE Vol Unit All units in the ‘volume’ unit group

WEIGHT_CODE Weight Unit All units in the ‘weight’ unit group

A.6.2 Procedure: ins_ish You can only insert item shipments if the order has been approved.

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_POLI_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_ITEM_SHIP_ID NUMBER(12) OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

SmartPlant Materials API Guide for Inquiries and Agreements 37

Page 38: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.70.72 Allowable values

ACTUAL_CONTRACT_DATE PO Actual Any valid date

ACTUAL_FAB_COMP_DATE Actual Fab Comp Any valid date

ACTUAL_FAB_START_DATE Actual Fab Start Any valid date

ACTUAL_ON_SITE_DATE Actual On Site Any valid date

ACTUAL_SHIP_DATE Actual Ship Any valid date

COMMENTS Comment

DD_CODE Delivery Designation All delivery designations of A.10.39

EXPORT_LICENSE_REQ_IND Exp Lic Req ‘Y’, ‘N’

FAB_COMPLETE_PERCENT Comp % 0 – 100

FAB_LOCATION Fab Location

FAB_SHOP_CNTRL_NUMBER Fab Ctrl Number

FIFTY_PERCENT_FAB_COMP 50% Comp Any valid date

FINAL_INSPECT_DATE Final Inspect Any valid date

ITEM_SHIP_DIMENSIONS Dimension

ITEM_SHIP_POS Pos 1 – 9999999

ITEM_SHIP_SUB_POS Sub 0 – 99999

ITEM_SHIP_QTY Quantity 0 – 999999999999.999

ITEM_SHIP_VOLUME Item Ship Volume 0 – 999999999999.999

ITEM_SHIP_WEIGHT Item Ship Weight 0 – 999999999999.999

MAJ_MATL_ORDER_DATE Maj Matl Order Any valid date

MAJ_MATL_RECV_DATE Maj Matl Recv Any valid date

PRED_ON_SITE_DATE Pred On Site Any valid date

PRED_SHIP_DATE Pred Ship Any valid date

PROM_CONTRACT_DATE Prom Contract Any valid date

38 SmartPlant Materials API Guide for Inquiries and Agreements

Page 39: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on P.70.72 Allowable values

PROM_FAB_COMP_DATE Prom Fab Comp Any valid date

PROM_INSPECT_DATE Prom Inspect Any valid date

PROM_SHIP_DATE Prom Ship Any valid date

READY_ACTUAL Ready Actual Any valid date

READY_PREDICTED Ready Predicted Any valid date

REV_PROM_SHIP_DATE Curr/Rev Prom Ship Any valid date

RM_CODE Routing Method All routing methods of P.10.53

VOL_CODE Vol Unit All units in the ‘volume’ unit group

WEIGHT_CODE Weight Unit All units in the ‘weight’ unit group

A.6.3 Procedure: ins_detail_ish This procedure can be used for creating a detail tag for a tagged item (functionality provided in the procurement, expediting, traffic, and site screens via the ‘Split Tag’ button).

A detail tag can only be created on the item shipment level if the following conditions are met:

The item rule of the item type for the ident on this item shipment is ‘TAB’, ‘TFM’, ‘TOM’, ‘TWM’, or ‘SWT’.

The tag number is unlike ‘---‘ and unlike ‘UNTAGGED’.

The item shipment is not a detail tag.

Additional splits are created for the corresponding order line item (not as a detail tag but as ‘normal’ splits).

No split is occurred on the order line item level.

To create a detail tag using this procedure, you must connect to the project in which you want to create the split.

The p_ish_id parameter must be filled with the primary key of the item shipment that represents the master tag.

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_ISH_ID NUMBER(12) IN

SmartPlant Materials API Guide for Inquiries and Agreements 39

Page 40: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Argument Name Type In/Out

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

A.7 Table: m_used_other_costs, Package: m_api_uoc A.7.1 Procedure: upd_uoc

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_UOC_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

Column Name Prompt on D.50.12 Allowable values

COST_VALUE Cost Value 0 – 99999999999.99

CURRENCY_CODE Currency All units in the ‘currency’ unit group

EVAL_COST_IND Eval Cost ‘Y’, ‘N’

JOB_NUMBER Account Code All account codes defined on A.10.30

OC_CODE Other Cost All other costs defined on P.10.33

UNIT_PRICE_TYPE Unit Price Type NULL, ‘I’, ‘E’, ‘Q’, ‘R’

40 SmartPlant Materials API Guide for Inquiries and Agreements

Page 41: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns

A.7.2 Procedure: upd_uocn

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_UOC_ID NUMBER(12) IN

P_NLS_ID NUMBER(2) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

Column Name Prompt on D.50.12 Allowable values

DESCRIPTION Description

SHORT_DESC Short Desc

A.7.3 Procedure: ins_uoc

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_TERM_TYPE VARCHAR2(3) IN

P_PK_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

SmartPlant Materials API Guide for Inquiries and Agreements 41

Page 42: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Argument Name Type In/Out

P_UOC_ID NUMBER(12) OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

Column Name Prompt on D.50.12 Allowable values

COST_VALUE Cost Value 0 – 99999999999.99

CURRENCY_CODE Currency All units in the ‘currency’ unit group

JOB_NUMBER Account Code All account codes defined on A.10.30

OC_CODE Other Cost All other costs defined on P.10.33

UNIT_PRICE_TYPE Unit Price Type NULL, ‘I’, ‘E’, ‘Q’, ‘R’

A.7.4 Procedure: ins_uocn

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_UOC_ID NUMBER(12) IN

P_NLS_ID NUMBER(2) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

P_COMMIT_IND VARCHAR2 IN; DEFAULT ‘Y’

Column Name Prompt on D.50.12 Allowable values

DESCRIPTION Description

42 SmartPlant Materials API Guide for Inquiries and Agreements

Page 43: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Column Name Prompt on D.50.12 Allowable values

SHORT_DESC Short Desc

A.8 Package: m_api_misc A.8.1 Table: m_qs_cecs, Procedure: upd_qc

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_QC_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

Column Name Prompt on P.30.22 Allowable values

EVALUATION_TEXT Evaluation Text

A.8.2 Table: m_att_vdrs, Procedure: upd_attv

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_ATTV_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

SmartPlant Materials API Guide for Inquiries and Agreements 43

Page 44: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns

Column Name Prompt on D.40.21 Allowable values

PROMISE_WEEKS PW 0 – 999

A.8.3 Table: m_used_comments, Procedure: ins_uc

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_PK_ID1 NUMBER(12) IN

P_TABLE_NAME VARCHAR2(30) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

Column Name Prompt in D.50.21 Allowable values

USED_COMMENT Comment

A.8.4 Table: m_att_ppes, Procedure: ins_attp

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_PK_TYPE VARCHAR2(5) IN

P_PK_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

44 SmartPlant Materials API Guide for Inquiries and Agreements

Page 45: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Argument Name Type In/Out

P_ATTP_ID NUMBER(12) OUT

Column Name Prompt on D.50.13 Allowable values

PPE_CODE Prog Pay Event All progress payment events defined on P.10.31

A.8.5 Table: m_att_terms, Procedure: ins_attt

Argument Name Type In/Out

P_US_ID NUMBER(12) IN

P_PK_TYPE VARCHAR2(5) IN

P_PK_ID NUMBER(12) IN

P_COL_ARR RECORD IN

COL_NAME TABLE OF VARCHAR2(255) IN

COL_VALUE TABLE OF VARCHAR2(255) IN

P_RESULT VARCHAR2 OUT

Column Name Prompt on D.20.21 Allowable values

DESCRIPTION Description

ORDER_SEQ Seq 0 – 99999

TERM_PLACEMENT Placement ‘F’, ‘H’

SmartPlant Materials API Guide for Inquiries and Agreements 45

Page 46: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns

A.9 Package: m_api_opi_import A.9.1 Procedure: create_opi_job

Argument Name Type In/Out

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_RESULT VARCHAR2 OUT

P_RET_OPIJ_ID NUMBER(12) OUT

A.9.2 Procedure: start_opi_job

Argument Name Type In/Out

P_OPIJ_ID NUMBER(12) IN

P_RESULT VARCHAR2 OUT

46 SmartPlant Materials API Guide for Inquiries and Agreements

Page 47: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns

A.10 Table: m_invoices, Package: m_api_invoice This API must run in a valid project environment. In order to use this API for all the projects, you must select the Use for APIs check box for exactly one record on the A.20.06.02 User Securities for Projects screen. The user security of that record will then be used to set up the valid environment. For more information about user securities see User Securities for Projects in the SmartPlant Materials Administrator’s Guide, available from the Printable Guides page in the software.

A.10.1 Function: import_inv This function is used to import an invoice.

Argument Name Type In/Out

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

SmartPlant Materials API Guide for Inquiries and Agreements 47

Page 48: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Argument Name Type In/Out invoice_submit_date

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_RESULT NUMBER OUT

P_MESSAGE VARCHAR2 OUT

P_PROJ_ID VARCHAR2 IN

The function returns IVC_ID or -1 in case of an error.

48 SmartPlant Materials API Guide for Inquiries and Agreements

Page 49: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns

A.10.2 Function: import_inv_det This function is used to import invoice details.

Argument Name Type In/Out

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_RESULT NUMBER OUT

P_MESSAGE VARCHAR2 OUT

P_PROJ_ID VARCHAR2 IN

The function returns IVCD_ID or -1 in case of an error.

A.10.3 Procedure: upd_ret_percent This procedure is used to update the retention amount when the DBA setting INVOICE_RETENTION_CTRL is set to N.

Argument Name Type In/Out

P_IVC_NUMBER VARCHAR2 IN

P_SUP_CODE VARCHAR2 IN

P_PROJ_ID VARCHAR2 IN

P_RET_PERCENT NUMBER IN

SmartPlant Materials API Guide for Inquiries and Agreements 49

Page 50: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Argument Name Type In/Out

P_RET_AMOUNT NUMBER IN

Neither the p_ret_percent nor p_ret_amount must be null to store retention percentage.

A.10.4 Function: get_invoice_status This function is used to get the status of an invoice.

Argument Name Type In/Out

P_IVC_NUMBER VARCHAR2 IN

P_SUP_CODE VARCHAR2 IN

P_PROJ_ID VARCHAR2 IN

A.10.5 Function: get_invoice_field_value This function is used to get the value from the invoice of the column specified in the parameter.

Argument Name Type In/Out

P_IVC_NUMBER VARCHAR2 IN

P_SUP_CODE VARCHAR2 IN

P_IVC_FIELD VARCHAR2 IN

P_PROJ_ID VARCHAR2 IN

A.10.6 Procedure: upd_invoice_status This procedure is used to update the invoice status.

Argument Name Type In/Out

P_IVC_NUMBER VARCHAR2 IN

P_SUP_CODE VARCHAR2 IN

P_STATUS VARCHAR2 IN

P_PROJ_ID VARCHAR2 IN

Possible values of the invoice status are as in the following table:

50 SmartPlant Materials API Guide for Inquiries and Agreements

Page 51: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Invoice Status Invoice Status Description

N Not Submitted

S Submitted

NA Needs Assignment

P Pending

RFA Ready for Approval

RFFA Ready for Final Approval

A Approval

R Rejected

PA Paid

A.10.7 Procedure: upd_erp_fields This procedure is used to update the ERP fields.

Argument Name Type In/Out

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

A.10.8 Procedure: upd_invoice_fields This procedure is used to update values of the invoice columns.

Argument Name Type In/Out

P_PROJ_ID VARCHAR2 IN

P_IVC_NUMBER VARCHAR2 IN

P_SUP_CODE VARCHAR2 IN

SmartPlant Materials API Guide for Inquiries and Agreements 51

Page 52: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Packages and Supported Columns Argument Name Type In/Out

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.');

52 SmartPlant Materials API Guide for Inquiries and Agreements

Page 53: SmartPlant Materials API Guide for Inquiries and Agreements

A P P E N D I X B

The following date formats can be processed by the packages:

DD-MON-RR

DD-MON-YYYY

DD-MON

MM/DD

MM/RR

MM/YYYY

MM/DD/RR

MM/DD/YYYY

MMDDYYYY

YYYYMMDD

RRMMDD

MMDDRR

YYYY-MM-DD

Appendix: Supported Date Formats

SmartPlant Materials API Guide for Inquiries and Agreements 53

Page 54: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Supported Date Formats

54 SmartPlant Materials API Guide for Inquiries and Agreements

Page 55: SmartPlant Materials API Guide for Inquiries and Agreements

A P P E N D I X C

In the Error Number column, the packages replace yyy with the name of the column.

Error Number Meaning

101 - yyy Null value not allowed.

102 - yyy Value too large.

103 - yyy Value too small.

104 - yyy Value not numeric.

105 - yyy Invalid date.

106 - yyy Invalid value.

107 - yyy Date in future not allowed.

108 Unique key violation.

201 Object (inquiry, quote, quote detail, ...) does not exist.

202 NLS does not exist.

211 - yyy Update of column/table or insert not allowed after approval.

212 - yyy Update of column not allowed before approval.

213 Insert not allowed after approval of order.

214 Insert only allowed after approval of order.

215 Insert only allowed if no detail tags exist.

216 No update of order (or subsequent elements) without the ‘ASSIGN BUYER’ privilege or with not being the buyer of the order.

217 No insert/update because higher inquiry supplement exists already.

Appendix: Error Codes

SmartPlant Materials API Guide for Inquiries and Agreements 55

Page 56: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Error Codes Error Number Meaning

501 Account code cannot be changed because of the ZJ_USE_AC project default.

502 Supplier not updateable for change orders, manual orders with an assigned BO, and purchase orders based on NOCs.

503 PO_ISSUE_DATE cannot be changed because technical evaluation of corresponding quote summary is not yet completed.

504 PO_ISSUE_DATE cannot be changed because order is already closed.

505 PERFORMANCE_SCORE can only be set after order has been issued.

506 Indicator for evaluation cost cannot be set for orders or their line items.

507 split_qd_seq must be populated for splits of quote details.

508 split_qd_seq must not be populated for alternates of quote details.

509 Update/Insert of delivery designation requires update/insert of routing method, too.

510 Delivery designation and routing method do not match.

511 Last ship must be greater than or equal to first ship.

512 Update of order quantity not allowed because more than one requisition line item is assigned to order line item.

513 ZP_DEVATTR project default not set.

514 Invalid combination of PARENT_ORDER and ORDER_TYPE.

515 Referenced order line item does not exist or belongs to different order.

56 SmartPlant Materials API Guide for Inquiries and Agreements

Page 57: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Error Codes Error Number Meaning

516 Requisition line item does not exist, or requisition line item has not been released to procurement, or requisition cannot be used for purchase, or requisition belongs to different project.

517 Invalid order type.

518 Line items referring and not referring to a requisition line item cannot be mixed up on the same order.

519 Insert for manual PO referencing a BO not allowed.

520 No default defined for delivery designation (ZP_DLV_DSG project default).

521 Creation of detail tag not possible (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).

522 Update quantity of master tag not allowed.

523 Update of quantity not allowed because of MCS.

524 Quantity of a master tag can only be 1 or 0.

525 Update quantity of detail tag not allowed; master tag cancelled.

526 Update price of detail tag not allowed.

527 Update quantity unit only allowed for detail tags.

528 Update discount percent of detail tag not allowed.

529 Update discount amount of detail tag not allowed.

530 Alternates or splits cannot be created for master or detail tags.

531 Text and term already attached.

532 Ident of referenced requisition line item and of new order line item do not match.

533 Position already used on any supplement of order cycle.

SmartPlant Materials API Guide for Inquiries and Agreements 57

Page 58: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Error Codes Error Number Meaning

534 Update quantity not allowed because of multiple requisition line items

535 Update not allowed because of percentage setting

536 Corporate warehouse supplier not allowed.

537 Quantity update not allowed for order for corporate warehouse.

538 Insert not allowed on order for corporate warehouse.

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.

542 FIM supplier not allowed.

543 Quantity update not allowed for order for FIM warehouses.

544 Requisition line item cannot be assigned to the order line item because the requisition line item has already been consumed completely. Order line item was not imported.

545 Requisition line item does not exist.

546 Order approval is not possible. Requisition line item does not exist.

547 Quantity for requisition line item not available.

548 Requisition line item cannot be assigned to the order line item because the requisition line item has already been consumed completely or order quantity is not sufficient for requested cancellation.

549 At most, the specified quantity can be cancelled.

550 The tag numbers of the referenced requisition line item and of the new order line item do not match.

58 SmartPlant Materials API Guide for Inquiries and Agreements

Page 59: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Error Codes Error Number Meaning

601 - yyy Column only updateable for purchase and change orders.

602 - yyy Column only updateable for blanket orders and notices of commitment.

701 - yyy Missing privilege for updating column.

702 Invalid user security.

703 Project of object and of user security do not match.

750 - ORA-20000: MAR-zzzzz

An error has occurred in an internal procedure; MAR-zzzzz stands for a message number that can be seen on screen A.60.31.

yyy Column not supported by package.

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).

SmartPlant Materials API Guide for Inquiries and Agreements 59

Page 60: SmartPlant Materials API Guide for Inquiries and Agreements

Appendix: Error Codes

60 SmartPlant Materials API Guide for Inquiries and Agreements

Page 61: SmartPlant Materials API Guide for Inquiries and Agreements

A A.1 Table

m_inquiries, Package m_api_inq • 15

A.10 Table m_invoices, Package

m_api_invoice • 47 A.2 Table

m_quote_summaries, Package 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

P Preface • 7

S Special Feature for Units • 13

W What is Returned in p_result? • 12

Index

SmartPlant Materials API Guide for Inquiries and Agreements 61