Create Forecasts - Intergraph Smart Materials - Version 2017 (2.0) - Help - Hexagon PPM

Intergraph Smart Materials Web API Help 2017 (2.0)

PPMProduct
Intergraph Smart Materials
PPMCategory_custom
Help

Name and Description

Forecasts - Creates a forecast header in Smart Materials. Each forecast run is based on a forecast header which defines parameters like work packages, warehouses used, and so forth. A forecast run is defined in a project by a forecast header code in combination with a unique run number.

URL Format

/Projects(':project')/Disciplines(':discipline')/Nls(':language')/ForecastHeaders

Specify values for project, discipline, language and key parameters in the URL. The first three values together define a project environment in which the forecast header is created. The key parameter defines the forecast header id, for which the description is created.

Use the following read-only APIs to get the available values for each parameter.

/Projects,

/projects(':project')/Disciplines,

/projects(':project')/Disciplines(':discipline')/nls

URL Parameter

:project, :discipline, :language

Method

POST

Required Privilege

API_CREATE_FAHEADER

Data Parameter

The payload of the request should be in JSON format with the following structure:

Forecast Entity Type Metadata:

EntityType Name="Forecast">

<Key>

<PropertyRef Name="Key"/>

</Key>

<Property Name="Key" Type="Edm.Int64" Nullable="false"/>

<Property Name="ForecastHeader" Type="Com.Ingr.Smat.Core.V1.ForecastHeader" Nullable="false"/>

<Property Name="Lns" Type="Collection (Edm.String)"/>

<Property Name="Whs" Type="Collection (Com.Ingr.Smat.Core.V1.ForecastWarehouse)"/>

<Property Name="Wps" Type="Collection(Com.Ingr.Smat.Core.V1.ForecastWorkpackage)" Nullable="false"/>

<Property Name="FahTemplate" Type="Com.Ingr.Smat.Core.V1.FaHeaderTemplate"/>

<Property Name="AutoAssignWhInd" Type="Com.Ingr.Smat.Core.V1.YesOrNo" Nullable="false"/>

</EntityType>

Where:

ForecastHeader (Com.Ingr.Smat.Core.V1.ForecastHeader and Not Nullable): ForecastHeader is of type Com.Ingr.Smat.Core.V1.ForecastHeader and it is mandatory value. Use the following Read-Only API to see the existing FaHeaders.

https://{host}/Smat/V1/Projects(‘:project’)/Disciplines(‘:discipline’)/Nls(‘:language’)/FaHeaders

Lns (Collection of Edm.String): It is a collection of LnCode values. Use following Read-Only API for to view the list of nodes.

https://{host}/Smat/V1/Projects(‘:project’)/Disciplines(‘:discipline’)/Nls(‘:language’)/ListnodesUse

following Read-Only API to view the Warehouses.

https://{host}/Smat/V1/Projects(‘:project’)/Disciplines(‘:discipline’)/Nls(‘:language’)/Warehouses

Whs (Collection of Com.Ingr.Smat.Core.V1.ForecastWarehouse): It is a collection of ForecastWarehouse JSON objects. Use following Read-Only API to view the Warehouses.

https://{host}/Smat/V1/Projects(‘:project’)/Disciplines(‘:discipline’)/Nls(‘:language’)/Warehouses

Wps Type (Collection of Com.Ingr.Smat.Core.V1.ForecastWorkpackage and Not Nullable): It is a mandatory value. It is a collection of ForecastWorkpackage JSON objects.

FahTemplate (Com.Ingr.Smat.Core.V1. FaHeaderTemplate):

AutoAssignWhInd (Com.Ingr.Smat.Core.V1.YesOrNo and Not ullable): It is of Boolean type. It accepts Y or N. If the value is Y then it adds all the Warehouses.

ForecastHeader Complex Type Metadata:

<ComplexType Name="ForecastHeader">

<Property Name="FahCode" Type="Edm.String" Nullable="false"/>

<Property Name="RunNumber" Type="Edm.Decimal" Nullable="false"/>

<Property Name="Shortage" Type="Edm.String"/>

<Property Name="AllocateLevel" Type="Edm.String"/>

<Property Name="SplitType" Type="Edm.String"/>

<Property Name="AttrId" Type="Edm.Decimal"/>

<Property Name="DtpId" Type="Edm.Decimal"/>

<Property Name="DdId" Type="Edm.Decimal"/>

<Property Name="Priority" Type="Edm.String"/>

<Property Name="WeightOption" Type="Edm.String"/>

