segunda-feira, 30 de dezembro de 2019

Tax Service: Calculate Indirect Taxes in SAP S/4HANA Cloud and on-premise

If you’d prefer to read this blog in Portuguese, click here.
Se você gostaria de ler esse blog em português, clique aqui.

Are you an SAP S/4HANA user interested in easily determining and calculating indirect taxes in your business transactions (such as sales and purchase orders)?
Do you want to ensure compliance by delivering in-time tax updates?
If your answer is yes, then keep on reading!
In this blog post you will learn a bit more about the SAP Localization Hub, tax service and how the service can help you ensure you have correct and consistent calculation of tax in your SAP S/4HANA system.
SAP Localization Hub, tax service helps you to determine and calculate applicable country/region-specific indirect taxes and stay legally compliant. It is a cloud based (multi-tenant) API that gets relevant data from applications, performs the tax determination/calculations and then returns the correct tax amounts. You can use the service’s own calculation engine or integrate a partner solution to conduct your business operations.
If you’re working on SAP S/4HANA or SAP S/4HANA Cloud, you can integrate the tax service to easily calculate taxes in business transactions in your system.
This means that when you create or edit business transactions, SAP S/4HANA (cloud or on-premise) sends the data required to determine and calculate taxes to the tax service. The tax service uses its own calculation engine or the service of a partner to calculate these taxes according to local guidelines and sends the results back to SAP S/4HANA.
This ensures that you can increase efficiency and focus on your key tasks due by using a low maintenance tax calculation engine in a centralized service in the cloud!
Do you want to know more details about the tax service and supported countries and regions? Then have a look at the service’s documentation in the SAP Help Portal.

Tax Service – How to Use Custom Sales Pricing Procedure in SAP S/4HANA Cloud

In SAP S/4HANA Cloud you can create your own Sales Pricing Procedures. If you want to use the Tax Service as your tax calculation engine with this pricing procedure, have a look at the steps below.  
Note: You can use custom sales pricing procedures in SAP S/4HANA (on premise) by executing the steps described above. for that, access the SAP Customizing Implementation Guide > Integration with Other SAP Components > SAP Localization Hub, tax service: 
  • Map Tax Results to Condition Types (Sales Pricing Procedure) 
  • Map SAP S/4HANA Tax Codes to External Tax Codes 
  • Activate the Tax Service for Tax and Pricing Procedures 
note: Not available for Brazilian scenarios. 

Create your own Sales pricing procedure 

  1. Login to the Fiori Launchpad with the BPC_EXPERT role. 
  1. Access the Manage Your Solution tile and choose your country.  
Example: for this scenario, I chose Canada.  
  1. In the Configure Your Solution app, filter with the following information:
Application Area Sub Application Area 
Sales Price Management 
  1. Choose the Pricing configuration item. 
  1. Choose the Set Pricing Procedures configuration step. 
In this step, you can create a completely new sales pricing procedure or copy from an existing one. For this example, I chose to copy from Canada Sales pricing A29010. 
Position the condition type TXSC in the step that is above the condition types that represent taxes. In this example, TXSC is positioned right above condition types JRC1, JRC2, JRC3 and JRC4, which represents Canadian taxes GST, PST, QST, and HST respectively.  
Additionally, TXSC and all subsequent tax condition types must have the alternative calculation field with condition formula 279, like in the picture below: 

Map Tax Results to Condition Types  

After your own sales pricing procedure is created, you need to map the tax service results into the corresponding pricing condition types. See the steps below to execute this mapping. 
Prerequisite: 
In order to complete the configuration in this step correctly, it is important to understand how the tax service sends the tax results back to the SAP S/4HANA Cloud. The best way to do that is by using the Tax Service Simulator application. You can find details on how to use the application in this blog post Usage of Tax Service Simulator. 
  1. In the Configure Your Solution app, filter with the following information: 
