If you want to post Transfer order for shipment or receive at runtime then this code can help you. You need to use InventTransferParmTable object and InventTransferUpdShip class object to do the same.
InventTransferParmTable inventTransferParmTable;
InventTransferTable inventTransferTable;
inventTransferUpdShip inventTransferUpdShip;
;
select inventTransferTable where inventTransferTable.TransferId =='00140_080';
inventTransferParmTable.clear();
inventTransferParmTable.initParmDefault();
inventTransferParmTable.ParmId = RunBaseMultiParm::getSysParmId();
inventTransferParmTable.TransferId =inventTransferTable.TransferId;
inventTransferParmTable.UpdateType = InventTransferUpdateType::Shipment;
inventTransferParmTable.ShipUpdateQty = InventTransferShipUpdateQty::ShipNow;
inventTransferParmTable.ExecutedDate = systemdateget();
inventTransferUpdShip = InventTransferUpdShip::newParmBuffer
(inventTransferParmTable);
inventTransferUpdShip.run();