<Property Name="WeightAttrId" Type="Edm.Decimal"/>

<Property Name="TagNoOption" Type="Edm.String"/>

<Property Name="AllPositionsInd" Type="Edm.String"/>

<Property Name="MarkAlreadyRiInd" Type="Edm.String"/>

<Property Name="SubstInd" Type="Edm.String"/>

<Property Name="ExcludeMirQtyInd" Type="Edm.String"/>

<Property Name="BestQuantityInd" Type="Edm.String"/>

<Property Name="UseOnlySiteStatusInd" Type="Edm.String"/>

<Property Name="OnlyEndnodesInd" Type="Edm.String"/>

<Property Name="StatId" Type="Edm.Decimal"/>

<Property Name="LstId" Type="Edm.Decimal" Nullable="false"/>

<Property Name="WeightInd" Type="Edm.String"/>

<Property Name="CostInd" Type="Edm.String"/>

<Property Name="HourInd" Type="Edm.String"/>

<Property Name="StartDate" Type="Edm.DateTimeOffset"/>

<Property Name="EndDate" Type="Edm.DateTimeOffset"/>

<Property Name="IgnoreNullDateInd" Type="Edm.String"/>

<Property Name="SplitResult" Type="Edm.String"/>

</ComplexType>

Where:

FahCode (Edm.String, Not Nullable): Each forecast run is described by a code (name) which represents what the forecast does. Additionally there is a run number which is unique within one project and one code. Use following Read-Only API for viewing the existing FAH_CODE list.

https://{host}/Smat/V1/Projects(‘:project’)/Disciplines(‘:discipline’)/Nls(‘:language’)/FaHeaders

RunNumber (Edm.Decimal, Not Nullable): Each forecast header is identified by a code field and a sequence number unique for this code within the project. When a new forecast header (with a new code entry) is entered this run number becomes the value 1. When the same forecast header with similar selections is to be specified the user only creates a new run number. This copies all of the selection parameters from the old forecast header. Use following Read-Only API for viewing the existing FAH_CODE list.

https://{host}/Smat/V1/Projects(‘:project’)/Disciplines(‘:discipline’)/Nls(‘:language’)/FaHeaders

Shortage (Edm.String): Acceptable short quantities for allocating the Bill of Materials. Allowed values are ‘2P-A’, ‘2P-1’, ‘2P-2’, ‘2P-C’,’1P-A’, or ‘ED’.

Sl. No.

SHORTAGE CODE

Description

1

2P-A

2-Pass Optimized (Any)

2

2P-1

2-Pass Optimized (1)

3

2P-2

2-Pass Optimized (2)

4

2P-C

2-Pass CIP

5

1P-A

1-Pass Single (Any)

6

ED

Only entire Drawings

AllocateLevel (Edm.String): Defines up to what pre-receiving level the forecast run should look for material. Allowed values are ‘INV’, ’TRA’, ‘ISH’, ‘PO’, ‘ER’, or ‘ERALL’.

The forecast run starts on inventory level and looks for material up to the level that has been selected here. For this search only list positions with outstanding quantities are taken into account.

It follows a description of the different allocation levels.

Only Inventory (INV): The material must be in the inventory and must be found in a warehouse that has been assigned to the forecast run via screen C.30.01.01.

Traffic - BOL and Containers (TRA): This level is only available if you are working with basic expediting and traffic.

Item shipments that have been assigned to a material receipt in screen P.80.11 or to a BOL or a container in screen P.80.51 are taken into account. The MR quantity and traffic quantity respectively are used in this case instead of the item shipment quantity.

Shipped Items (ISH): The material must have been shipped. i.e., field 'Actual Ship' must be filled in expediting.

Approved Purchase Orders (PO): The material may not be shipped but the order must be approved. If approved change orders exist these are taken into account. If you work with notices of commitment these are used instead as long as no approved PO has been created for them.

Approved Requisitions (ER): Material of the latest approved PO requisition supplements is also taken into account. An unapproved supplement must not exist. The result of 'Total Release Qty - Last Total Release Qty' is used as quantity.

All Requisitions (ERALL): This level works in the same way as level 'Approved Requisitions'. The only difference is that the latest supplement is taken into account regardless of whether it has been approved or not.

SplitType (Edm.String): Type by which forecast run is split. Allowed values are ‘NO’, ‘NN’, ‘NA’, and ‘PA’.

Sl. No.

SPLIT_TYPE Code

Description

1

NO

None

2

NN

Node Name

3

NA

Node Attribute

4

PA

Position Attribute

