You can either use perform logic set up on the after assign of the sales order number or use a calculated temp field set up as a number on the header and set to clear after each record.
You want to use the detail object's CopyLinesFromSalesOrder method. The first argument is the sales order number and the second argument indicates to ship in full ("Y") or not ("N").
------------------------------
David Speck II
Tennessee Software Solutions
------------------------------