Hi @Tedi Kacerja!
If you have already updated WORKORDER with historyflag = 0 and status = WAPPR.
If you have already deleted the last WOSTATUS record.
You would need to do the following:
-update workview set historyflag = 0, status = 'WAPPR' where recordkey = 'UP1003852'
- delete assethierarchy where wonum = 'UP1003852'
I've tested it locally and it worked for me. In case that doesn't work for you, it's likely that when canceling each WO, Maximo is saving information somewhere else. You'll have to activate DEBUG and check what it's doing.
Regards!