Skip to Content
0

How to populate ZZ field in BKPF using BAPI_ACC_DOCUMENT_POST

Dec 07, 2016 at 01:21 PM

294

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Sachinkumar Mehta Dec 07, 2016 at 01:44 PM
0

Hi,

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.

Regards,

Sachinkumar Mehta


img1.jpg (20.0 kB)
img2.jpg (60.0 kB)
Share
10 |10000 characters needed characters left characters exceeded
Nic Teunckens Dec 07, 2016 at 01:58 PM
0

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) ...

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thank you Nic for the documents. But I am facing an issue in it. The zz field value is getting updated in BKPF using BTE if it is hardcoded but the same is not updated if passed through BAPI header values/extension2.

0

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.

0
Raymond Giuseppi
Dec 08, 2016 at 06:35 AM
0

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) ?

Regards,
Raymond

Show 8 Share
10 |10000 characters needed characters left characters exceeded

Hi ,

The zz field value is getting updated in BKPF using BTE if it is hardcoded but the same is not updated if passed through BAPI header values/extension2.

0

Did you note that the BTE use EXTENSION1 (structure BAPIACEXTC) whereas the BAdI use EXTENSION2 (structure BAPIPAREX). https://archive.sap.com/discussions/assets/images/emoticons/wink.png

I prefer the BAdI solution myself.

Regards,
Raymond

1

I used the BTE extension1 and values are flown from the BAPI to the BTE but still the values are not getting updated. The value for ZZ field gets initialized in document_create perform.

0

Did you identify the FM that erase your data (from TRWPR table returned by RWIN_CHECK_SUBSET)

1

Yes :( What needs to be done?

0

Analyze the FM, why data are remove: missing append, missing Customizing, etc.

0
Show more comments