how to resolve undefined property error
When you write $node-&gt;$sku, PHP takes the value of $sku and uses it as name of a property.
In your case, $sku contains 'tshirt-11', and $node-&gt;$sku is equivalent to $node-&gt;tshirt-11. Since $node-&gt;tshirt-11 is not defined, you get the error you see.

The code you should write is the following one.

  uc_stock_set($sku, $stock_value);
  uc_stock_adjust($sku, $stock_value);


As side note, the value of a field is accessed using field_get_items(). The code you use to set $sku should be rewritten as the following.

$items = field_get_items('node', $node, 'field_sku');
$sku = $items[0];