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: 

Clearing Account Issue with BAPI_ACC_DOCUMENT_POST

Former Member
0 Kudos

Hi Forums!

I am processing a file over a 1000 records long into SAP, I have set my max records for a GL posting to 900, once that limit is reached I perform this code and post to using the above BAPI.

However, i am getting the error 'Balance in transaction currency'

Anyone else had this similar issue?


  DATA: lv_posnr TYPE posnr_acc.
  DATA: lv_hkont2 LIKE bseg-hkont.
  DATA: lv_totamt TYPE bapiwrbtr.

  CLEAR: gt_doc_item,
         gt_doc_values.

  lv_posnr = gv_cnt + 1.

  lv_hkont2 = p_clract.

  lv_totamt = gv_credits - gv_debits.

*  Fill Line of Document Item
  gt_gl_item-itemno_acc = lv_posnr.
  gt_gl_item-gl_account = lv_hkont2.
  gt_gl_item-costcenter = p_kostl.
  gt_gl_item-pstng_date = gv_posting_date.
  gt_gl_item-item_text = 'Clearing Account'.
  APPEND gt_gl_item.

**  Fill Line of Document Value
  gt_doc_values2-itemno_acc = lv_posnr.
  gt_doc_values2-currency_iso = gv_comp_curr. " posting companies currency.
  gt_doc_values2-currency     = gv_comp_curr. " posting companies currency..
  gt_doc_values2-amt_doccur = lv_totamt.
  APPEND gt_doc_values2.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

This is an age old problem with accounting documents. You cannot have more than certain number of items due to the technical limitation of the line item number field in the database. So when you try to split it into two or three different documents, you will think simply distribute the items in your internal table into those documents. Well that will break the functional rule that an accounting document needs to be balanced.

What you need to do is add up the amount of that 900 entries and post one line item to an offsetting account. In the next document, you will need to do the same thing.

5 REPLIES 5

Former Member
0 Kudos

This is an age old problem with accounting documents. You cannot have more than certain number of items due to the technical limitation of the line item number field in the database. So when you try to split it into two or three different documents, you will think simply distribute the items in your internal table into those documents. Well that will break the functional rule that an accounting document needs to be balanced.

What you need to do is add up the amount of that 900 entries and post one line item to an offsetting account. In the next document, you will need to do the same thing.

0 Kudos

Do a search in this forum for RFBIBL00 and you will probably find similar issue and a couple of solutions.

0 Kudos

Srinivas,

Thanks for your input, I believe to be posting everything correctly. I have added up my total debits and credits to the point of my file limit '900' which is the value I am putting into lv_totamt from the above source code.

So... it should be posting correct?

Former Member
0 Kudos

This problem occurs due to mismatch in debit and credit entries of amount. Please check if all debit and credit entries are correct. Change the sign of amount as per posting key if the sign is not given in input file. You can get the debit and credit posting keys from your FICO consultant. Finally see if the addition of amount comes zero at the end of document.

Thanks and regards,

Aparna Gaikwad

0 Kudos

Yes, it was the values in the clearing account.

What the issue was when it added the total value for the clearing account the BAPI was ADDING it to the rest of the totals I had accumulated thus far, therefore I need to make my clearing account total a negative and we had a zero balance.

thanks all for your help!