As Venu suggested, in the sales order item level, changing the item category to TAS (or the custom) item category for third party will meet your requirement. To automate this process, you have to handle it with userexits. Hopefully the exit 'move field to VBAP' can handle this logic.
But, you should be clear about the term 'non-availability of matetrial'. Does it mean...if the delivery couldn't be confirmed for the requested delivery date? or is it related to the material availability date? or any other reason? Please let us know the business scenario and the business need behind this requirement.
Regards,
Ravi Sankar