Skip to Content
avatar image
Former Member

How to populate ZZ field in BKPF using BAPI_ACC_DOCUMENT_POST

I have created a zz field in BKPF header. I need to populate this custom field through BAPI_ACC_DOCUMENT_POST. The value flows upto structure document_header but is not passed in GS_BAPI_ACCHD as we cannot append any field to structure ACCBAPIFD4. Is there any other method to populate ZZ field to BKPF using BAPI.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Dec 07, 2016 at 01:44 PM


    You can add the ZZ fields in the extension.

    The ZZ field should have been added under a structure in the table BKPF

    populate the name of the structure in the first field and the values of the fields in the second fields onwards.

    The fields are concatenated one after other with length as per field definition.

    Hope this helps you.


    Sachinkumar Mehta

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 07, 2016 at 01:58 PM

    Please also check these usefull resources : SAP Wiki / SAP Blog.

    You should be able to do this via the "EXTENSION"-Structures as mentioned before.

    Another option would be to use the BTE-functions for this (see the Blogpost) ...

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      Before the BTE is triggered the data is passed to structure GS_BAPI_ACCHD which is of the type ACCBAPIFD4 to which we cannot append the custom fields due to which the ZZ field value is not passed to structure T_BKPF which is used in the BTE.

  • Dec 08, 2016 at 06:35 AM

    What did you not understand in either

    • Parameter EXTENSION2 documentation or in sample implementing class CL_EXM_IM_ACC_DOCUMENT (BAdI ACC_DOCUMENT)?
    • Parameter EXTENSION1 documentation and sample FM SAMPLE_INTERFACE_RWBAPI01 (BTE process RWBAPI01) ?


    Add comment
    10|10000 characters needed characters exceeded

    • What is your version, what are the parameters of CHANGE method.

      Also, AFAIK, the BTE is executed just before the BAdI and then the TRWPR registered FM.

      As a last solution, have some BAdI/Exit export data to memory and some substitution rule will read them in some substitution exit.