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: 

BAPI_ACC_DOCUMENT_POST : Error : Enter a payment currency different to INR

former_member873340
Active Participant
0 Kudos

Hi Friends,

I am trying to Post a document using the BAPI_ACC_DOCUMENT_POST. The document should credit the vendor and debit the customer.

When i am trying to run this bapi i am getting the following error.

T ID NUM MESSAGE

E F5 873 Enter a payment currency different to INR

I am passing INR to CURRENCY of CURRENCYAMOUNT table.

If i do no pass i am getting an error saying it is mandatory.

I also tried to pass USD(which is not the expected solution), the document was successfully created.

Please guide me to overcome this problem.

Regards,

Gowri

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

The bapi you are using will be used to post the

document through fb70 t-code wherein

the customer gets debitted and the Sales

i.e GL Accounts will get creditted.

For your requirement to credit the vendor and

debit the customer you can use t-code F-02.

For that you can use BAPI: BAPI_ACC_GL_POSTING_POST

Hope it helps

Regards

Mansi

Edited by: MANSI ASNANI on Apr 6, 2009 2:04 PM

14 REPLIES 14

SantoshKallem
Active Contributor
0 Kudos

Take the Help of Functional Consultant (FI).

0 Kudos

The functional is also stuck in this error. So in case you are aware of how to solve it will be very useful

Further more the error is occuring in the

FI_PAYMENT_CURRENCY_CHECK - Function Module

> IF I_PYCUR = SPACE

> OR I_PYCUR = I_WAERS.

> MESSAGE E873 WITH I_WAERS.

> ENDIF.

0 Kudos

Hi,

Check below, I taking assumption that u r the customer

1. Vendor currency in vendor master purchasing view & comapny code views.

2. PO currency.

3. PO priciing conditions in condition tab of PO. DO it is showing import conditions or so.

4. in MIRO try to put manually INR before give PO number.

Rgds

Santosh

0 Kudos

Any suggestions folks... I am not able to crack it

Former Member
0 Kudos

Hi,

Just pass 'INR' to CURRENCY_ISO, In addition to CURRENCY.

I hope this helps,

Regards

Raju Chitale

0 Kudos

No luck Raju.. Still the same error

0 Kudos

Hi,

Just have a look at the following code, in this case we are passing a JV debiting customer for Rs. 200/- automatically.

{REPORT ZRBC093.

  • how to post an entry in customer a/c

DATA: doc_header LIKE BAPIACHE09,

doc_item LIKE BAPIACGL09 OCCURS 0 WITH HEADER LINE,

doc_ar LIKE BAPIACAR09 OCCURS 0 WITH HEADER LINE,

doc_values LIKE BAPIACCR09 OCCURS 0 WITH HEADER LINE,

return LIKE bapiret2 OCCURS 0 WITH HEADER LINE,

extension1 like BAPIACEXTC occurs 0 with header line,

obj_type LIKE bapiache08-obj_type,

obj_key LIKE bapiache02-obj_key,

obj_sys LIKE bapiache02-obj_sys,

docnum LIKE bkpf-belnr.

*

  • Fill Document Header

doc_header-bus_act = 'RFBU'.

doc_header-username = sy-uname.

doc_header-header_txt = 'TEST BOC BAPI POSTING'.

doc_header-comp_code = 'IN01'.

doc_header-doc_date = '20060127'.

doc_header-pstng_date = sy-datlo.

doc_header-doc_type = 'SA'.

    • Fill Line 1 of Document Item

doc_item-itemno_acc = '1'.

doc_item-gl_account = '0000680106'.

doc_item-COSTCENTER = 'H909'.

doc_item-pstng_date = sy-datum.

doc_item-item_text = 'TEST POSTING DEBIT ITEM'.

APPEND doc_item.

CLEAR doc_item.

  • Fill Line 2 of Document Item

doc_ar-itemno_acc = '2'.

doc_ar-customer = '0000000001'.

doc_ar-item_text = 'TEST POSTING CREDIT ITEM'.

APPEND doc_ar.

CLEAR doc_ar.

  • Fill Line 1 of Document Value.

doc_values-itemno_acc = '1'.

doc_values-currency_iso = 'INR'.

doc_values-amt_doccur = '-200.00'.

doc_values-currency = 'INR'.

APPEND doc_values.

CLEAR doc_values.

  • Fill Line 2 of Document Value

doc_values-itemno_acc = '2'.

doc_values-currency_iso = 'INR'.

doc_values-amt_doccur = 200.

APPEND doc_values.

CLEAR doc_values.

  • All tables filled - now call BAPI.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_CHECK'

EXPORTING

documentheader = doc_header

IMPORTING

OBJ_TYPE = doc_header-obj_type

OBJ_KEY = doc_header-obj_key

OBJ_SYS = doc_header-obj_sys

TABLES

accountgl = doc_item

ACCOUNTRECEIVABLE = doc_ar

currencyamount = doc_values

return = return.

  • EXTENSION1 = EXTENSION1.

*

LOOP AT return WHERE type = 'E'.

EXIT.

ENDLOOP.

*

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

documentheader = doc_header

IMPORTING

OBJ_TYPE = doc_header-obj_type

OBJ_KEY = doc_header-obj_key

OBJ_SYS = doc_header-obj_sys

TABLES

accountgl = doc_item

ACCOUNTRECEIVABLE = doc_ar

currencyamount = doc_values

return = return.

LOOP AT return WHERE type = 'E'.

EXIT.

ENDLOOP.

IF sy-subrc EQ 0.

WRITE: / 'BAPI call failed - debug and fix!'.

ELSE.

CLEAR return.

REFRESH return.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'

  • EXPORTING

  • WAIT =

IMPORTING

return = return.

WRITE: / 'BAPI call worked!!'.

WRITE: / doc_header-obj_key, ' posted'.

ENDIF.

}