AttrId (Edm.Decimal): Name (code) of the attribute which is to be used if split type 'Node Attribute' or 'Position Attribute' has been chosen. Use following Read-Only API to view the attribute IDs.

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/Attrs

DtpId (Edm.Decimal): Name (Code) of the Delivery Type. Use following Read-Only API to view the list of delivery type IDs:

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/DelvTypes

DdId (Edm.Decimal): Name (code) of the delivery designation. Use following Read-Only API to view the list of delivery designation IDs:

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/DelvDesigs

Priority (Edm.String): Type of priority specified for nodes assigned to the work packages within this forecast run.

WeightOption (Edm.String): Indicator if weight information shall be calculated and displayed when viewing the result of a forecast run. Allowed values are DESC, ASC and N.

WeightAttrId (Edm.Decimal): Use following Read-Only API to view the list of attribute IDs.

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/Attrs

TagNoOption (Edm.String): Allowed values are IGNORE and NOT_IGNORE.

AllPositionsInd (Edm.String): Allowed values are ‘Y’ and ‘N’.

MarkAlreadyRiInd (Edm.String): Allowed values are ‘Y’ and ‘N’.

SubstInd (Edm.String): Allowed values are Y, N, and A.

ExcludeMirQtyInd (Edm.String): Allowed values are ‘Y’ and ‘N’.

BestQuantityInd (Edm.String): Indicator if the best quantity of list position should be calculated. Allowed values are ‘Y’ and ‘N’.

StatId (Edm.Decimal): Use following Read-Only API to view the list of issue status IDs.

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/Status

UseOnlySiteStatusInd (Edm.String): Allowed values are ‘Y’ and ‘N’.

OnlyEndnodesInd (Edm.String): Allowed values are ‘Y’ and ‘N’.

LstId (Edm.Decimal, Not Nullable): Use following Read-Only API to view the list of nodes:

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/Listnodes

WeightInd (Edm.String): Allowed values are ‘Y’ and ‘N’.

CostInd (Edm.String): Allowed values are ‘Y’ and ‘N’.

HourInd (Edm.String): Allowed values are ‘Y’ and ‘N’.

StartDate (Edm.DateTimeOffset): Searching for item shipments the promised on Site date of which is greater than the start date defined here. The acceptable value is a date in the format of "YYYY-MM-DD".

EndDate (Edm.DateTimeOffset): Searching for item shipments the promised on Site date of which is lower than the end date defined here. The acceptable value is a date in the format of "YYYY-MM-DD".

IgnoreNullDateInd (Edm.String): Allowed values are ‘Y’ and ‘N’.

SPLIT_RESULT (Edm.String):

ForecastWarehouse Complex Type Metadata:

Below is the JSON structure of Com.Ingr.Smat.Core.V1.ForecastWarehouse type:

<ComplexType Name="ForecastWarehouse">

<Property Name="OrderSeq" Type="Edm.Decimal"/>

<Property Name="WhCode" Type="Edm.String"/>

<Property Name="BnlCode" Type="Edm.String"/>

</ComplexType>

Where:

OrderSeq (Edm.Decimal): Sequence of the warehouses to be considered while forecasting.

WhCode (Edm.String): Warehouse code. Use following Read-Only API to view the list warehouses and codes.

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/Warehouses

BnlCode (Edm.String): Bin location code.

ForecastWorkpackage Complex Type Metadata:

Below is the JSON structure of Com.Ingr.Smat.Core.V1.ForecastWorkpackage type:

<ComplexType Name="ForecastWorkpackage">

<Property Name="OrderSeq" Type="Edm.Decimal"/>

<Property Name="WpId" Type="Edm.Decimal"/>

<Property Name="RosDate" Type="Edm.DateTimeOffset"/>

<Property Name="PriorityType" Type="Edm.String"/>

<Property Name="AttrCode" Type="Edm.String"/>

<Property Name="AttrSort" Type="Edm.String"/>

<Property Name="Attrs" Type="Collection(Com.Ingr.Smat.Core.V1.Attr)"/>

<Property Name="CommodityCodes" Type="Collection(Com.Ingr.Smat.Core.V1.QueryConditionCc)"/>

</ComplexType>

Where:

OrderSeq (Edm.Decimal): Sequence of the work package to be considered while forecasting.

WpId (Edm.Decimal): Use following Read-Only API for viewing the list of Work packages.

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/Workpacks

RosDate (Edm.DateTimeOffset): Required on Site date for a work package. The acceptable value is a date in the format of "YYYY-MM-DD".

