Skip to Content
0
Jan 18, 2016 at 01:04 PM

ACCOUNTTAX structure in BAPI

120 Views

Hi Experts,

I am trying to write a mass upload program to park documents using BAPI_ACC_DOCUMENT_POST.

31 960000000(vendor) 1540.00-(ve)

40 406050(G/L) P1 1400.00+(ve)

40 29500(tax acc) P1 140 +(Ve)

From the above posting key 31 , end user will supply gross amount(1540) & tax amount(140)

posting key 40 (as per screen shot item 2 & 3 ) end user will supply net amount(1400) & tax code (p1) as single entry.

My question is when I am trying to post/park document with the below given structure it actually gives the success message but when see the parked document it looks as below screen shot . As in screen Debit- & Credit are not balanced instead I have no idea how it is getting 1680.00 as Debit?

I will be using FM to CALCULATE_TAX_FROM_NET_AMOUNT or CALCULATE_TAX_FROM_GROSS_AMOUNT with taxcode 'P1' as given with posting key 40 abecause for item '003' in screen user is not proving any details it could be worked out with to get GL etc from FM.

I have shared my current logic . Please correct my logic of where I am missing any essential field in BAPI structure.

lw_acc_vr-itemno_acc = '0000000001'.

lw_Acc_vr-vendor_no = '0096004547'.

lw_acc_vr-comp_code = '8720'.


lw_curr_amt-itemno_acc = '0000000001'.

lw_curr_amt-currency = 'AUD'.

lw_curr_amt-currency_iso = 'AUD'.

lw_curr_amt-amt_doccur = '-1540.00'.


****************************************************************

lw_acc_gl-itemno_acc = '0000000002'.

lw_acc_gl-gl_account = '0000406260'.

lw_acc_gl-item_text = 'tst_value_2'.

lw_acc_gl-doc_type = 'KR'.

lw_acc_gl-comp_code = '8720'.

lw_acc_gl-tax_code = 'P1'.

lw_acc_gl-orderid = '000008267848'.


lw_curr_amt-itemno_acc = '0000000002'.

lw_curr_amt-currency = 'AUD'.

lw_curr_amt-currency_iso = 'AUD'.

lw_curr_amt-amt_doccur = '1400.00'.

*****************************************************************

lw_acc_tax-itemno_acc = '0000000003'.

lw_acc_tax-gl_account = '0000249500'.

lw_acc_tax-tax_code = 'P1'.

lw_acc_tax-tax_rate = '10.000'.


lw_curr_amt-itemno_acc = '0000000003'.

lw_curr_amt-curr_type = '00'.

lw_curr_amt-currency = 'AUD'.

lw_curr_amt-currency_iso = 'AUD'.

lw_curr_amt-amt_doccur = '140.00'.

lw_curr_amt-amt_base = '1400.00'.

Attachments

Capture.PNG (17.3 kB)