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: 

extension2 in bapi_acc_document_post

Former Member
0 Kudos

hi,

i am posting account documnet in using bapi_acc_document_post with custom feilds on BKPF.

so i already append custom structure as Z0CUST01 to BKPF table which contains ZA1, ZA2.

when i tried to post, i got no error , document successfully posted, but no customed filed saved in BKPF table.

what's wrong? please help me

DATA: ls_zzz TYPE Z0CUST01.

CLEAR it_ext2.

it_ext2-structure = 'Z0CUST01'.

ls_zzz-za1 = 'AAA'.

ls_zzz-za2 = 'BBB'.

MOVE ls_zzz TO it_ext2-valuepart1.

APPEND it_ext2.

call function 'BAPI_ACC_DOCUMENT_POST'

exporting

documentheader = gd_documentheader

customercpd = gd_customercpd

contractheader = gd_fica_hd

importing

obj_type = l_type

obj_key = l_key

obj_sys = l_sys

tables

accountgl = it_accountgl

accountreceivable = it_accountreceivable

accountpayable = it_accountpayable

accounttax = it_accounttax

currencyamount = it_currencyamount

  • criteria = it_criteria

  • valuefield = it_valuefield

  • extension1 = it_ext

return = it_return

  • paymentcard = it_paymentcard

  • contractitem = it_fica_it.

extension2 = it_ext2

  • realestate = it_re.

1 ACCEPTED SOLUTION

martin_voros
Active Contributor
0 Kudos

Hi,

have a look at [SAP documentation|http://help.sap.com/saphelp_nw04/helpdata/en/6b/3f6d2b6d0711d396a50004ac96334b/frameset.htm].

Cheers

2 REPLIES 2

nirajgadre
Active Contributor
0 Kudos

Hi,

the dictionary structure (content for EXTENSION2-STRUCTURE) must contain field POSNR, (TYPE POSNR_ACC) to indentify the correct line item of the internal table ACCIT.

try to pass the posnr field to the structure.

also check the CL_EXM_IM_ACC_DOCUMENT class for more details

martin_voros
Active Contributor
0 Kudos

Hi,

have a look at [SAP documentation|http://help.sap.com/saphelp_nw04/helpdata/en/6b/3f6d2b6d0711d396a50004ac96334b/frameset.htm].

Cheers