I thought so.
It is actually too late to do have this skip_transaction here.
You either put it directly to the field where you do your check (or just to the last field that is processed before the __END_OF_TRANSACTION__ section)
in this __END_OF_TRANSACTION__ section you should directly fill the variable followed by the transfer transaction like this:
IF LV_FLAG = 'X'
g_skip_transaction = 'X'.
transfer_transaction.
Else.
transfer_transaction.
ENDif.