How can we save Stock Transfer transactions when the system shows ‘invalid loc code’ ?

Cause:
System will not allow you to save the stock transfer if location from and location to are invalid value, or blank. System will show the msg ‘Invalid loc code’ or ‘loc code can not be blank’.
Remedies:
Stock transfer is the act of moving goods from one part of the location to another. When we are transferring any material from one physical location to another location,
Users should ensure that from location and to locations are valid and not blank for the items selected in item details. Users should also enter the lot number and lot sl in the details screen.