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: 

error message in BAPI_ACC_DOCUMENT_CHECK

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

2 REPLIES 2

Former Member
0 Kudos

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 Kudos

thanks a lot, its working now