Hi, Clemens.
If you just about full clearing by itemless document then ... to use BAPI_ACC_DOCUMENT_POST whould be excessive I think. And besides, sample code above whouldn't work, it has to be improved for the case of itemless clearing.
To cover your goal you may try:
- specific , and pay attention
- or FMs 'POSTING_INTERFACE_xxx', .