IBM Support

findinventory API not giving all options for inventory fulfillment

Troubleshooting


Problem

findinventory API not giving all options for inventory fulfillment

Symptom

PART: API-OM 5.0 SP2 Platform
PRODUCT: Distributed Order Management
COMPONENT: findInventory API
OS: SUN
DATABASE: Oracle 8.1.7

The findInventory api is not returning all of the possible inventory fulfillment options when run. Changing the priorities of the ship nodes causes inconsistant results in the api.

This defect was simulated on Yantra 5.0 SP2 on the Yantra Support server (HP):

Use the following inXML as an example:

<Promise AllocationRuleID="SYSTEM" CarrierServiceCode="" CheckInventory="Y" DeliveryDateBased="Y" IgnorePromised="N" IgnoreUnpromised="N" MaximumRecords="20" OrganizationCode="DEFAULT" ShipNode="" >
<PromiseLines>
<PromiseLine ItemID="SJB100" LineId="1" ProductClass="A" RequiredQty="40" UnitOfMeasure="EA" />
<PromiseLine ItemID="SJB200" LineId="1" ProductClass="A" RequiredQty="40" UnitOfMeasure="EA" />
</PromiseLines>
</Promise>

Running the above xml in the api tester with the findInventory API will return the following xml:

- <Promise AllocationRuleID="SYSTEM" CarrierServiceCode="" CheckInventory="Y" DeliveryDateBased="Y" IgnorePromised="N" IgnoreUnpromised="N" MaximumRecords="20" OrganizationCode="DEFAULT" ShipNode="" YFC_Locale_Code="en_US_EST">
- <SuggestedOption>
- <Option FirstDate="10/20/2003" LastDate="10/20/2003" LeastPriority="100.00" MaxPriority="100.00" OptionNo="1" TotalAvailableQuantity="80.00" TotalShipments="2" TotalUnavailableQuantity="0.00">
- <PromiseLines TotalNumberOfRecords="2">
- <PromiseLine ItemID="SJB200" LineId="1" ProductClass="A" ReqEndDate="20031020T00:00:00" ReqStartDate="20031020T00:00:00" RequiredQty="40" UnitOfMeasure="EA">
- <Assignments TotalNumberOfRecords="2">
<Assignment DeliveryDate="10/20/2003" ExternalNode="Y" NodePriority="300.00" Quantity="20.00" ShipDate="10/20/2003" ShipNode="TEST2" />
<Assignment DeliveryDate="10/20/2003" ExternalNode="Y" NodePriority="500.00" Quantity="20.00" ShipDate="10/20/2003" ShipNode="TEST1" />
</Assignments>
</PromiseLine>
- <PromiseLine ItemID="SJB100" LineId="1" ProductClass="A" ReqEndDate="20031020T00:00:00" ReqStartDate="20031020T00:00:00" RequiredQty="40" UnitOfMeasure="EA">
- <Assignments TotalNumberOfRecords="2">
<Assignment DeliveryDate="10/20/2003" ExternalNode="Y" NodePriority="100.00" Quantity="35.00" ShipDate="10/20/2003" ShipNode="TEST2" />
<Assignment DeliveryDate="10/20/2003" ExternalNode="Y" NodePriority="200.00" Quantity="5.00" ShipDate="10/20/2003" ShipNode="TEST1" />
</Assignments>
</PromiseLine>
</PromiseLines>
</Option>
</SuggestedOption>
- <Options TotalNumberOfRecords="1">
- <Option FirstDate="10/20/2003" LastDate="10/20/2003" LeastPriority="200.00" MaxPriority="200.00" OptionNo="2" TotalAvailableQuantity="80.00" TotalShipments="2" TotalUnavailableQuantity="0.00">
- <PromiseLines TotalNumberOfRecords="2">
- <PromiseLine ItemID="SJB200" LineId="1" ProductClass="A" ReqEndDate="20031020T00:00:00" ReqStartDate="20031020T00:00:00" RequiredQty="40" UnitOfMeasure="EA">
- <Assignments TotalNumberOfRecords="2">
<Assignment DeliveryDate="10/20/2003" ExternalNode="Y" NodePriority="300.00" Quantity="20.00" ShipDate="10/20/2003" ShipNode="TEST2" />
<Assignment DeliveryDate="10/20/2003" ExternalNode="Y" NodePriority="500.00" Quantity="20.00" ShipDate="10/20/2003" ShipNode="TEST1" />
</Assignments>
</PromiseLine>
- <PromiseLine ItemID="SJB100" LineId="1" ProductClass="A" ReqEndDate="20031020T00:00:00" ReqStartDate="20031020T00:00:00" RequiredQty="40" UnitOfMeasure="EA">
- <Assignments TotalNumberOfRecords="1">
<Assignment DeliveryDate="10/20/2003" ExternalNode="Y" NodePriority="200.00" Quantity="40.00" ShipDate="10/20/2003" ShipNode="TEST1" />
</Assignments>
</PromiseLine>
</PromiseLines>
</Option>
</Options>
</Promise>

You will notice that the api returns different options for the fulfillment of the inventory. But looking at the inventory picture, you will see that item SJB200 can be fulfilled completely from a single ship node (this scenario is not outlined in the output). Changing the priority of the ship nodes will change the suggested option but also remove (or add) other inventory fulfillment options. Shouldn't all of the options be shown regardless of the ship node priority, etc?

