Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

BAPI_ACC_DOCUMENT_POST fill BKPF Custom Fields

suwandi_cahyadi
Contributor
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member

Hi,

Please use BTE - SAMPLE_INTERFACE_RWBAPI01 to fill the fields which are added in header or item table.

Regards,

Aashika

9 REPLIES 9

Former Member

Hi,

Please use BTE - SAMPLE_INTERFACE_RWBAPI01 to fill the fields which are added in header or item table.

Regards,

Aashika

0 Kudos

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.

0 Kudos

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

0 Kudos

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

0 Kudos

Hi,

Have you created a Z program to modify BKPF table.

Regards,

Aashika

0 Kudos

Hi,

Sorry for the late reply..

What kind of Z program that you mean?

Thank you,

Suwandi C.

0 Kudos

Hi Suwandi,

What did you do to that will work? another extension, program, or something else? how do you fix this?

0 Kudos

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.

0 Kudos

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