12-23-2014 9:45 AM
Dear Experts,
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?
Thank you,
Suwandi C.
12-23-2014 9:49 AM
Hi,
Please use BTE - SAMPLE_INTERFACE_RWBAPI01 to fill the fields which are added in header or item table.
Regards,
Aashika
12-23-2014 9:49 AM
Hi,
Please use BTE - SAMPLE_INTERFACE_RWBAPI01 to fill the fields which are added in header or item table.
Regards,
Aashika
12-23-2014 10:06 AM
Hi Aashika,
Thank you for the reply.
I thought implementing the BTE RWBAPI01 (and filling the Extension1 structure), it will only transfer the fields to DOCUMENTHEADER (ACCHD). If that's right, in that case BTE RWBAPI01 and BAdI ACC_DOCUMENT both only fills to the ACCHD structure but not to the BKPF structure
CMIIW.
Thank you,
Suwandi C.
12-23-2014 11:26 AM
Hi,
In BTE you can also manipulate values from tables:
*" TABLES
*" IT_ACCIT STRUCTURE ACCIT
*" IT_ACCCR STRUCTURE ACCCR
*" RETURN STRUCTURE BAPIRET2
*" EXTENSION STRUCTURE BAPIACEXTC
*" IT_ACCWT STRUCTURE ACCIT_WT
*" CHANGING
*" VALUE(DOCUMENT_HEADER) LIKE ACCHD STRUCTURE ACCHD
In my one of the issue, I have passed the value to IT_ACCIT, and it successfully updated the same in BSEG.
Regards,
Aashika Agarwal
12-24-2014 2:39 AM
Hi Aashika,
Thank you for the reply.
In my case, fields from ACCHD does not automatically transferred to BKPF. I still have to run a report for the custom fields to be added to a structure in the standard program.
Thank you,
Suwandi C
12-24-2014 5:08 AM
Hi,
Have you created a Z program to modify BKPF table.
Regards,
Aashika
01-05-2015 1:49 PM
Hi,
Sorry for the late reply..
What kind of Z program that you mean?
Thank you,
Suwandi C.
08-28-2015 12:38 AM
Hi Suwandi,
What did you do to that will work? another extension, program, or something else? how do you fix this?
08-28-2015 5:22 AM
Hi,
I've done the steps in my first post and then the last step is to run the standard program RFPOSXEXTEND.
Hope this helps.
Thank you,
Suwandi C.
08-24-2022 8:40 AM
Hi Suwandi,
currently i tried to post zfield value into BAPI_ACC_DOCUMENT_POST, but after i implement BTE - SAMPLE_INTERFACE_RWBAPI01
it's not trigering my zfunction module. Please help. Thank you.
Denny Bayu