"The province of the source document or source document line could not be updated." error occurs while confirming the po

Hi,

while confirming the PO I am getting error like a “The province of the source document or source document line could not be updated.”,for your reference please find the screenshots.please tell me to resolve the error.

please suggest me to resolve the error.

Can you please provide more details about the PO and its current status?

I have a purchase order with one line,current status of the po is open order.while confirming po i am getting above error.

SourceDocumentLine sline;
SysDictTable table;
PurchTable header;
PurchLine purchline;
PurchId purchId = “PO020”;
boolean fix;
Common rec;
int fieldId, found, notfound;

if (purchId)
{
while select purchLine where purchLine.PurchId == purchId
{
while select forUpdate sline where sline.ParentSourceDocumentLine == purchLine.SourceDocumentLine
{
table = new SysDictTable(sline.SourceRelationType);
rec = table.makeRecord();
fieldId = fieldName2id(sline.SourceRelationType, “SourceDocumentLine”);
select rec where rec.(fieldId) == sline.RecId;

if (rec.RecId)
{
info(strFmt(“Record Match Found %1 %2”, table.name(),rec.caption()));
found++;
}
else
{
ttsBegin;
sline.doDelete();
ttsCommit;
info(strFmt(“Orphan Found %1”, table.name()));
notfound++;

}

}
info(strFmt(“Found %1”, found));
info(strFmt(“Orphans found and deleted %1”,notfound));
found = 0;
notfound = 0;
}
}
I tried this job error is not recovered.can u suggest me to resolve the error.

Were you able to view the distributions related to that PO? Were you able to delete and add the line item again?

Yes…Distribution is in view.distribution amount is present for the po.

There seems to be some data issue with this PO, that you have to debug and identify.
Create a similar PO, debug and see the difference.