这里介绍下如何删除parked状态的会计凭证,即在BKPF表里,BSTAT的值要为V,而在调用FM函数:PRELIMINARY_POSTING_DOC_DELETE 进行删除时,要记得把这个状态值传入Z,表示删除
parked document在表BSEG里不会有数据,而是在表BKPF, VBKPF, VBSEG* (如:VBSEGS,VBSEGK,VBSEGA,VBSEGD)
而函数PRELIMINARY_POSTING_DOC_DELETE会删除parked document在这几个表里的数据,但并不会删除BKPF表里的数据,所以在调用该函数时,需要手动传入BSTAT的值:V,表示需要将BKPF-BSTAT更改为V
可参照该文章:FAQ about parked document for ABAPer | SAP Blogs
Q: Where is the Parked document been stored?
A: Parked documents are stored in VBKPF and VBSEG* tables; VBSEGS is a particular case of parked documents on G/L accounts. A parked document will be stored in VBKPF and BKPF (with document status BSTAT equal to ‘V’). It will be stored in one or numerous VBSEG* tables. It will come to BSEG after the posting and consequently be deleted from VBKPF and VBSEG*.
- VBSEG Document Parking Document Segment – General Structure
- VBSEGA Document Segment for Document Parking – Asset Database
- VBSEGD Document Segment for Customer Document Parking
- VBSEGK Document Segment for Vendor Document Parking
- VBSEGS Document Segment for Document Parking – G/L Account Database
Q: Function modules to create/change/post parked documents?
- PRELIMINARY_POSTING_FB01 for Creation Details&Code example
- BAPI_ACC_GL_POSTING_POST for creation Details&Code example
- PRELIMINARY_POSTING_DOC_READ for fetch data Details&Code example
- PRELIMINARY_POSTING_DOC_WRITE for Change data Details&Code example
- BAPI_ACC_DOCUMENT_POST for Posting Blog& Code example