Skip to Content

Changing product tax classifications may become a mass change topic if tax laws of a country change. For example forced the recent change of Indian tax laws (GST) many companies to adopt their product tax classifications.

Using SAP Business ByDesign you can easily run mass updates of product tax classifications using web service APIs. In the following I explain the same for materials, but the same works similarly for service products as well.

Change a tax exemption reason:

Step 1: Query/read product tax data using web service API “Query Materials

The following web service request reads the material with ID “KHM01” and requests to return tax data only:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global">
   <soapenv:Header/>
   <soapenv:Body>
      <glob:MaterialByElementsQuery_sync>
         <MaterialSelectionByElements>
            <SelectionByInternalID>
               <InclusionExclusionCode>I</InclusionExclusionCode>
               <IntervalBoundaryTypeCode>1</IntervalBoundaryTypeCode>
               <LowerBoundaryInternalID>KHM01</LowerBoundaryInternalID>
            </SelectionByInternalID>
         </MaterialSelectionByElements>
         <ProcessingConditions>
            <QueryHitsMaximumNumberValue>200</QueryHitsMaximumNumberValue>
            <QueryHitsUnlimitedIndicator>false</QueryHitsUnlimitedIndicator>
            <LastReturnedObjectID></LastReturnedObjectID>
         </ProcessingConditions>
         <RequestedElements materialTransmissionRequestCode="2">
            <Material deviantTaxClassificationTransmissionRequestCode="1" withholdingTaxClassificationTransmissionRequestCode="1"></Material>         
         </RequestedElements>
      </glob:MaterialByElementsQuery_sync>
   </soapenv:Body>
</soapenv:Envelope>

As result I get the product key information and tax data:

<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">
   <soap-env:Header/>
   <soap-env:Body>
      <n0:MaterialByElementsResponse_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global">
         <Material>
            <ChangeStateID>20171122142945.3455900</ChangeStateID>
            <InternalID>KHM01</InternalID>
            <UUID>00163e06-58b8-1ee7-b3f1-f2ea392b9bb0</UUID>
            <SystemAdministrativeData>
               <CreationDateTime>2017-11-22T14:19:01.749192Z</CreationDateTime>
               <CreationIdentityUUID>00300571-ce9b-1ded-8dc7-301872e1069a</CreationIdentityUUID>
               <LastChangeDateTime>2017-11-22T14:29:45.34559Z</LastChangeDateTime>
               <LastChangeIdentityUUID>00163e01-0774-02de-84bf-1b2093f5412a</LastChangeIdentityUUID>
            </SystemAdministrativeData>
            <ProductCategoryID>80</ProductCategoryID>
            <BaseMeasureUnitCode>EA</BaseMeasureUnitCode>
            <DeviantTaxClassification>
               <CountryCode>BE</CountryCode>
               <RegionCode listID="BE"/>
               <TaxTypeCode listID="BE">1</TaxTypeCode>
               <TaxRateTypeCode listID="BE1||2|1">2</TaxRateTypeCode>
               <TaxExemptionReasonCode listID="BE1||2|1">1</TaxExemptionReasonCode>
            </DeviantTaxClassification>
            <WithholdingTaxClassification>
               <CountryCode>BE</CountryCode>
               <TaxTypeCode listID="BE">2</TaxTypeCode>
               <WithholdingTaxIncomeTypeCode listID="BE2||2|1">4</WithholdingTaxIncomeTypeCode>
            </WithholdingTaxClassification>
         </Material>
         <ProcessingConditions>
            <ReturnedQueryHitsNumberValue>1</ReturnedQueryHitsNumberValue>
            <MoreHitsAvailableIndicator>false</MoreHitsAvailableIndicator>
            <LastReturnedObjectID>00163E0658B81EE7B3F1F2EA392B9BB0</LastReturnedObjectID>
         </ProcessingConditions>
      </n0:MaterialByElementsResponse_sync>
   </soap-env:Body>
</soap-env:Envelope>

 

Step 2: Update product tax exemption reason using web service API “Manage Materials

The following web service request changes the TaxExemptionReasonCode. Using action 06 (no action) on header level ensures, that no changes are done on header level. Action code 02 (update) on DeviantTaxClassification-level executes the update of the tax classification record.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global" xmlns:glob1="http://sap.com/xi/AP/Globalization">
   <soap:Header/>
   <soap:Body>
      <glob:MaterialBundleMaintainRequest_sync_V1>
         <BasicMessageHeader>
         </BasicMessageHeader>
         <Material actionCode="06" deviantTaxClassificationListCompleteTransmissionIndicator="false" withholdingTaxClassificationListCompleteTransmissionIndicator="false">
            <InternalID>KHM01</InternalID>
            <DeviantTaxClassification actionCode="02">
               <CountryCode>BE</CountryCode>
               <RegionCode listID="BE"></RegionCode>
               <TaxTypeCode listID="BE">1</TaxTypeCode>
               <TaxRateTypeCode listID="BE1||2|1">2</TaxRateTypeCode>
               <TaxExemptionReasonCode listID="BE1||2|1">2</TaxExemptionReasonCode>
            </DeviantTaxClassification>
         </Material>
      </glob:MaterialBundleMaintainRequest_sync_V1>
   </soap:Body>
</soap:Envelope>

 

Change a tax type and tax rate type:

Step 1: Query/read product tax data using web service API “Query Materials

Read the product tax data as described above.

Step 2:┬áReplace product tax classification using web service API “Manage Materials

The following web service request deletes the existing tax classification for a specific country and tax type (action code 03: delete), and creates a new tax classification for the same country and tax type (action code 01: create). The web service API ensures that deletion and creation are processed in the right sequence. The attribute deviantTaxClassificationListCompleteTransmissionIndicator=”false” ensures that the tax classification of other countries and tax types are not changed.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global" xmlns:glob1="http://sap.com/xi/AP/Globalization">
   <soap:Header/>
   <soap:Body>
      <glob:MaterialBundleMaintainRequest_sync_V1>
         <BasicMessageHeader>
         </BasicMessageHeader>
         <Material actionCode="06" deviantTaxClassificationListCompleteTransmissionIndicator="false" withholdingTaxClassificationListCompleteTransmissionIndicator="false">
            <InternalID>KHM01</InternalID>
            <DeviantTaxClassification actionCode="03">
               <CountryCode>BE</CountryCode>
               <RegionCode listID="BE"></RegionCode>
               <TaxTypeCode listID="BE">1</TaxTypeCode>
               <TaxRateTypeCode listID="BE1||2|1">3</TaxRateTypeCode>
               <TaxExemptionReasonCode listID="BE1||2|1">9</TaxExemptionReasonCode>
            </DeviantTaxClassification>
            <DeviantTaxClassification actionCode="01">
               <CountryCode>BE</CountryCode>
               <RegionCode listID="BE"></RegionCode>
               <TaxTypeCode listID="BE">1</TaxTypeCode>
               <TaxRateTypeCode listID="BE1||2|1">2</TaxRateTypeCode>
               <TaxExemptionReasonCode listID="BE1||2|1">1</TaxExemptionReasonCode>
            </DeviantTaxClassification>
         </Material>
      </glob:MaterialBundleMaintainRequest_sync_V1>
   </soap:Body>
</soap:Envelope>

 

 

 

 

 

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply