You could either set a variant on screen MB51 and then just run by that variant you want.
Or you would have to create a custom program and do GET parameter <all parameter ids related to fields in MB51> and FREE MEMORY <all parameter ids related to fields in MB51>.