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: 

Posting Error is coming even though balance in currency table is correct.

Former Member
0 Kudos

Hi Gurus,

I searched a lot on SDN and did not found any relevent issue so i am posting it here.

I am trying to post FI document through one BAPI "BAPI_ACC_DOCUMENT_POST". we do have tax line items for posting. I am passing below parameters to BAPI.

call function 'BAPI_ACC_DOCUMENT_POST'

exporting

documentheader = im_documentheader

tables

accountgl = accountgl_itab

currencyamount = currencyamount_itab

accounttax = acc_tax_itab

criteria = criteria_itab

extension1 = extension1_itab

return = return_itab.

Here Problam is i am getting error RW 022 "Balance in transaction currency". Not i chekced that is there any balance differnece in table currencyamount_itab, but this has zero balance.

So i am not able to get why i am facing such error from BAPI. Here we are using same currency for posting.

Thanks in advance.

Regards,

Sourabh

5 REPLIES 5

brad_bohn
Active Contributor
0 Kudos

Set a breakpoint at the codepoint for the message - the CHECK_BALANCE subroutine. You can easily determine the issue at that point...

Former Member
0 Kudos

Hi Brad,

I put a breakpoint at CHECK_BALANCE sunroutine, but this has been called dynamically and program is not stopping at this point. So i couln't able to find the issue.

Regards,

Sourabh

brad_bohn
Active Contributor
0 Kudos

Use the debugger then. Set a watchpoint on the message number. The program will stop, even if there's another codepoint where the mesaage is issued dynamically.

former_member191735
Active Contributor
0 Kudos

Alright, basics first....

I believe you are not trying to post ZERO dollars/whatever currency..... if yes, check the following

You are passing at least 2 items which after the calculations becomes ZERO. I meant, first item with positive amount and the second item negative amount.

You are also passing currency type in field currency in both the items.

You are also passing the item numbers in each line.

If you are passing any other info, for now, just comment it and try to post first...

If no to any one of them then try that first.... If yes to all of them ....

You are filling table 'accountgl' with right GL account and other required info like profit center and all other.

Former Member
0 Kudos

Hi Saurabh,

The Problem Looks Like Currency Conversion Problem.

The Posting Always Take 2 degit Decimal Place Values.

IN Function module the Currencyamount Like Associate Type BAPIACCR09

DATA : currencyamount_itab LIKE TABLE OF bapiaccr09 WITH HEADER LINE.

U need to Declare one variable Like below.

DATA : v_amount LIKE bsik-dmbtr.

And Pass The Value V_amount Into currencyamount_itab-amt_doccur for the Items and Append currencyamount_itab .

Try with Above code it definitely resolve ur Problem.

Regards,

SD