Un-apply for realized gain/loss details vendor ledger entry

Hi,

I would like to know, how to do un-apply payment entry with realized gain and loss?

When i trying to do un apply navision show the below message:

“The last transaction No. must be application in vendor ledger entry no.XXXXXXX”