In order to fully cancel a warehouse transfer, it needs to be cancelled at both the Header and Detail level. To cancel it at the header level, set the Closed Date to any past date.


BEGIN TRAN UPDATE in_wthdr_tbl SET in_wthdr_clsdt=GETDATE() WHERE in_wthdr_key='41250' AND in_wthdr_towhs='APLW'


You then need to cancel all of the detail records by setting the Closed Date there also. But you also need to set the Status to 7.


BEGIN TRAN UPDATE in_wtdtl_tbl SET in_wtdtl_clsdt=GETDATE(),in_wtdtl_stat=7 WHERE in_wthdr_key='41250' AND in_wthdr_towhs='APLW'