Enterprise Resource Planning Blogs by SAP
Get insights and updates about cloud ERP and RISE with SAP, SAP S/4HANA and SAP S/4HANA Cloud, and more enterprise management capabilities with SAP blog posts.
Showing results for 
Search instead for 
Did you mean: 

Note: This blog post, originally published in 2020, contains information related to an older version of this product. For information about the latest version, please see Integration with External Tax Calculation Engines – New Integration for SAP S/4HANA Cloud and SAP S/...


Note: Automatic Tax Code Selection, as described in this blog post, is not available for Brazilian scenarios.


Note: Automatic Tax Code Selection, as described in this blog post, is no longer supported for the Canadian scenarios, in spite of being used in the examples.

If I use integration with external tax calculation engines in SAP S/4HANA (cloud or on-premise)I can automatically determine the tax code in purchase orders. This is possible because the external tax calculation engine can automatically select the corresponding tax codes based on the information maintained in the purchase orderfor example, using the shipping locations.  

Assuming I want to use this feature in Canada. It works like this:  

  1. I create a purchase order using the Create Purchase Order - Advanced application (transaction ME21N in S/4HANA on-premise).

  2. I provide the technical tax code TS in the purchase order item in SAP S/4HANA. This indicates to the system that I want an automatic tax code selectionSee an example in the screenshot below: 

  1. The information about the purchase order item is sent to the external tax calculation engine, in a JSON payload called standard payload (contains logistics information). Check below an example of payload containing shipping information:

  2. The correct tax code and tax amounts are determined by the external tax calculation engine based on the payload information and returned to the SAP S/4HANA system.  

  3. The SAP S/4HANA system replaces the TS technical tax code in the purchase order item by the one tax code determined by the external tax calculation engine. This way save the purchase order with the correct tax code, not impacting further processes: 

I still have the option to inform a specific tax code in the purchase order item, as before this feature was available. In this case, the external tax calculation engine calculates taxes according to the tax code I have specified. In this scenariothe SAP S/4HANA system sends to the external tax calculation engine the information about the purchase order and the tax code that I have chosen. The system sends this information to the external tax calculation engine in a JSON payload called “direct payload” (this payload does not contain logistic informationinstead it contains the information about the tax code I have provided). 

Tax Code TS in SAP S/4HANA (On-premise) 

In case I want to check (or create) the tax code TS in the S/4HANA system, follow the steps below: 

  1. Login to the SAP GUI. 

  2. Access thFTXP transaction and choose the country.  

Example: for this scenario, I chose Canada.  

  1. In the Display Tax Code: Initial ScreenI enter TS as Tax Code. The integration with external tax calculation engines uses this specific code to identify that the user wants the external tax calculation engine to automatically determine the tax code in purchase orders.  

Note: since Canada uses Tax Jurisdiction, TS tax code has to be created for every tax jurisdiction. 

  1. In the Display Tax Code screen: Tax RatesI have to activate the tax conditionsI do this by providing any value as Tax Percent for each tax condition.  

Example: for Canada I choose to provide a tax percentage rate as follows. 

Tax Type  Acct Key  Tax Percent. Rate  Cond. Type 
A/P GST Recoverable  VST  0.000  JC1E 
A/P PST distributed  NVP  0.000  JC1I 
A/P QST  VSC  0.000  JC2S 
A/P HST  VSH  0.000  JC5S 

Note: the external tax calculation engine determines the correct tax rate, here I am just activating the tax conditions so that the SAP S/4HANA system can assign tax details like rate and amount to those tax conditions. 

  1. From the Display Tax Code screen: Tax RatesI choose Properties and provide the following: 

Tax CodeAutomatic Tax Code Selection 

Tax Type: V (Input Tax)

  1. I save information. 

Note: For Canada, TS tax code has been delivered in the standard content for S/4HANA Cloud. It is available for SAP S/4HANA as Best Practices content.  

More information about TS in Canada can be found in the SAP Help documentation. 

Tax Code TS in SAP S/4HANA Cloud 

The TS tax code is already available for Canada. Please check the scope item 43D for the updated list of supported countries.