SAP helped me to solve this issue. The answer follows.
I tried to reproduce this issue in the DemoUK (GB Localization) database and was able to reproduce as well.
After the investigation, it was found that you cannot link a state which does not exist for the specific country.
In your case, the system throws the error because the data is validated based on the following query:
SELECT* FROM OCST WHERE "Code" = 'SP' and "Country" = ''
Similarly, if I will try to set the State as 'Arizona' and Country as 'United Kingdom', it will give me the same error because the correct 'Country' value should be 'USA'.
Therefore, in order to resolve this issue, you need to opt out one of the following:
- Set the Country property also in the DI Code (State should belong to the Country which you are trying to set):
oBP.Addresses.Country = "GB"
- Remove the State property from the DI Code:
oBP.Addresses.State = "SP"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…