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

Posting document with tax by BAPI_ACC_DOCUMENT_POST

Former Member
0 Likes
1,421

I am posting document by BAPI_ACC_DOCUMENT_POST.

The document are succesfully posted if i use the curr-type in CURRENCYAMOUNT = '10'

But if i am sending no curr-type it takes by default zero, hence gives error :

Foreign currency translation not supported for tax calculation

Please help urgently , how it neesds to be taken care of.

Regards,

Nuzhat

I am posting document by BAPI_ACC_DOCUMENT_POST.

The document are succesfully posted if i use the curr-type in CURRENCYAMOUNT = '10'

But if i am sending no curr-type it takes by default zero, hence gives error :

Foreign currency translation not supported for tax calculation

Please help urgently , how it neesds to be taken care of.

Regards,

Nuzhat

6 REPLIES 6
Read only

Former Member
0 Likes
1,046

Hi Nuzhat

Have a look at

[;

Pushpraj

Read only

Former Member
0 Likes
1,046

Hi

Probably u should transfer both tax values: in foreign and local currency.

Max

Read only

0 Likes
1,046

Hi Nuzhat

I've try to run this code in my system and it works:

TABLES BAPIACHE09.

DATA: T_CURR   TYPE TABLE OF BAPIACCR09 WITH HEADER LINE,
      T_RETURN TYPE TABLE OF BAPIRET2   WITH HEADER LINE,
      T_VENDOR TYPE TABLE OF BAPIACAP09 WITH HEADER LINE,
      T_GL     TYPE TABLE OF BAPIACGL09 WITH HEADER LINE,
      T_TAX    TYPE TABLE OF BAPIACTX09 WITH HEADER LINE.

DATA: T_MWDAT TYPE TABLE OF  RTAX1U15 WITH HEADER LINE.

DATA: AMOUNT  TYPE BSEG-WRBTR.

MOVE 1200 TO AMOUNT.

BAPIACHE09-COMP_CODE  = 'MAAB'.
BAPIACHE09-DOC_DATE   = SY-DATUM.
BAPIACHE09-PSTNG_DATE = SY-DATUM.
BAPIACHE09-REF_DOC_NO = 'BAPI 2'.
BAPIACHE09-USERNAME   = SY-UNAME.
BAPIACHE09-DOC_TYPE   = 'FD'.

T_VENDOR-ITEMNO_ACC   = '0000000001'.
T_VENDOR-VENDOR_NO    = '0009400602'.
T_VENDOR-BUS_AREA     = 'MA43'.
T_VENDOR-BLINE_DATE   = '20091130'.
APPEND T_VENDOR.

T_CURR-ITEMNO_ACC     = T_VENDOR-ITEMNO_ACC.
T_CURR-CURR_TYPE      = '00'.
T_CURR-CURRENCY       = 'USD'.
T_CURR-AMT_DOCCUR     = - AMOUNT.
APPEND T_CURR.

T_GL-ITEMNO_ACC   = '0000000002'.
T_GL-GL_ACCOUNT   = '0024700150'.
T_GL-BUS_AREA     = 'MA43'.
T_GL-TAX_CODE     = '1C'.
APPEND T_GL.

T_CURR-ITEMNO_ACC     = T_GL-ITEMNO_ACC.
T_CURR-CURR_TYPE      = '00'.
T_CURR-CURRENCY       = 'USD'.
T_CURR-AMT_DOCCUR     = 1000.
APPEND T_CURR.


CALL FUNCTION 'CALCULATE_TAX_FROM_GROSSAMOUNT'
  EXPORTING
    I_BUKRS = 'MAAB'
    I_MWSKZ = '1C'
    I_WAERS = 'USD'
    I_WRBTR = AMOUNT
  TABLES
    T_MWDAT = T_MWDAT.

READ TABLE T_MWDAT INDEX 1.

T_TAX-ITEMNO_ACC = '0000000003'.
T_TAX-GL_ACCOUNT = T_MWDAT-HKONT.
T_TAX-COND_KEY   = T_MWDAT-KSCHL.
T_TAX-ACCT_KEY   = T_MWDAT-KTOSL.
T_TAX-TAX_CODE   = '1C'.
T_TAX-TAX_RATE   = T_MWDAT-KBETR.
APPEND T_TAX.

T_CURR-ITEMNO_ACC     = T_TAX-ITEMNO_ACC.
T_CURR-CURR_TYPE      = '00'.
T_CURR-CURRENCY       = 'USD'.
T_CURR-AMT_DOCCUR     = T_MWDAT-WMWST.
T_CURR-AMT_BASE       = T_MWDAT-KAWRT.
APPEND T_CURR.



CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'
  EXPORTING
    DOCUMENTHEADER          = BAPIACHE09
  TABLES
    ACCOUNTGL               = T_GL
    ACCOUNTPAYABLE          = T_VENDOR
    ACCOUNTTAX              = T_TAX
    CURRENCYAMOUNT          = T_CURR
    RETURN                  = T_RETURN.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

As u can see, I've posted a document in US dollar, but the local currency for my company is euro: I've got any error

Max

Read only

0 Likes
1,046

Hi Max,

Thanks alot for your code.

I have tried to copy ur code to a program and modified it as per my business area and comapny code.

My code looks like something this:

DATA: w_header TYPE BAPIACHE09,

T_CURR TYPE TABLE OF BAPIACCR09 WITH HEADER LINE,

T_RETURN TYPE TABLE OF BAPIRET2 WITH HEADER LINE,

T_VENDOR TYPE TABLE OF BAPIACAP09 WITH HEADER LINE,

T_GL TYPE TABLE OF BAPIACGL09 WITH HEADER LINE,

T_TAX TYPE TABLE OF BAPIACTX09 WITH HEADER LINE.

DATA: T_MWDAT TYPE TABLE OF RTAX1U15 WITH HEADER LINE.

DATA: AMOUNT TYPE BSEG-WRBTR.

MOVE 100 TO AMOUNT.

w_header-COMP_CODE = '1001'.

w_header-DOC_DATE = SY-DATUM.

w_header-PSTNG_DATE = SY-DATUM.

*w_header-REF_DOC_NO = 'BAPI 2'.

w_header-USERNAME = SY-UNAME.

w_header-DOC_TYPE = 'FD'.

*T_VENDOR-ITEMNO_ACC = '0000000001'.

*T_VENDOR-VENDOR_NO = '0009400602'.

*T_VENDOR-BUS_AREA = '9001'.

*T_VENDOR-BLINE_DATE = '20091130'.

*APPEND T_VENDOR.

*

*T_CURR-ITEMNO_ACC = T_VENDOR-ITEMNO_ACC.

*T_CURR-CURR_TYPE = '00'.

*T_CURR-CURRENCY = 'USD'.

*T_CURR-AMT_DOCCUR = - AMOUNT.

*APPEND T_CURR.

T_GL-ITEMNO_ACC = '0000000001'.

T_GL-GL_ACCOUNT = '2510000030'.

T_GL-BUS_AREA = '9001'.

T_GL-TAX_CODE = 'S8'.

APPEND T_GL.

T_CURR-ITEMNO_ACC = T_GL-ITEMNO_ACC.

T_CURR-CURR_TYPE = '00'.

T_CURR-CURRENCY = 'SGD'.

T_CURR-AMT_DOCCUR = 107.

APPEND T_CURR.

T_GL-ITEMNO_ACC = '0000000002'.

T_GL-GL_ACCOUNT = '8450000000'.

T_GL-BUS_AREA = '9001'.

t_gl-WBS_ELEMENT = 'P760045200901E2'.

T_GL-TAX_CODE = 'S8'.

APPEND T_GL.

T_CURR-ITEMNO_ACC = T_GL-ITEMNO_ACC.

T_CURR-CURR_TYPE = '00'.

T_CURR-CURRENCY = 'SGD'.

T_CURR-AMT_DOCCUR = 100 * -1.

APPEND T_CURR.

CALL FUNCTION 'CALCULATE_TAX_FROM_GROSSAMOUNT'

EXPORTING

I_BUKRS = '1001'

I_MWSKZ = 'S8'

I_WAERS = 'SGD'

I_WRBTR = AMOUNT

TABLES

T_MWDAT = T_MWDAT.

READ TABLE T_MWDAT INDEX 1.

T_TAX-ITEMNO_ACC = '0000000003'.

T_TAX-GL_ACCOUNT = T_MWDAT-HKONT.

T_TAX-COND_KEY = T_MWDAT-KSCHL.

T_TAX-ACCT_KEY = T_MWDAT-KTOSL.

T_TAX-TAX_CODE = 'S8'.

T_TAX-TAX_RATE = T_MWDAT-KBETR.

APPEND T_TAX.

T_CURR-ITEMNO_ACC = T_TAX-ITEMNO_ACC.

T_CURR-CURR_TYPE = '00'.

T_CURR-CURRENCY = 'SGD'.

T_CURR-AMT_DOCCUR = T_MWDAT-WMWST * -1.

T_CURR-AMT_BASE = T_MWDAT-KAWRT * -1.

APPEND T_CURR.

CALL FUNCTION 'BAPI_ACC_DOCUMENT_POST'

EXPORTING

DOCUMENTHEADER = w_header

TABLES

ACCOUNTGL = T_GL

ACCOUNTPAYABLE = T_VENDOR

ACCOUNTTAX = T_TAX

CURRENCYAMOUNT = T_CURR

RETURN = T_RETURN.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

But still it is giving the same error.

Thanks and Regards,

Nuzhat

Read only

0 Likes
1,046

Hi,

Managed to do with the help of SAP.

The suggestion is to post the document with bothr curr-type '00' and '01'.

Thanks and Regards,

Nuzhat

Read only

0 Likes
1,046

Hi,

I am also getting the same error 'Foreign currency translation not supported for tax calculation' where I am using the BAPI BAPI_ACC_DOCUMENT_POST and the Company Code Currency is different than the document currency.

Can you please let me know what exactly was done.

Thanks for your help