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

Issue with 'BAPI_ACC_ACCOUNT_POST'

Former Member
0 Likes
1,102

Hi All,

I posted a document using 'BAPI_ACC_ACCOUNT_POST'.The document is parked successfully in ECC system.

All teh debit,credit and tax lines are successfully created.

When i clicked on debit and credit lines the data is displayed correctly.When i clicked on tax line item, the data is displayed but when i clicked on back button, it stuck on that screen and error message is dispalyed i.e.Account can only be posted internally in company code.

Please  help for this issue.

Do i need to set the XMWST field(Tax Automatically) for this?


Hi All,

I posted a document using 'BAPI_ACC_ACCOUNT_POST'.The document is parked successfully in ECC system.

All teh debit,credit and tax lines are successfully created.

When i clicked on debit and credit lines the data is displayed correctly.When i clicked on tax line item, the data is displayed but when i clicked on back button, it stuck on that screen and error message is dispalyed i.e.Account can only be posted internally in company code.

Please  help for this issue.

Do i need to set the XMWST field(Tax Automatically) for this?


6 REPLIES 6
Read only

Former Member
0 Likes
969

Hi,

If you pouplate,   accountwt-bas_amt_tc in BAPI_ACC_ACCOUNT_POST'

then tax will be calculated automatically.

Thanks

Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
969

Hi Sumit

What is message number and class..? Did you check with your functional about this issue..? It looks like we need to understand something functionally first

Nabheet

Read only

0 Likes
969

Hi Nabheet,

Message Class : F5

Message No : 562

I am getting this issue when i clicked on the tax line and when i discuss it with functional he said that either we need to create a diffrent account or second option is to check the 'Calculate tax' checkbox.

I Used the ACCOUNTTAX table to fill the tax details and 'CALCULATE_TAX_FROM_GROSSAMOUNT'

method to calculate the tax.and then use the bapi to post the accounting document.

Do i need to go for second approach(i.e. to set field XMWST) or is it possible to avoid this error message with the current approach ?

Read only

0 Likes
969

Hi,

In ACCOUNTTAX table below are mandatory..

itemno_acc

cond_key

tax_code

Check whether you are filling the above fields are not

Similarly for calculating tax automatically you need to pass base amount in the below field:

accountwt-bas_amt_tc

Also check: the same posting are you able to do from FB60 against the same GL account what you are passing..

The error some what related to Automatic posting, it occurs when there is some conflict  in between account type and automatic post indicator.

Regards,

Read only

0 Likes
969

Hi Sumit

Please check with calulcate tax automatically and see if you get same error. If you get the same ask your functional to post the document using same data via tcode

Nabheet

Read only

Former Member
0 Likes
969

Hi Sumit,

I think you need to pass the Field! If you look at the program it is checking the indicator and throwing the error message!

Include :   MF05AFB0_BSCHL_KONTO_BEARBEITU

if  bseg-koart  eq char_s
   and rf05a-stsim eq space
   and rf05a-staut eq space  (
Indicator: Automatic Posting ?)
   and t020-dyncl  ne char_s
   and t020-funcl  ne char_b
   and ctcod       ne 'FBB1'
   and skb1-xintb  eq char_x.
     message e562 with skb1-saknr skb1-bukrs.
   endif.