IBM Support

How can the API cancelReservation be used to cancel reservations created in the past?

Troubleshooting


Problem

Consider a reservation created in the passed using the following input to reserveAvailableInventory-

<Promise EnterpriseCode="DEFAULT" OrganizationCode="DEFAULT">
    <ReservationParameters/>
    <PromiseLines>
    <PromiseLine FulfillmentType="" ItemID="WItem" LineId="1" RequiredQty="1" ShipNode="Node2" UnitOfMeasure="" ValidateItem="N">
    <ReservationParameters ExpirationDate="" ReservationID="0900014423180622155241"/>
    </PromiseLine>
    </PromiseLines>
</Promise>

 

This created the following reservation -

INSERT  /*YANTRA*/  INTO YFS_INVENTORY_RESERVATION(INVENTORY_RESERVATION_KEY,INVENTORY_ITEM_KEY,SHIPNODE_KEY,OWNER_KEY,SEGMENT,SEGMENT_TYPE,RESERVATION_ID,SHIP_DATE,QUANTITY,DEMAND_TYPE,INVENTORY_TAG_KEY,EXPIRATION_DATE,MIN_SHIP_BY_DATE,RESERVATION_TS,PRODUCT_AVAILABILITY_DATE,DELIVERY_METHOD,CREATETS,MODIFYTS,CREATEUSERID,MODIFYUSERID,CREATEPROGID,MODIFYPROGID,LOCKID) values ( '2018062912592744575','2018060513350137455','Node2','DEFAULT',' ',' ','0900014423180622155241','2018-06-29',1.0,'RESERVED',' ','2500-01-01T00:00:00','2400-01-01','2400-01-01T00:00:00','2018-06-29','SHP','2018-06-29T12:59:27','2018-06-29T12:59:27','admin','admin','SterlingHttpTester','SterlingHttpTester',0  )

Cancel this reservation the following day by passing the following input to the API cancelReservation-

<CancelReservation ItemID="WItem" OrganizationCode="DEFAULT" ProductClass="" QtyToBeCancelled="1"
    ReservationID="0900014423180622155241" ShipNode="Node2" UnitOfMeasure=""/>

This does not result in the reservation being cancelled

 

 

Cause

The application allows creation of  multiple reservations with different ShipDates having the same reservationID, shipnode and other details. SHIP_DATE is defaulted to the current date. All the details are required by the cancelReservation API to identify the correct reservation to be cancelled.

Diagnosing The Problem

Consider a scenario where there are two reservations with same INVENTORY_ITEM_KEY,RESERVATION_ID and SHIPNODE_KEY
1. If ShipDate is not defaulted to the current date in cancelReservation , it would be passed as NULL which would result in 0 records from DB, thus resulting in no reservations being cancelled.
2. If ShipDate is not passed at all in the above query, it would result in two reservations being cancelled, this would not be the expected behavior.
 

Resolving The Problem

Pass the required ShipDate in the input to cancelReservation to help identify the correct reservation to be cancelled.This is inserted in the yfs_inventory_reservation at the time of creation of the reservation.

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SS6PEW","label":"Sterling Order Management"},"Component":"","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF033","label":"Windows"}],"Version":"9.4, 9.5, 93","Edition":"","Line of Business":{"code":"LOB59","label":"Sustainability Software"}}]

Document Information

Modified date:
26 July 2018

UID

ibm10716899