I found an example where the quantity shipped is written to a UDT.
strInvoiceNo=""
strInvoiceNo=""
strLineNo=""
strTariffCode=""
qtyShipped=0
retVal = oBusObj.GetValue("InvoiceNo$", strInvoiceNo)
retVal = oBusObj.GetValue("LineKey$", strLineNo)
retVal = oBusObj.GetValue("QuantityShipped$", qtyShipped)
retVal = oBusObj.GetValue("UDF_Tariff_Code$", strTariffCode)
'msgbox("*"&qtyShipped)
oShadow = oSession.GetObject("CM_UDTMaint_bus", "SO_UDT_SO_Shipments")
Set oShadow = oScript.AsObject(oShadow) ' establish oShadow as an object handle
retVal = oShadow.SetKey(strInvoiceNo & strLineNo)
retVal = oShadow.SetValue("UDF_Qty_Shipped", qtyShipped)
retVal = oShadow.SetValue("UDF_Tariff_Code$", strTariffCode)
retVal = oShadow.Write()
------------------------------
Michael Nottoli
Accounting Information Solutions
------------------------------