Business Case

While working with various customers implementing S/4HANA Cloud, I have noticed that non-availability of tax details on Purchase Order output has always been a concern. Most of our customers are spread across various geographies have taxation rules which mandate an input tax to all purchase being made by the customers.

This means that any purchase order document generated from the S/4HANA Cloud should have the tax details added to them. While the taxation works perfectly fine when using the public cloud, the same tax details are not added to the purchase order output generated from the system. This means the Purchase order document sent across to the vendors does not have complete details and some vendors might challenge the applicable taxes at a later stage.

What is, currently, provided by S/4HANA Cloud

S/4HANA Cloud by default gives us an option to generate the purchase order output (either to send manually or electronically). By design, the Purchase Order output only gives the Net Prices for each item. Even the Purchase Order total price is a sum of all the Item Net prices put together which considers only the basic price set for the corresponding product.

However, the customers want the ability to send across the input tax along with the purchase order output. This is needed because they want to send the correct Purchase order gross amount to their vendors.

Solution

We implemented a small solution for one of our customers to address this situation using In-app Extensibility.

I can summarize the below steps by which you can produced the tax amount in the Purchase Order output.

Steps to generate the Tax Amount on the Purchase Order Output

Extend Purchase Order Item to include fields for Tax Amount & item gross amount.

We need to add two custom fields to calculate Item Tax Amount and Item gross amount.

To create custom field, use the app ‘Custom Fields and Logic’.

  • Business Context: Procurement: Purchasing Document Item

For a detailed understanding on how to create a custom field refer to the scope item In-App Extensibility (1N9).

Image 1.png

Enable the usage of these custom fields on the Form Template for Purchase Orders in the associated tab ‘Form Templates’. This is done to ensure that the custom fields are available in the Data Source for the Purchase Order Forms.

Extend Purchase Order header to include fields for Tax Amount & Gross Purchase Order Amount.

We need to add two custom fields to calculate Item Tax Amount and Item gross amount.

To create custom field, use the app ‘Custom Fields and Logic’.

  • Business Context: Procurement: Purchasing Document 

Image 2.png

Enable to usage of these custom fields on the Form Template for Purchase Orders in the associated tab ‘Form Templates’. This is done to ensure that the custom fields are available in the Data Source for the Purchase Order Forms.

Calculate the tax values at the purchase order item

To calculate the tax values, we need to implement a small custom logic in the related BADI. 

Open the add ‘Custom Field and logic’ and go the tab for Custom logic.

Create new implementation for the BADI to modify Purchase Order Items data.

  • Business Context: Procurement: Purchasing Document Item.
  • BADI Description: Modification of Purchase Order Items.

Image 3.png

Implement a piece of custom code based on below logic to calculate the tax amount to the custom fields created above.

The incoming parameter purchaseorderitem & purchaseorder will contain the custom fields created above.

Image 4.png

  • Pick up the tax code from the purchase order line item. This will be available in the field purchaseorderitem-taxcode.
  • With this tax code read the tax rate (maintained in the tax tables)
  • Do a calculation for item tax value with the tax rate and the item net value i.e. purchaseorderitem-netvalue.
  • Remember to move the values from purchasorderitem to purchaseorderitemchange. This is to ensure that the new calculated values are recorded in the the changed item details.
  • Calculate the tax values at the purchase order header

To calculate the tax values at header, we need to implement a small custom logic in the related BADI.

Open the app ‘Custom Field and logic’ and go the tab for Custom logic.

Create new implementation for the BADI to modify Purchase Order header data.

  • Business Context: Procurement: Purchasing Document.
  • BADI Description: Modification of Purchase Order Header.

Image 5.png

The incoming parameter purchaseorder contain the custom fields created on the Purchase order header initially. The parameter table purchaseorderitem_table will have the calculated values for tax amounts at item level from previous step.

  • Loop across the purchaseorderitem_table to read tax amount at individual line items.
  • Header total tax value will be an aggregate of the item tax values.
  • Header gross value will be an aggregate of the total header tax value and header net value i.e. purchaseorder-netvalue.

Modify standard Purchase order template to include tax values.

SAP provides a standard template for purchase orders which is used for generating output. The standard template built in the system is MM_PUR_PURCHASE_ORDER. We need to customize this template and build a custom form to add the tax values as per the business requirement. Follow the steps below the customize the template. You will need the software Adobe Livecycle designer to modify adobe forms. The software is available in the app ‘Install Additional Software'.

  • Open the app ‘Maintain form templates’ under the tile Output Management.
  •  Go to the tab ‘Predelivered Templates’.
  • Download the form template MM_PUR_PURCHASE_ORDER.

Image 6.png

      

  • Open the template in Adobe live cycle designer. You can begin by saving the template as a custom form starting YY1*.
  • The custom fields calculated above will be available in the Data source FDP_EF_PURCHASE_ORDER_SRV.
  • The Header level tax value & gross fields will be available on the node PurchaseOrderNode.
  • The item level tax value a& gross value will be available on the node PurchaseOrderNode->PurchaseOrderItems->PurchaseOrderItemNode.
  • You can choose to display these details on the form based on the business requirements.

Once the form is ready, upload the customized form back using the app ‘Manage Form Template’.

Do the necessary output parameter configuration to use the new custom form for output type (PURCHASE_ORDER).

Refer to the scope item Output Management (1LQ) which provides best practice information to implement an end-to-end scenario for output management in the SAP S/4HANA Cloud edition. Additionally, some very good blogs are already available which explain how to customize an adobe form using Adobe LiveCycle Designer.

Since all the necessary customization are now completed, verify the new purchase order output with the available apps. Below is a sample output of how the purchase order looks like based on our business requirements.

Image 7.png

Conclusion

Tax details can be added on Purchase Order output by using the In-App Extensibility capabilities of S/4HANA Cloud. The customization will need a minimum technical skill. By adopting this design, you can add the tax values on the purchase order output. This will ensure that the purchase order document sent across to the vendors have the correct Order amount.