2015 Mar 18 6:43 PM
Hello,
I have a requirement to create a document with the amount paid by the customer on the cash register with the change using the bapi BAPI_ACC_DOCUMENT_POST, example:
customer: 12.90- "sales total
cash register (111120) 15.00 "12.90 + change
cash register (111120) 2.10- "change
I am creating the customer register as account receivable and the cash as general ledger, but when I create the line -2.10 I am getting the message F5 702: Balance in transaction currency (12.90-).
My IT are:
header
bus_act = 'RFBU'
comp_code = 'EM01'
doc_date = '20150318'
pstng_date = '20150318'
fisc_year = '2015'
fis_period = '03'
accountreceivable
itemno_acc = '0000000001'
customer = '0000029910'
comp_code = 'EM01'
accountgl
itemno_acc = '0000000002'
gl_account = '0000111120'
doc_type = 'DZ'
comp_code = 'EM01'
fis_period = '03'
fisc_year = '2015'
pstng_date = '20150318'
itemno_acc = '0000000003'
gl_account = '0000111120'
doc_type = 'DZ'
comp_code = 'EM01'
fis_period = '03'
fisc_year = '2015'
pstng_date = '20150318'
currencyamount
itemno_acc = '0000000001'
currency = 'BRL'
amt_doccur = 12.9000-
itemno_acc = '0000000002'
currency = 'BRL'
amt_doccur = 15.0000
itemno_acc = '0000000003'
currency = 'BRL'
amt_doccur = 2.1000-
The message occurs on program LFACIF3V form CHECK_BALANCE_CURTP00:
LOOP AT T_IBALTAB WHERE WRBTR NE 0
AND CURTP EQ 00.
WRITE T_IBALTAB-WRBTR TO STRINGC CURRENCY T_IBALTAB-WAERS.
MESSAGE E702 WITH T_IBALTAB-CURTP STRINGC T_IBALTAB-WAERS.
ENDLOOP.
And this is my T_IBALTAB:
Can someone help me with this, please?
Regards,
Tadeo
2015 Mar 19 1:06 PM
Problem Solved.
Debugging the error I discovered the form SUBST_BELNR on LFACIF02 and there is the following code:
LOOP AT ACCIT_FI.
IF SAVE-AWREF NE ACCIT_FI-AWREF
OR SAVE-BUKRS NE ACCIT_FI-BUKRS
OR SAVE-GJAHR NE ACCIT_FI-GJAHR
OR SAVE-MONAT NE ACCIT_FI-MONAT
OR SAVE-BUDAT NE ACCIT_FI-BUDAT
OR SAVE-BLDAT NE ACCIT_FI-BLDAT
OR SAVE-BLART NE ACCIT_FI-BLART
OR SAVE-XBLNR NE ACCIT_FI-XBLNR
OR SAVE-WAERS NE ACCIT_FI-WAERS
OR SAVE-AWREF_REV NE ACCIT_FI-AWREF_REV
OR SAVE-AWORG_REV NE ACCIT_FI-AWORG_REV.
MOVE-CORRESPONDING ACCIT_FI TO SAVE.
*Belegköpfe immer mitzählen
X_BELNR = X_BELNR + 1.
ENDIF.
IF ACCIT_FI-BELNR EQ SPACE.
ACCIT_FI-BELNR = X_BELNR.
ACCIT_FI-BELNR(1) = '$'.
MODIFY ACCIT_FI.
ENDIF.
CLEAR LOGDN. "Note445916
MOVE-CORRESPONDING ACCIT_FI TO LOGDN. "Note445916
COLLECT LOGDN INTO LOGDN. "Note445916
ENDLOOP.
If one of the vars in SAVE structure is different from the current line, this form put a new BELNR number into the line of ACCIT_FI and then when calculating the balance it get wrong.
Hope that helps someone too, and thanks for all the answers.
Have you try to transport the posting key(BSCHL)?
2015 Mar 18 7:48 PM
hi,
replace this
itemno_acc = '0000000001'
currency = 'BRL'
amt_doccur = 12.9000-
itemno_acc = '0000000002'
currency = 'BRL'
amt_doccur = 15.0000
itemno_acc = '0000000003'
currency = 'BRL'
amt_doccur = 2.1000-
with
itemno_acc = '0000000001'
currency = 'BRL'
amt_doccur = 15.0000-
itemno_acc = '0000000002'
currency = 'BRL'
amt_doccur = 12.9000
itemno_acc = '0000000003'
currency = 'BRL'
amt_doccur = 2.1000
and try please
2015 Mar 18 7:58 PM
Hi, thanks for answering, but I already have 12.90+ in the customer created by the billing document, I have to create another document with 12.90- to compensate it and add to the cash register account. In your example the customer accounting wouldn't be wrong?
2015 Mar 19 6:49 AM
2015 Mar 19 11:48 AM
2015 Mar 18 8:55 PM
I think the amount for item 1 should be positive rather than negative.
Rob
2015 Mar 18 9:08 PM
No, thanks but it didn't work. I also tried to reverse the values and didn't work too. If I use the 12.90 without the change (deleting line 3 and setting the value of the 2 to 12.9), the BAPI works and creates the document, it doesn't work only with the change line.
2015 Mar 19 7:44 AM
2015 Mar 19 11:50 AM
2015 Mar 19 1:06 PM
Problem Solved.
Debugging the error I discovered the form SUBST_BELNR on LFACIF02 and there is the following code:
LOOP AT ACCIT_FI.
IF SAVE-AWREF NE ACCIT_FI-AWREF
OR SAVE-BUKRS NE ACCIT_FI-BUKRS
OR SAVE-GJAHR NE ACCIT_FI-GJAHR
OR SAVE-MONAT NE ACCIT_FI-MONAT
OR SAVE-BUDAT NE ACCIT_FI-BUDAT
OR SAVE-BLDAT NE ACCIT_FI-BLDAT
OR SAVE-BLART NE ACCIT_FI-BLART
OR SAVE-XBLNR NE ACCIT_FI-XBLNR
OR SAVE-WAERS NE ACCIT_FI-WAERS
OR SAVE-AWREF_REV NE ACCIT_FI-AWREF_REV
OR SAVE-AWORG_REV NE ACCIT_FI-AWORG_REV.
MOVE-CORRESPONDING ACCIT_FI TO SAVE.
*Belegköpfe immer mitzählen
X_BELNR = X_BELNR + 1.
ENDIF.
IF ACCIT_FI-BELNR EQ SPACE.
ACCIT_FI-BELNR = X_BELNR.
ACCIT_FI-BELNR(1) = '$'.
MODIFY ACCIT_FI.
ENDIF.
CLEAR LOGDN. "Note445916
MOVE-CORRESPONDING ACCIT_FI TO LOGDN. "Note445916
COLLECT LOGDN INTO LOGDN. "Note445916
ENDLOOP.
If one of the vars in SAVE structure is different from the current line, this form put a new BELNR number into the line of ACCIT_FI and then when calculating the balance it get wrong.
Hope that helps someone too, and thanks for all the answers.
2016 Apr 19 12:32 PM
Dear Lucas,
Very helpful answer, Thanks you.
Thanks & Regards,
John
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |