05-19-2011 1:46 PM
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
05-19-2011 2:26 PM
Set a breakpoint at the codepoint for the message - the CHECK_BALANCE subroutine. You can easily determine the issue at that point...
05-19-2011 2:35 PM
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
05-20-2011 3:18 PM
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.
05-19-2011 3:57 PM
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.
05-20-2011 12:39 PM
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