BAPI_ACC_DOCUMENT_POST fill BKPF Custom Fields
How to fill BKPF custom fields through BAPI_ACC_DOCUMENT_POST?
I've done the following things:
- Append structure to BKPF table
- Append structure to ACCHD structure
- Fill Extension2 BAPIPAREX structure to fill the extension fields and pass to BAPI_ACC_DOCUMENT_POST
- create ACC_DOCUMENT BAdI implementation and implements the CHANGE method to get the Extension2 structure and pass the custom fields to C_ACCHD structure.
In debug, I've seen the custom fields has been passed to the C_ACCHD structure. But somehow, it is not transferred to the XBKPF structure.
In the program flow, I've found in program LFACIF4S subroutine fi_document_fill. That is when the XBPKF structure is filled from a structure named p_acc.
In program LFACIGEN is the definition of p_acc structure.
For now, I think I can:
- create an implicit enhancement in the end of subroutine fi_document_fill (program LFACIF4S) to transfer my custom fields from ACCHD to XBKPF
- Find out how to generate my custom fields in structure p_acc in LFACIGEN.
Is this the standard way to fill custom fields in BKPF through BAPI_ACC_DOCUMENT_POST?