Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Negative Posting on General Ledger in BAPI_ACC_DOCUMENT_POST

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

Tags:
Former Member
Former Member replied

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.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question