Application Development and Automation 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: 
Read only

Getting Error while posting through BAPI_ACC_DOCUMENT_POST

Former Member
0 Likes
486

Hi Folks,

I could not post an GL account using the BAPI function module BAPI_ACC_DOCUMENT_POST . The code was,

wa_docheader-bus_act = 'RFBU'.

wa_docheader-username = 'CHARAN'.

wa_docheader-comp_code = '0147'.

wa_docheader-doc_date = '20101006'.

wa_docheader-pstng_date = '20101006'.

wa_docheader-DOC_TYPE = 'SA'.

*wa_docheader-REF_DOC_NO = 'UNASSIGNED'.

wa_glaccnt-itemno_acc = '0010'.

wa_glaccnt-gl_account = '0000100632'.

wa_glaccnt-item_text = 'POSTING TO GL'.

APPEND wa_glaccnt TO i_glaccnt.

wa_glaccnt-itemno_acc = '0020'.

wa_glaccnt-gl_account = '0000100634'.

wa_glaccnt-item_text = 'POSTING TO GL'.

APPEND wa_glaccnt TO i_glaccnt.

*wa_pyaccnt-itemno_acc = '0000100634'.

*wa_pyaccnt-gl_account = '0001234567'.

*APPEND wa_pyaccnt TO i_pyaccnt.

wa_curamt-itemno_acc = '0010'.

wa_curamt-currency = 'USD'.

wa_curamt-curr_type = '00'.

wa_curamt-amt_doccur = 200 .

APPEND wa_curamt TO i_curamt.

wa_curamt-itemno_acc = '0020'.

wa_curamt-currency = 'USD'.

wa_curamt-curr_type = '00'.

wa_curamt-amt_doccur = 200.

APPEND wa_curamt TO i_curamt.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

documentheader = wa_docheader

  • CUSTOMERCPD =

  • CONTRACTHEADER =

  • IMPORTING

  • OBJ_TYPE =

  • OBJ_KEY =

  • OBJ_SYS =

TABLES

accountgl = i_glaccnt

  • ACCOUNTRECEIVABLE =

accountpayable = i_pyaccnt

  • ACCOUNTTAX =

currencyamount = i_curamt

  • CRITERIA =

  • VALUEFIELD =

  • EXTENSION1 =

return = i_ret

  • PAYMENTCARD =

  • CONTRACTITEM =

extension2 = i_ext2

  • REALESTATE =

  • ACCOUNTWT =

.

The Output error i'm getting is :

Error in document : BKPFF $ BH2CLNT200 400.00 USD

Balance in transaction currency.

Please help me in posting the Gl document successfully. Help will be rewarded.

Thanks in advance.

2 REPLIES 2
Read only

Former Member
0 Likes
433

Total amount of internal table I_CURAMT-AMT_DOCCURR should be zero (Credit & Debit).

Edit : See [Accounting Document Interface |http://wiki.sdn.sap.com/wiki/pages/viewpage.action?pageId=195726664] for reference.

Edited by: Vinod Kumar on Oct 8, 2010 1:04 PM

Read only

Former Member
0 Likes
433

Moderator message - Please search before asking and do not offer "rewards"- post locked Rob