Yes:Is it possible to do that in some way?
move 'leading' to option
IF OPTION = 'LEADING'
THEN move function trim(checkfield, 'LEADING') to field
ELSE move function trim(checkfield, 'TRAILING') to field
IF OPTION = 'LEADING'
THEN move function trim(checkfield, 'LEADING') to field
ELSE move function trim(checkfield, 'TRAILING') to field