I am creating a sales order using BAPI_SALESORDER_CREATEFROMDAT2 which internally calls SD_SALESDOCUMENT_CREATE.
The order is for a one time customer created in KNA1. The address lines are fed in to the BAPI while creating order and also VAT REG No.
Structure PARTNERS_EX of SD_SALESDOCUMENT_CREATE has the VAT_REG_NO field.
Here I am specifying the country code and the VAT REg No for the Sold to Party and Ship To Party.
I am specifying the address in PARTNERADDRESSES structure.
The order is created with correct details, but the VAT_REG_NO is not populated from the BAPI field.
However, if i ammend the order in VA02, the order accepts VAT_REG_NO and calculates tax for EU countries correctly.
Any idea why the VAT reg Number is blanked out while creating order from BAPI?