Hi,
For clearing open items you can use BAPI_ACC_DOCUMENT_POST.
but need to write extra code in BTE
check this function module SAMPLE_INTERFACE_RWBAPI01.
need to update below four fields of table accit.
REBZG (document no against u want to clear)
REBZJ (fiscal year)
REBZZ (line item)
REBZT
to update these field use BTE.
Thanks,
Avadhut.