PriorityType (Edm.String): Type of priority specified for this work package within this forecast run.

AttrCode (Edm.String): Internal value, no NLS. It is specified when the attribute was created.

AttrSort (Edm.String): If the priority for a work package is 'Attribute', this option controls the sort order.

Attrs (Collection(Com.Ingr.Smat.Core.V1.Attr)):

CommodityCodes (Collection(Com.Ingr.Smat.Core.V1.QueryConditionCc)):

Attr Complex Type Metadata:

Below is the JSON structure of Com.Ingr.Smat.Core.V1.Attr type:

<ComplexType Name="Attr">

<Property Name="AttrCode" Type="Edm.String" Nullable="false"/>

<Property Name="AtrValue" Type="Edm.String"/>

</ComplexType>

Where:

AttrCode (Edm.String, Not Nullable): Use following Read-Only API to view the list of attributes.

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/Attrs

AttrValue (Edm.String): Use following Read-Only API to view the list of attributes.

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/Attrs

QueryConditionCcComplex Type Metadata:

Below is the JSON structure of Com.Ingr.Smat.Core.V1.QueryConditionCc type:

<ComplexType Name="QueryConditionCc">

<Property Name="CommodityCode" Type="Edm.String" Nullable="false"/>

<Property Name="Input1" Type="Edm.String"/>

<Property Name="Input2" Type="Edm.String"/>

<Property Name="Input3" Type="Edm.String"/>

<Property Name="Input4" Type="Edm.String"/>

<Property Name="Input5" Type="Edm.String"/>

</ComplexType>

Where:

CommodityCode (Edm.String, Not Nullable): Use following Read-Only API to view the list of commodity codes:

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language’)/CommodityCodes

Input1 (Edm.String):

Input2 (Edm.String):

Input3 (Edm.String):

Input4 (Edm.String):

Input5 (Edm.String):

FaHeaderTemplate Complex Type Metadata:

Below is the JSON structure of Com.Ingr.Smat.Core.V1. FaHeaderTemplate type:

<ComplexType Name="FaHeaderTemplate">

<Property Name="FahCode" Type="Edm.String" Nullable="false"/>

<Property Name="RunNumber" Type="Edm.Decimal" Nullable="false"/>

</ComplexType>

Where:

FahCode (Edm.String, Not Nullable): Use following Read-Only API to view the existing forecast headers.

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/FaHeaders

RunNumber (Edm.Decimal, Not Nullable): Each forecast header is identified by a code field and a sequence number unique for this code within the project. When a new forecast header (with a new code entry) is entered this run number becomes the value 1. When the same forecast header with similar selections is to be specified the user only creates a new run number. This copies all of the selection parameters from the old forecast header. Use following Read-Only API for viewing the existing FAH_CODE list.

https://{host}/Smat/V1/Projects(':project')/Disciplines(':discipline')/Nls(':language')/FaHeaders

Example Data:

{

"FaHeader":{

"FahCode ":'FAHCODE34',

"RunNumber ":15,

"Shortage ":'2P-1',

"AllocateLevel ":'ISH',

"SplitType":'PA',

"AttrId":5329,

"DtpId":10000000672,

"Priority": 'ATTR',

"WeightOption": 'DESC',

"WeightAttrId":502008,

"TagNoOption":'NOT_IGNORE',

"AllPositionsInd": 'Y',

"MarkAlreadyRiInd": 'Y',

"SubstInd": 'Y',

"ExcludeMirQtyInd": 'Y',

"BestQuantityInd":' Y',

"UseOnlySiteStatusInd ":'Y',

"OnlyEndnodesInd ":'Y',

"StatId":5218,

"LstId":5021,

WeightInd" :'Y',

"CostInd" :'Y',

"HourInd": 'Y',

"StartDate":''

"EndDate":''

"IgnoreNullDateInd" :'Y',

"SplitResult": 'Split Results Test 01' },

"Wh":[

{

"OrderSeq":1,

"WhCode": "ASW" },

{

"OrderSeq ":2,

"WhCode":"ASW2" }

],

"Wp":[

{

"OrderSeq ":1,

"WpId ": 5120 },

{

"OrderSeq ":2,

"WpId ": 5741 }

],

"AutoAssignWhInd":'N'

}

Success Response

Following HTTP status code is sent back to client on the Success of the API execution:

Code: 200 OK

Content:

{

"@odata.context": "https://{host}/Smat/V1/$metadata#Edm.Int64",

"value": 10000009482

}

Error Response

Notes

After creating Forecast Header, NLS description can be added using Header Nls.