Application Development and Automation 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: 
Read only

currency value in BAPI_ACC_DOCUMENT_POST

Former Member
0 Likes
2,663

Hi All;

in order to post payments i use BAPI_ACC_DOCUMENT_POST. There are many payment lines (posting key 40) and one vendor line (posting key 31). i have filled in tables header, account_gl, accounts_payable and currency-amount accordingly. When i run the function it issues an error stating 'use another currency other than ..'. I have tried with different currencies but the error keeps coming. I pass the currency value in account payable and currency amount tables. how can i sole this problem, is it smt. with FI customising?

Thx

ali

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,896

there is some config problem in the system...It might that for 40 & 31 the proper currency value has not defined properly...The currency value should be same for both 40 & 31.

6 REPLIES 6
Read only

Former Member
0 Likes
1,897

there is some config problem in the system...It might that for 40 & 31 the proper currency value has not defined properly...The currency value should be same for both 40 & 31.

Read only

0 Likes
1,896

hi,

thx for the answer. but there is no customising for posting key to currency match.

Regards

Ali

Read only

0 Likes
1,896

U should past the code where you fill the data for the items.

Max

Read only

0 Likes
1,896

Hi do u have something like this :


* Currencyamount
  currencyamount-itemno_acc = p_compt.
  currencyamount-currency   = t_itab-currency.
  currencyamount-curr_type  = '00'.
  currencyamount-amt_doccur = p_amount.
  currencyamount-amt_base = p_amt_base.

Otherwise, post a sample code, plz.

Regards,

Erwan

Read only

0 Likes
1,896

Hi,

here is my code:

clear header.

header-comp_code = '1100'.

header-username = sy-uname.

header-bus_act = 'RFBU'.

header-pstng_date = budat."kyt_tarih.

header-doc_date = bldat."g_tarih.

header-doc_type = 'SA'.

append header.

clear vendor.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = lifnr

IMPORTING

output = lifnr.

vendor-vendor_no = lifnr.

vendor-comp_code = '1100'.

vendor-itemno_acc = sayac.

vendor-tax_code = mwskz.

vendor-pymt_amt = 0 - toplam.

vendor-pymt_cur = waers."'TRY'.

vendor-pymt_cur_iso = waers.

append vendor.

  • clear tax.

  • tax-itemno_acc = sayac.

    • tax-gl_account = zco_benzin_match-hkont.

  • tax-tax_code = mwskz.

  • append tax.

clear amount.

amount-itemno_acc = sayac.

amount-currency = waers. "'TRY'.

amount-currency_iso = waers.

amount-curr_type = '00'.

amount-amt_doccur = 0 - toplam.

amount-amt_base = 0 - toplam.

append amount.

loop at itab.

sayac = sy-tabix.

clear accountgl.

clear tax.

clear amount.

clear zco_benzin_match.

  • if itab-kostl co numbers.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = itab-kostl

IMPORTING

output = itab-kostl.

  • endif.

select single * from zco_benzin_match where kostl = itab-kostl.

accountgl-itemno_acc = sayac.

accountgl-comp_code = '1100'.

accountgl-pstng_date = budat."kyt_tarih.

accountgl-doc_type = 'SA'.

accountgl-gl_account = zco_benzin_match-hkont.

accountgl-vendor_no = lifnr.

accountgl-tax_code = mwskz.

accountgl-orderid = itab-plaka.

accountgl-item_text = itab-tip.

append accountgl.

  • tax-itemno_acc = sayac.

  • tax-gl_account = zco_benzin_match-hkont.

  • tax-tax_code = mwskz.

  • append tax.

    • it_accounttax-acct_key = 'VST'.

clear amount.

amount-itemno_acc = sayac.

amount-currency = waers. "'TRY'.

amount-currency_iso = waers.

amount-curr_type = '00'.

amount-amt_doccur = itab-wrbtr.

amount-amt_base = itab-wrbtr.

append amount.

  • if not zco_benzin_match-hkont is initial.

  • move itab-wrbtr to tutar.

  • translate tutar using '.,'.

  • endif.

endloop.

if not test is initial.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'

EXPORTING

DOCUMENTHEADER = header

  • CUSTOMERCPD =

  • CONTRACTHEADER =

TABLES

ACCOUNTGL = accountgl

  • ACCOUNTRECEIVABLE =

ACCOUNTPAYABLE = vendor

  • ACCOUNTTAX = tax

CURRENCYAMOUNT = amount

  • CRITERIA =

  • VALUEFIELD =

  • EXTENSION1 =

RETURN = messages

  • PAYMENTCARD =

  • CONTRACTITEM =

  • EXTENSION2 =

  • REALESTATE =

  • ACCOUNTWT =

.

else.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

DOCUMENTHEADER = header

  • CUSTOMERCPD =

  • CONTRACTHEADER =

TABLES

ACCOUNTGL = accountgl

  • ACCOUNTRECEIVABLE =

ACCOUNTPAYABLE = vendor

  • ACCOUNTTAX = tax

CURRENCYAMOUNT = amount

  • CRITERIA =

  • VALUEFIELD =

  • EXTENSION1 =

RETURN = messages

  • PAYMENTCARD =

  • CONTRACTITEM =

  • EXTENSION2 =

  • REALESTATE =

  • ACCOUNTWT =

.

.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

EXPORTING

wait = 'X'

IMPORTING

return = messages.

endif.

-


Thx .

Ali.

Read only

0 Likes
1,896

Hi Ali,

Try to remove the followings line :

vendor-pymt_amt = 0 - toplam.
vendor-pymt_cur = waers."'TRY'.
vendor-pymt_cur_iso = waers.

I don't use them.

They are redondant with table amountcurrency.