Stock Transfer using X++ Code from one site, warehouse To another site, warehouse

Hello Freinds,

Please help me in regarding to Stock Transfer Using X++ Code from one site to another site, I got some code in which my shipment is ok but problem in shipment receive

for Example i am shiping 9 qty from one site 103 (WH : 103001) to Another site 102 (WH : 102001), my shipment is going ok but getting problem in shipment receive where only 1 qty is receiving always by default.

Please help freinds

My Code is AS below :-

void TO_PostShipandReceiveTO()

{

InventTransferParmTable inventTransferParmTable,inventTransferParmTable_sel;

InventTransferUpdShip inventTransferUpdShip;

InventTransferLine InventTransferLine;

InventTransferJour InventTransferJour_sel;

InventTransferId TransferId;

InventTransferParmTable itpt;

InventTransferUpdReceive itur;

;

//Shipment

TransferId = “WCL13_TN00001600”;

ttsBegin;

InventTransferLine = InventTransferLine::find(TransferId,1,True);

InventTransferLine.QtyShipNow = 3;

InventTransferLine.update();

ttsCommit;

inventTransferParmTable.clear();

inventTransferParmTable.initParmDefault();

inventTransferParmTable.ParmId = RunBaseMultiParm::getSysParmId();

inventTransferParmTable.TransferId = TransferId;

inventTransferParmTable.UpdateType = InventTransferUpdateType::Shipment;

inventTransferParmTable.PrintTransferReceipt = NoYes::No;

inventTransferParmTable.ShipUpdateQty = InventTransferShipUpdateQty::ShipNow;

//inventTransferParmTable.AutoReceiveQty = NoYes::Yes;

inventTransferParmTable.EditLines = NoYes::Yes;

inventTransferParmTable.ExplodeLines = NoYes::No;

inventTransferParmTable.InventDimFixedReceiveList = 0; // See note below on how to compute this.

inventTransferUpdShip = InventTransferUpdShip::newParmBuffer(inventTransferParmTable);

inventTransferUpdShip.run();

Info(“shiped qty Shipment is successfully”);

//Receive

Select firstfast InventTransferJour_sel

where InventTransferJour_sel.TransferId == TransferId &&

InventTransferJour_sel.UpdateType == InventTransferUpdateType::Shipment

notexists join inventTransferParmTable_sel

where InventTransferJour_sel.VoucherId == inventTransferParmTable_sel.VoucherShipmentId &&

inventTransferParmTable_sel.EditLines == NoYes::No;

ttsBegin;

InventTransferLine = InventTransferLine::find(TransferId,1,True);

InventTransferLine.QtyReceiveNow = 3;

InventTransferLine.update();

ttsCommit;

itpt.clear();

itpt.initParmDefault();

itpt.ParmId = RunBaseMultiParm::getSysParmId();

itpt.TransferId = TransferId;

itpt.UpdateType = InventTransferUpdateType::Receive;

itpt.PrintTransferReceipt = NoYes::No;

//itpt.ReceiveUpdateQty = InventTransferReceiveUpdateQty::Registered;

itpt.ReceiveUpdateQty = InventTransferReceiveUpdateQty::Shipment;

itpt.VoucherShipmentId = InventTransferJour_sel.VoucherId;//“WCL13_TV71506”;

itpt.EditLines = NoYes::Yes;

itpt.ExplodeLines = NoYes::No;

itpt.InventDimFixedReceiveList = 0; // See note below on how to compute this.

itur = InventTransferUpdReceive::newParmBuffer(itpt);

itur.

itur.run();

info(“Shipment qty received successfully”);

}