Application Area Sub Application Area 
Finance Integration
  1. Choose the SAP Localization Hub, Tax Service configuration item. 
  1. Choose the Map Tax Results to Condition Types (Sales Pricing Procedure) configuration step. 
  1. Select the pricing procedure you created and choose Custom Mappings. 
  1. Map each tax condition type to the correct external tax code, tax type code and due category coming from Tax Service response payload. For more information on how to execute this mapping, see the configuration step documentation under Configuration Help. 

Example: I’m using the scenario of Canadian domestic sales of material from Alberta to Ontario, resulting in Regular HST Sales with HST 13% tax rate. Below you can see the response JSON payload from Tax Service Simulator for this scenario: 
Keep in mind that there are three pieces of information here that are important for the SAP SAP S/4HANA Cloud mapping:  
  • taxcode 511 representing the Regular HST Sales transaction; 
  • taxTypeCode 2 representing HST tax; 
  • dueCategory P representing a payable position. 

So, this is the entry I need to add to my new Sales pricing procedure; 
This entry means that whenever the tax service returns the Regular HST Sales scenario (represented by tax code 511), the base amount, rate and amount of HST tax (represented by taxTypeCode 2 on payable position) will be mapped to pricing condition type JRC4. 

Map SAP S/4HANA Cloud Tax Codes to External Tax Codes 

Next, you need to inform which SAP S/4HANA tax code will represent the tax service’s Regular HST Sales scenario, represented by external tax code 511.  
  1. In the Configure Your Solution app, filter with the following information: 
Application Area Sub Application Area 
Finance Integration
  1. Choose the SAP Localization Hub, Tax Service configuration item. 
  1. Choose the Map SAP S/4HANA Tax Codes to External Tax Codes configuration step. 
Now map the S/4 tax code to the external tax code. The external tax code comes from the tax service response payload. 
Example: tax codes are related to a country tax procedure, so I will select Canada tax procedure 0TXCAJ for my scenario. 
In this way, we are informing the SAP S/4HANA Cloud system that whenever the tax service responds to the scenario with the external tax code 511, SAP S/4HANA Cloud must use the SH tax code for accounting and later reporting. 

Activate the Tax Service for Tax and Pricing Procedures 

The last step is to activate the tax service so the sales pricing procedure you just created uses it.  
  1. In the Configure Your Solution app, filter with the following information: 
Application Sub Application 
Finance Integration
  1. Choose the SAP Localization Hub, Tax Service configuration item. 
  1. Choose the Activate the Tax Service for Tax and Pricing Procedures Map SAP configuration step. 
  1. Add the pricing procedure you created with the following information: 
    • Usage: A 
    • Application: V 
    • Activate flag: checked 
  1. Choose Save. 
Example: This is the entry I added for my Sales pricing Z29010. 
A means Pricing Usage Condition and V means Sales/Distribution application. 
Result: Now your new sales pricing procedure is ready to be used! You can either use it on a specific business partner or assign it to a sales organization.  

SAP S/4 HANA Changes related to SAP ABAP compared to ECC6.0

https://www.youtube.com/watch?v=bI7hjNcuA98&feature=youtu.be

Dynamic SAP Fiori Tiles using variants in SAP S/4HANA 1909