I have been able to post a JV using above code. Just compare with your code & see if it helps.

Regards

Raju Chitale

Edited by: Raju Chitale on Apr 6, 2009 1:49 PM

0 Kudos

Raju,

Thanks for your code but here the GL account itself is not passed itself.

Prabhu,

the KOSTL is also not passed to the report

0 Kudos

Hi.

Today i was dealing with this problem and i fixed it.

In structure BAPIACAR09 i didn't pass the currency on field PYMT_CUR and the document was generated, because i only pass the currency in structure BAPIACCR09.

I hope this was usefull to you.

Bye.

0 Kudos

This message was moderated.

Former Member
0 Kudos

Hi Shankar,

see the below example and correct where you are misatake....

please check you Kostl and Budat and wrbtr(currency )values before posting


*    Check the Kostl and Budat
      gt_accountgl-costcenter = gt_item-kostl.
      gt_accountgl-pstng_date = gt_header-budat.
      append gt_accountgl.
      clear gt_accountgl.

*     Check Curren and currecy value
      gt_currencyamount-itemno_acc = vcounter.
      gt_currencyamount-currency = 'INR'.
      gt_currencyamount-amt_doccur = gt_item-wrbtr.
      append gt_currencyamount.
      clear gt_currencyamount.

    call function 'BAPI_ACC_DOCUMENT_POST'
      exporting
        documentheader          = wa_documentheader
*       CUSTOMERCPD             = CUSTOMERCPD
*       CONTRACTHEADER          = CONTRACTHEADER
     importing
*       OBJ_TYPE                = OBJ_TYPE
       obj_key                 =  v_refkey
*       OBJ_SYS                 = OBJ_SYS
      tables
       accountgl               = gt_accountgl
*       ACCOUNTRECEIVABLE       = ACCOUNTRECEIVABLE
       accountpayable          = gt_accountpayable
*       ACCOUNTTAX              = ACCOUNTTAX
        currencyamount          = gt_currencyamount
*       CRITERIA                = CRITERIA
*       VALUEFIELD              = VALUEFIELD
*       EXTENSION1              = EXTENSION1
        return                  = gt_return
*       PAYMENTCARD             = PAYMENTCARD
*       CONTRACTITEM            = CONTRACTITEM
*       EXTENSION2              = EXTENSION2
*       REALESTATE              = REALESTATE
.

    if p_test is initial.
      call function 'BAPI_TRANSACTION_COMMIT'.
   endif.

Regards,

Prabhudas

Former Member
0 Kudos

Hi,

The bapi you are using will be used to post the

document through fb70 t-code wherein

the customer gets debitted and the Sales

i.e GL Accounts will get creditted.

For your requirement to credit the vendor and

debit the customer you can use t-code F-02.

For that you can use BAPI: BAPI_ACC_GL_POSTING_POST

Hope it helps

Regards

Mansi

Edited by: MANSI ASNANI on Apr 6, 2009 2:04 PM

0 Kudos

Thanks for all your replies.

Hi Mansi,

Good point you have noted.

But BAPI_ACC_GL_POSTING_POST is exclusively for GL postings only, it cannot be used for vendor and customer postings.

The documentation of the bapi states as follows

"This can be produce debit or credit entries to balances which are not managed in one of the subledgers relevant to the balance sheet. This is especially applicable if the balances cannot be represented as assets, customers/vendors, materials, loans, etc"

So i am afraid the bapi cannot solve our requirement.

Gowri

Former Member
0 Kudos

Hi Gowri,

Getting the same error in BAPI.

Were you able to solve this issue??

Please help.

Shruti.