Skip to Content

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

BAPI_ACC_DOCUMENT_CHECK tax item BKPF-XMWST

Hi gurus,

I have an issue.

I'm using BAPI_ACC_DOCUMENT_CHECK, to verify a document before posting. The document needs to have the BKPF-XMWST filled with the value "X".

I've created 2 enhancements for both ACC_DOCUMENT and I added the code:

METHOD if_ex_acc_document~change.

       LOOP AT c_accit INTO wa_accit WHERE mwskz IS NOT INITIAL.

         wa_accit-xmwst = 'X'.

         MODIFY c_accit FROM wa_accit INDEX sy-tabix TRANSPORTING xmwst.

       ENDLOOP.

 

ENDMETHOD.


but the resulting document doesn't have the 3rd line (the tax item) and I get no error message (the document is created).


Is there something I'm missing or did I do something wrong?


Thanks,

Marius



replied

Hi Max,

Found the problem.

The above code is still active.

Here is how my FI document should look like.

And the tables are like this:

2 line in  GL accounts 37102 and 37803

1 line in Account Tax 442802

3 lines in Currency amount

Here is the code to it:

ls_accountgl-itemno_acc   1.

ls_accountgl-gl_account   = '0037102000'.

ls_accountgl-de_cre_ind   = 'S'.

APPEND ls_accountgl TO lt_accountgl.

ls_accountgl-itemno_acc   2.

ls_accountgl-gl_account   = '0037803000'.

ls_accountgl-tax_code      = 'BA'.

ls_accountgl-de_cre_ind   = 'H'.

APPEND ls_accountgl TO lt_accountgl.

ls_accounttax-itemno_acc        = 3.

ls_accounttax-tax_code          = 'BA'.

ls_accounttax-gl_account       = '0044280200'.

ls_accounttax-acct_key          = 'MWS'.

ls_accounttax-cond_key          = 'MWAS'.

APPEND ls_accounttax TO lt_accounttax.


ls_currencyamount-itemno_acc    = 1.

ls_currencyamount-currency      = 'RON'.

ls_currencyamount-amt_doccur    = 1.24.

APPEND ls_currencyamount TO lt_currencyamount.

ls_currencyamount-itemno_acc    = 2.

ls_currencyamount-currency      = 'RON'.

ls_currencyamount-amt_doccur    = -1.

APPEND ls_currencyamount TO lt_currencyamount.

ls_currencyamount-itemno_acc    = 3.

ls_currencyamount-currency      = 'RON'.

ls_currencyamount-amt_doccur    = -0.24.

ls_currencyamount-amt_base      = -1.

APPEND ls_currencyamount TO lt_currencyamount.

Thanks,
Marius

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