Skip to Content
avatar image
Former Member

extension2 in bapi_acc_document_post

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.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 14, 2010 at 09:25 PM
    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jan 14, 2010 at 01:03 PM

    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

    Add comment
    10|10000 characters needed characters exceeded