Just a little more FYI...
The same 'Format..' technique works well for padding the Customer No and/or Vendor No (assuming you are using numeric values for those!), PP Order No, SF Ord No, etc.
Watch out for the PO_No (Purchase Order No.. see POORDHDR_SQL). It is eight characters, with the...