It’s been a while since I had the chance to write a blog post about something product related and semi-technical so it’s good to be able to squeeze this in before the end of the year and as an added bonus it’s my first blog post as an SAP Employee!
If you’ve used SAP S/4HANA you will probably already know about some of the neat features that allow users to personalize their experience. In case you haven’t or you need a reminder, I will start with a brief description of them so that we are all on the same page.
Creating views (a.k.a. variants, I use the two interchangeably in this post) for example for List Reports. This allows you as a user to save a set of filters for the list report so that you can quickly apply the same filter in the future. You can even share your views by making them public so that other people can use them too.
In addition you can also save the view as a tile and add it to your SAP Fiori Launchpad, this will create a tile for you in your Home group, with a counter showing you the number of results that match your filter criteria. When you click on this tile the List Report will open with the filter already applied.
These two neat features in effect let you set up smart shortcuts on your homepage that let you quickly see if something needs your attention and then drill down to do something about it. Good old “Insight to Action” in full effect 😉
Recently I was asked if it was possible as an administrator to do the same thing and add these tiles to catalogs and groups so that they could be pushed out to users via their roles? This is a good question… after a bit of pondering, digging around and hints from my colleague Jocelyn Dart I worked out how to do this and thought I’d share it with you in this post as I think it is something that will be useful during all SAP S/4HANA implementations*.
So to give this a bit more context and start with the end in mind I will explain the scenario in a bit more detail. Imagine for a moment that you are a Maintenance Planner and in your role you would like to be able to quickly see how many “High” and “Very High” priority maintenance notifications there currently are for you.
One way to do this is to launch the SAP Fiori Elements based List Report app Find Maintenance Notifications from your SAP Fiori Launchpad and create a couple of variants, one for Priority = 1 (Very High) and one for Priority = 2 (High), you can then save each of those as a tile that will display on your home page. Of course you realise that these tiles would also be really useful for your fellow planners, wouldn’t it be cool if they were just available to you and all your colleagues by default…
So now to the guts of this blog post, as an Administrator you can now make this a reality, thanks to a feature in SAPUI5 for Managing Variants. Here are the steps you need to do:

Step 1

Go into your own SAP Fiori Launchpad and start the application (you will need to make sure you are assigned the same app as will be used by the end users), in this case it is the Find Maintenance Notifications app. These same steps should work for any SAP Fiori Elements based List Report or Analytical List page.

Step 2

Create the variants/views you want by setting the filters (in this case I have set Priority = 1 (Very High) and then saving them.
Make sure you save them as “Public” and set them to “Apply Automatically”
To get the Variant IDs that you will need later on you can use the Developer Console in your browser, when you save the view/variant you will see a request to /sap/bc/lrep/variants and in the response body you will see the variant ID

Step 3

Next save your views as tiles by clicking on the Share icon and choosing “Save as Tile”.
When you navigate back to your SAP Fiori Launchpad home page you should two new tiles in your Home group.

Step 4

You will notice that these tiles have a count on them to show the count of maintenance notifications based on the priority filter. Again if you check the network trace in your browser developer tools you should be able to see the HTTP request that makes the call for that count. You can copy that for using later too.

Step 5

Ok, now so I hope you are still following along (well done if you are) we are nearly done. So armed with the Variant ID and the URL for the count you should go to the SAP Fiori Launchpad Designer, go to the catalog you want to assign the tile to and create a new Dynamic Tile (App Launcher Dynamic) you should make sure that the semantic navigation Object and Action parameters match the original tile for the launching the app – in my example below this is MaintenanceNotification-displayFactSheetDemo.
Then go ahead and insert the Variant ID and URL as shown below. The URL parameter used to pass the variant ID is sap-ui-fe-variant-id so it will look something like this sap-ui-fe-variant-id=<insert your variant ID>.
For the URL you can make it relative, something like this
/sap/opu/odata/sap/EAM_OBJPG_MAINTNOTIFICATION_SRV/C_ObjPgMaintNotification?sap-client=100&$filter=MaintPriority%20eq%20%272%27&$select=MaintenanceNotification&$inlinecount=allpages&sap-language=EN
That’s it, if you log on as a user who has the role with the new tiles you’ve just created they should be able to see the dynamic tiles showing the count and when you click them it should launch the Find Maintenance Notifications app and automatically apply the filter.
Here’s a little demo
I hope you find this useful, if you have any comments or feedback don’t hesitate to leave a comment below. In the meantime I will see if I can lobby for this to be streamlined and included as a feature request in the standard product (no promises)… if you think this is useful please let me know in the comments below as it will help my case 😉
Thanks
Simon
*Note: you can use this method as of SAP S/4HANA OP 1909 as the ability to pass a variant ID in the URL has been available since SAPUI5 version 1.65.0