Skip to Content

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

error message in BAPI_ACC_DOCUMENT_CHECK

HI everybody

im having an error while exceuting the BAPI BAPI_ACC_DOCUMENT_CHECK , 'FI/CO interface: Currency item entered several times'

see the code below

clear l_amount.

l_wrbtr = gw_accpostline-wrbtr.

gw_currency_amount-itemno_acc = l_itemno.

gw_currency_amount-currency = gw_accpost-waers.

IF gw_accpostline-newbs = '40' OR gw_accpostline-newbs = '21' OR gw_accpostline-newbs = '29'.

MOVE gw_accpostline-wrbtr TO l_amount.

CONCATENATE '-' l_amount INTO l_amount.

MOVE l_amount TO gw_currency_amount-amt_doccur.

ENDIF.

IF gw_accpostline-newbs = '31' OR gw_accpostline-newbs = '39' OR gw_accpostline-newbs = '50'.

*calculate the sum of the credit

gw_currency_amount-amt_doccur = gw_accpostline-wrbtr.

ENDIF.

APPEND gw_currency_amount TO gi_currency_amount.

IF gw_accpostline-dmbtr IS NOT INITIAL.

gw_currency_amount-itemno_acc = l_itemno.

gw_currency_amount-CURR_TYPE = '10'.

gw_currency_amount-currency = gw_accpost-waers.

IF gw_accpostline-newbs = '40' OR gw_accpostline-newbs = '21' OR gw_accpostline-newbs = '29'.

MOVE gw_accpostline-dmbtr TO l_amount.

CONCATENATE '-' l_amount INTO l_amount.

MOVE l_amount TO gw_currency_amount-amt_doccur.

ENDIF.

IF gw_accpostline-newbs = '31' OR gw_accpostline-newbs = '39' OR gw_accpostline-newbs = '50'.

gw_currency_amount-amt_doccur = gw_accpostline-dmbtr.

ENDIF.

APPEND gw_currency_amount TO gi_currency_amount.

Tags:
replied

Hi

U're transfering the amount in document currency twice, the currency type 10 means internal currency, so the currency of company code:

CLEAR l_amount.
l_wrbtr = gw_accpostline-wrbtr.

gw_currency_amount-CURR_TYPE  = '00'. "<----- Document currency
gw_currency_amount-itemno_acc = l_itemno.
gw_currency_amount-CURRENCY   = gw_accpost-waers.

MOVE gw_accpostline-wrbtr to gw_currency_amount-amt_doccur.

IF gw_accpostline-newbs = '40' OR gw_accpostline-newbs = '21' OR gw_accpostline-newbs = '29'.
  gw_currency_amount-amt_doccur = - gw_currency_amount-amt_doccur.
ENDIF.

APPEND gw_currency_amount TO gi_currency_amount.

IF not gw_accpostline-dmbtr IS INITIAL.
  gw_currency_amount-itemno_acc = l_itemno.
  gw_currency_amount-CURR_TYPE = '10'.
*  gw_currency_amount-CURRENCY = gw_accpost-waers. <----- Company currency
  gw_currency_amount-CURRENCY = t001-waers. "<----------- Company currency
  MOVE gw_accpostline-dmbtr TO gw_currency_amount-amt_doccur.

  IF gw_accpostline-newbs = '40' OR gw_accpostline-newbs = '21' OR gw_accpostline-newbs = '29'.
    gw_currency_amount-amt_doccur = - gw_currency_amount-amt_doccur.
  ENDIF.
  APPEND gw_currency_amount TO gi_currency_amount.
endif.

Max

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question