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

Tax Calculations using BAPI_ACC_DOCUMENT_POST

sravanibellana
Explorer
0 Likes
4,500

Hi Friends,

We have a requirement to post vendor invoices and credit memos using standard bapi BAPI_ACC_DOCUMENT_POST . I will be given tax code and jurisdiction for calculating taxes and ofcourse all the other details for posting a document. Can You Please help me out how can i make this BAPi to calculate taxes with the information provided and post the documents on its own.

Thanks in advance.

Sravani

1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,522

Did you look for OSS notes like Note 626235 - Tax postings with accounting BAPIs or previous threads. (also look for FM like RECP_FI_TAX_CALCULATE.)

Regards,

Raymond

10 REPLIES 10
Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,523

Did you look for OSS notes like Note 626235 - Tax postings with accounting BAPIs or previous threads. (also look for FM like RECP_FI_TAX_CALCULATE.)

Regards,

Raymond

Read only

0 Likes
3,522

Thanks for your reply raymond, according to the note 626235 we need to calculate taxes using some other function modules and have to pass them as seperate line items. will there be any way to make the standard bapi BAPI_ACC_DOCUMENT_POST itself to calculate the taxes on its own, by adjusting given iput line items.

Read only

0 Likes
3,522

AFAIK No, so use one of the FM mentionned in the answers of this discussion (as well as many FM  in many other threads too, use search tool )

Regards,

Raymond

Read only

0 Likes
3,522

Hi Raymond,

I cannot use those function modules since they will crete extra line items for tax. which is not acceptable for my requirememt. So thought of doing BDC, but got stuck in coding for processing multiple line items.

I just wonder will RFBIBL00 will do the tax calculations..any idea..could you please help me out.

Read only

0 Likes
3,522

BDC created by your code or RFBIBL00 will execute the transactions, so are able to calculate taxes, just set BKPF-XMWST.

Before BAPI I used to call FM POSTING_INTERFACE_START, POSTING_INTERFACE_DOCUMENT and POSTING_INTERFACE_END. The data required by those is very similar to BDCDATA but ypu have to manage dynpro sequence yourself and let the program do it.

Regards,

Raymond

Read only

0 Likes
3,522

Hi Friends, 

I have written a bdc program for FB01 using call transaction. it is working fine in developement , but in production i have got an issue.

i.e. no document has been posted and neither errors. but if i try to post them manually , can able to post.

I am getting some success messages in   tab_bdcmsgcoll , but document number related message is not present , i.e no document has been posted. neither no errors no warnings..

Kindly help me out to find the reason.

    CALL TRANSACTION FB01 USING t_bdc_data

                   MODE  'N'  -No screen

                   UPDATE A - asynchronus

                   MESSAGES INTO t_messtab.

do i need to add any commit work , or should i run them in synchronus update.

Thanks,

Sravani B

Read only

Former Member
0 Likes
3,522

Hello.

You can use some FM to calculate the taxes.

Check this code

  CALL FUNCTION 'CALCULATE_TAX_FROM_NET_AMOUNT'

    EXPORTING

      i_bukrs = '1000'

      i_mwskz = 'C6'   "Tax code

      i_waers = 'CLP'

      i_wrbtr = l_neto2

    TABLES

      t_mwdat = it_tax.

Regards

Miguel

Read only

sravanibellana
Explorer
0 Likes
3,522


Hi Friends,

I have written a bdc program for FB01 using call transaction. it is working fine in developement , but in production i have got an issue.

i.e. no document has been posted and neither errors. but if i try to post them manually , can able to post.

I am getting some success messages in   tab_bdcmsgcoll , but document number related message is not present , i.e no document has been posted. neither no errors no warnings..

Kindly help me out to find the reason.

    CALL TRANSACTION FB01 USING t_bdc_data

                   MODE  'N'  -No screen

                   UPDATE A - asynchronus

                   MESSAGES INTO t_messtab.

do i need to add any commit work , or should i run them in synchronus update.

Thanks,

Sravani B

Read only

0 Likes
3,522

Try to change the dispmode to 'A'. This would allow you to see screen by screen what is doing. It could be that you screen sequence stops in the middle.

Read only

0 Likes
3,522

Hi

Your t_bdc_data is wrong , for undestand execute in MODE A to see the error.

Regards.