Cause

Resolving The Problem

This API will not return all possible combination. It returns the first few best options for the input OptimizationType. You wrote "..But looking at the inventory picture, you will see that item SJB200 can be fulfilled completely from a single ship node..". This shows that your intention is to optimize on number of shipments (source from single node so that both items can be shipped from single node). So, pass "OptimizationType="03" in the inputXML and you will get the desired output. I ran you input XML with OptimizationType="03" and I got the following output XML:


- <Promise AllocationRuleID="SYSTEM" CarrierServiceCode="" CheckInventory="Y" DeliveryDateBased="Y" IgnorePromised="N" IgnoreUnpromised="N" MaximumRecords="20" OptimizationType="03" OrganizationCode="DEFAULT" YFC_Locale_Code="en_US_EST">
- <SuggestedOption>
- <Option FirstDate="10/21/2003" LastDate="10/21/2003" LeastPriority="200.00" MaxPriority="200.00" OptionNo="1" TotalAvailableQuantity="80.00" TotalShipments="1" TotalUnavailableQuantity="0.00">
- <PromiseLines TotalNumberOfRecords="2">
- <PromiseLine ItemID="SJB200" LineId="1" ProductClass="A" ReqEndDate="20031021T00:00:00" ReqStartDate="20031021T00:00:00" RequiredQty="40" UnitOfMeasure="EA">
- <Assignments TotalNumberOfRecords="1">
<Assignment DeliveryDate="10/21/2003" ExternalNode="Y" NodePriority="500.00" Quantity="40.00" ShipDate="10/21/2003" ShipNode="TEST1" />
</Assignments>
</PromiseLine>
- <PromiseLine ItemID="SJB100" LineId="1" ProductClass="A" ReqEndDate="20031021T00:00:00" ReqStartDate="20031021T00:00:00" RequiredQty="40" UnitOfMeasure="EA">
- <Assignments TotalNumberOfRecords="1">
<Assignment DeliveryDate="10/21/2003" ExternalNode="Y" NodePriority="200.00" Quantity="40.00" ShipDate="10/21/2003" ShipNode="TEST1" />
</Assignments>
</PromiseLine>
</PromiseLines>
</Option>
</SuggestedOption>
- <Options TotalNumberOfRecords="1">
- <Option FirstDate="10/21/2003" LastDate="01/01/2500" LeastPriority="100.00" MaxPriority="100.00" OptionNo="2" TotalAvailableQuantity="75.00" TotalShipments="2" TotalUnavailableQuantity="5.00">
- <PromiseLines TotalNumberOfRecords="2">
- <PromiseLine ItemID="SJB200" LineId="1" ProductClass="A" ReqEndDate="20031021T00:00:00" ReqStartDate="20031021T00:00:00" RequiredQty="40" UnitOfMeasure="EA">
- <Assignments TotalNumberOfRecords="2">
<Assignment DeliveryDate="10/21/2003" ExternalNode="Y" NodePriority="300.00" Quantity="20.00" ShipDate="10/21/2003" ShipNode="TEST2" />
<Assignment DeliveryDate="10/21/2003" ExternalNode="Y" NodePriority="500.00" Quantity="20.00" ShipDate="10/21/2003" ShipNode="TEST1" />
</Assignments>
</PromiseLine>
- <PromiseLine ItemID="SJB100" LineId="1" ProductClass="A" ReqEndDate="20031021T00:00:00" ReqStartDate="20031021T00:00:00" RequiredQty="40" UnitOfMeasure="EA">
- <Assignments TotalNumberOfRecords="2">
<Assignment DeliveryDate="10/21/2003" ExternalNode="Y" NodePriority="100.00" Quantity="35.00" ShipDate="10/21/2003" ShipNode="TEST2" />
<Assignment DeliveryDate="" NodePriority="" Quantity="5.00" ShipDate="" ShipNode="" />
</Assignments>
</PromiseLine>
</PromiseLines>
</Option>
</Options>
</Promise>

From the Java Docs:
findInventory API returns a suggested option based on the specified constraints. In addition to the suggested option it returns a list of reasonable options. Note that it does not enumerate all possible options. Options are eliminated based on a complex search algorithm to avoid presenting redundant combinations. Optimization type influences the search algorithm significantly and an appropriate value should be used.

OptimizationType
Optional. This value determines the optimization rules to be applied to the scheduling process. Possible values are: 01: Optimize on date. 02: Optimize on ship node priority. 03: Optimize on number of shipments.
Validation: None. If not passed or an invalid value is passed then the system defaults the value to 01(Optimize on date).

Based on the above docs the API is working as designed. Not showing a particular option is not a defect but they might be able to gain some control by using a value for the optimization type instead of leaving it as the default value. In their scenario shipping 3 items as 3 shipments 1 from each of the whse is a valid one but just not showing up in the results. currently there is no way that exsiting optimization types alone can acheive that. Even setting it to 3 could indicate any combination of 3 shipments.

[{"Product":{"code":"SS6PEW","label":"IBM Sterling Order Management"},"Business Unit":{"code":"BU048","label":"IBM Software"},"Component":"Not Applicable","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Historical Number

PRI49291

Product Synonym

[<p><b>]Fact[</b><p>];

Document Information

Modified date:
16 June 2018

UID

swg21533676