Hi,
You can use std. task TS00008029 that uses method FIPP.FLAGRELEASESET for your requirement. We are using it and it's working fine. If you want to use it outside workflow, you can use the FM "PRELIMINARY_POSTING_REL_SET" that is used in the above method.
Hope this helps.
Regards,
venu