1. If the sales invoice is outstanding, the reference can be changed.  
  2. If the sales invoice is completed, you can use the Maintenance facility to mark it back to outstanding and change the reference.
  3. If the sales invoice is posted then the invoice is in the financial software and cannot be changed.