Skip to Content
Product Information
Author's profile photo Daiana Feiten

How to change the tax classification for professional service orders using BAdI “Sales Item Tax Fields Modification”.

How to change the tax classification for professional service orders using BAdI “Sales Item Tax Fields Modification”

This is part of a new feature “Alternative tax classification for professional services” released for SAP S/4HANA Cloud 2002.

Let’s say customer creates a project which has a sales order (SO01) and they need to manage an alternative tax classification on professional service order.

Let’s follow steps below to achieve this request:

1. Open the Custom Fields and Logic app.

2. Introduce a new custom field. Choose the + icon to start creating a new custom field:

Note: Use Type Code List.

Choose Create and Edit.

3. For UIs and Reports, scroll down to locate Plan Customer Projects and choose the Enable Usage button to enable the new field to be used on this UI.

Choose Save, and then choose Publish.

4. It may take a few minutes for the field to be published. The status will display as “Published” once this is complete.

5. Introduce a new Custom Logic. Choose the + icon to start creating a new custom logic:

6. Select the correct business context under which the logic needs to be created and the correct BAdI to be implemented.

Choose Create.

7. Now you can implement your custom logic. For this demo, we want to add the code below:

salesdocumentitem_tax_out = salesdocumentitem_tax_in.

If salesdocument-salesdocumenttype = ‘DMR1’.

if processingstep = ‘INITIAL’.

data: refdocitem type i_salesdocumentitem.

if salesdocumentitem-referencesddocument is not initial and salesdocumentitem-referencesddocumentitem is not initial.

select single * from i_salesdocumentitem into @refdocitem where salesdocument = @salesdocumentitem-referencesddocument and salesdocumentitem = @salesdocumentitem-referencesddocumentitem.

if refdocitem-yy1_tax_classification_sdi is not initial.

salesdocumentitem_tax_out-producttaxclassification1 = refdocitem-yy1_tax_classification_sdi.


salesdocumentitem_tax_out-producttaxclassification1 = refdocitem-producttaxclassification1.





8. As soon as you have entered your own code, you can choose Save Draft:

And Publish:

9. It may take a few minutes for the custom logic to be published. The status will display as “Published” once this is complete.

10. Now the newly custom field needs to be added on the relevant UI application screen.

Go to the Plan Customer Projects app and locate the related project.

Go to the Billing tab and choose Edit.

11. Select the Settings option. Select the custom fields to be added and then choose Ok:

12. For this demo, we want to change tax classification to 1:

Billing Due Dates:

13. Now go to the Release Billing Proposals – Due Today app to create a Debit Memo Request (DMR) based on customer projects.

Note: This is the step where you can manipulate the tax classification by using the BAdI implementation.

Choose Edit:

14. Choose Release:

15. When a debit memo request is created, a message will appear:

16. Now you can check if the expected tax classification is applied.

Go to the Manage Debit Memo Requests app.

Search for the DMR already created. For this demo, we want to check document 70001704:

17. Double click the item row under Material.

18. Go to the Billing Document tab, and you can see Tax classific. is filled out with 1.


In the professional service use case, you must change the tax classification in the DMR (not in the preceding sales order of type SO01) by using a custom field in the Plan Customer Projects app and a BAdI implementation.

In the BAdI implementation you need to do the following:

1. Read custom field from preceding document via I_SalesDocumentItem.

2. Fill tax classification field with that value of the custom field.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Gerard Magorrian
      Gerard Magorrian

      Great first blog Daiana - very detailed with easy to follow steps 🙂

      Author's profile photo Sai Giridhar Kasturi
      Sai Giridhar Kasturi

      well explained, thanks for sharing.

      Author's profile photo Vijayendra Tiwari
      Vijayendra Tiwari

      Thanks for sharing Daiana!!

      Author's profile photo Priyank Kumar Jain
      Priyank Kumar Jain

      Thanks for sharing. It may also be noted that your logic in the BadI implementation can be tested from within the custom logic app itself. It allows you to test the code without actually going to the real business app, so you can perform some initial sanity checks.

      Author's profile photo Katalin Csengodi
      Katalin Csengodi

      Very nice blog Daiana, thank you for sharing the info with great detail.

      Author's profile photo Nancy Guo
      Nancy Guo

      Thank you for sharing! Very easy to understand and follow.