SAP Knowledge Base Article - Public

3667365 - When creating an Invoice Request via the web service ManageCustomerInvoiceRequestIn Following Error Occurs "Error while copying price components and tax details"

Symptom

When creating an External Customer Invoice Request via the web service ManageCustomerInvoiceRequestIn the following error occurs: "Error while copying price components and tax details"

Environment

SAP Business ByDesign

Reproducing the Issue

You are passing the following SOAP Request payload via SOAP UI (please note that the Internal ID's passed in this payload are test data): 

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:glob="http://sap.com/xi/SAPGlobal20/Global" xmlns:a00="http://sap.com/xi/AP/CustomerExtension/BYD/A0014" xmlns:glob1="http://sap.com/xi/AP/Globalization">
   <soap:Header/>
   <soap:Body>
      <glob:CustomerInvoiceRequestBundleMaintainRequest_sync>
         <BusinessDocumentBasicMessageHeader/>
         <CustomerInvoiceRequest actionCode="04">
            <ProposedInvoiceDate>2025-10-13</ProposedInvoiceDate>
            <BaseBusinessTransactionDocumentID>EXT_2025_00</BaseBusinessTransactionDocumentID>
            <BuyerParty>
               <InternalID>10000253</InternalID>
            </BuyerParty>
            <SalesUnitParty>
               <InternalID>P1110</InternalID>
            </SalesUnitParty>
            <SalesAndServiceBusinessArea>
               <DistributionChannelCode>01</DistributionChannelCode>
            </SalesAndServiceBusinessArea>
            <PricingTerms>
               <PricingProcedureCode>PPSTD1</PricingProcedureCode>
               <CurrencyCode>EUR</CurrencyCode>
            </PricingTerms>
            <Item>
               <BaseBusinessTransactionDocumentItemID>10</BaseBusinessTransactionDocumentItemID>
               <ReceivablesPropertyMovementDirectionCode>1</ReceivablesPropertyMovementDirectionCode>
               <Product>
                  <InternalID>123456</InternalID>
                  <TypeCode>1</TypeCode>
               </Product>
               <Quantity unitCode="EA">1</Quantity>
               <QuantityTypeCode>EA</QuantityTypeCode>
               <PriceAndTax>
                  <PriceComponent>
                     <TypeCode>7PR1</TypeCode>
                     <Rate>
                        <DecimalValue>13</DecimalValue>
                        <CurrencyCode>EUR</CurrencyCode>
                        <BaseDecimalValue>1.0</BaseDecimalValue>
                        <BaseMeasureUnitCode>EA</BaseMeasureUnitCode>
                     </Rate>
                  </PriceComponent>
                  <PriceComponent>
                     <TypeCode>7PRB</TypeCode>
                     <Rate>
                        <DecimalValue>5</DecimalValue>
                     </Rate>
                  </PriceComponent>
               </PriceAndTax>
            </Item>
         </CustomerInvoiceRequest>
      </glob:CustomerInvoiceRequestBundleMaintainRequest_sync>
   </soap:Body>
</soap:Envelope>

You are receiving the following SOAP Response payload: 

<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope">
   <env:Header/>
   <env:Body>
      <n0:CustomerInvoiceRequestBundleMaintainConfirmation_sync xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:prx="urn:sap.com:proxy:XXX:/1SAI/TAE97B4B03BFBA11CE28D92:804">
         <Log>
            <MaximumLogItemSeverityCode>3</MaximumLogItemSeverityCode>
            <Item>
               <TypeID>604(/APCI_CUST_INV_BAS/)</TypeID>
               <CategoryCode>INC.BOI</CategoryCode>
               <SeverityCode>3</SeverityCode>
               <Note>Error while copying price components and tax details</Note>
            </Item>
         </Log>
      </n0:CustomerInvoiceRequestBundleMaintainConfirmation_sync>
   </env:Body>
</env:Envelope>

Cause

You are passing the PriceComponent with the TypeCode 7PRB on Item Level.  

The Price Component Type Code 7PRB is not a Discount even though it has a negative value like a Discount. 

The TypeCode 7PRB is the Price Component Restocking Fee which is a Header Level price component and cannot be added on Item Level. 

Since it is passed in the Items tag of the payload the error occurs.  

 

The TypeCode for Product Discount (%) is 7PR6 which can be passed with a percentage based value on Item Level. 

If you require a Discount as an amount you pass the price component Quality Loss Fee with the TypeCode 7PRA on Item Level.  

The update of Header Level Discounts or Restocking Fee Price Components is not possible via webservice in customer invoice request currently.

Hence, you can only pass the product discount /restocking fee on Item Level.

 

See also more details in the documentation for the web service ManageCustomerInvoiceRequestIn which you can find as follows:

Go to the Application and User Management work center.

Select the Service Explorer view.

Search for ManageCustomerInvoiceRequestIn

Select Maintain customer invoice requests

In the Details section click on the Link for Documentation

 

Under section Price and Tax Data on Item Level you can see that the Code Value for the Product Discount (%) is 7PR6

However, the value passed for the Product Discount is a percentage and not an amount.

Resolution

This is the expected system behaviour. 

Here a Sample Payload using the standard web service with Product Discount (%) -> 7PR6:

 <soap:Envelope xmlns:soap=http://www.w3.org/2003/05/soap-envelope xmlns:glob=http://sap.com/xi/SAPGlobal20/Global xmlns:a00=http://sap.com/xi/AP/CustomerExtension/BYD/A0014 xmlns:glob1=http://sap.com/xi/AP/Globalization>

   <soap:Header/>

   <soap:Body>

      <glob:CustomerInvoiceRequestBundleMaintainRequest_sync>

         <BusinessDocumentBasicMessageHeader/>

         <CustomerInvoiceRequest actionCode="04">

            <ProposedInvoiceDate>2025-10-13</ProposedInvoiceDate>

            <BaseBusinessTransactionDocumentID>EXT_2025_10</BaseBusinessTransactionDocumentID>

            <BuyerParty>

               <InternalID>10000253</InternalID>

            </BuyerParty>

            <SalesUnitParty>

               <InternalID>P1110</InternalID>

            </SalesUnitParty>

            <SalesAndServiceBusinessArea>

               <DistributionChannelCode>01</DistributionChannelCode>

            </SalesAndServiceBusinessArea>

            <PricingTerms>

               <PricingProcedureCode>PPSTD1</PricingProcedureCode>

               <CurrencyCode>EUR</CurrencyCode>

            </PricingTerms>

            <Item>

               <BaseBusinessTransactionDocumentItemID>10</BaseBusinessTransactionDocumentItemID>

               <ReceivablesPropertyMovementDirectionCode>1</ReceivablesPropertyMovementDirectionCode>

               <Product>

                  <InternalID>123456</InternalID>

                  <TypeCode>1</TypeCode>

               </Product>

               <Quantity unitCode="EA">1</Quantity>

               <QuantityTypeCode>EA</QuantityTypeCode>

               <PriceAndTax>

                  <PriceComponent>

                     <TypeCode>7PR1</TypeCode>

                     <Rate>

                        <DecimalValue>13</DecimalValue>

                        <CurrencyCode>EUR</CurrencyCode>

                        <BaseDecimalValue>1.0</BaseDecimalValue>

                        <BaseMeasureUnitCode>EA</BaseMeasureUnitCode>

                     </Rate>

                  </PriceComponent>

                  <PriceComponent>

                     <TypeCode>7PR6</TypeCode>

                     <Rate>

                        <DecimalValue>5</DecimalValue>

                     </Rate>

                  </PriceComponent>

               </PriceAndTax>

            </Item>

         </CustomerInvoiceRequest>

      </glob:CustomerInvoiceRequestBundleMaintainRequest_sync>

   </soap:Body>

</soap:Envelope>

In the System the External Invoice Request will have the following Price Components: 

Example 7PR6

The Quality Loss Fee is also a negative amount and is an amount and not a percentate. So you can use this as a type of discount. However, the decimal value should not be passed with a negative sign.

 

Sample payload using our standard web service with Quality Loss Fee ->  7PRA:  

<soap:Envelope xmlns:soap=http://www.w3.org/2003/05/soap-envelope xmlns:glob=http://sap.com/xi/SAPGlobal20/Global xmlns:a00=http://sap.com/xi/AP/CustomerExtension/BYD/A0014 xmlns:glob1=http://sap.com/xi/AP/Globalization>

   <soap:Header/>

   <soap:Body>

      <glob:CustomerInvoiceRequestBundleMaintainRequest_sync>

         <BusinessDocumentBasicMessageHeader/>

         <CustomerInvoiceRequest actionCode="04">

            <ProposedInvoiceDate>2025-10-13</ProposedInvoiceDate>

            <BaseBusinessTransactionDocumentID>EXT_2025_11</BaseBusinessTransactionDocumentID>

            <BuyerParty>

               <InternalID>10000253</InternalID>

            </BuyerParty>

            <SalesUnitParty>

               <InternalID>P1110</InternalID>

            </SalesUnitParty>

            <SalesAndServiceBusinessArea>

               <DistributionChannelCode>01</DistributionChannelCode>

            </SalesAndServiceBusinessArea>

            <PricingTerms>

               <PricingProcedureCode>PPSTD1</PricingProcedureCode>

               <CurrencyCode>EUR</CurrencyCode>

            </PricingTerms>

            <Item>

               <BaseBusinessTransactionDocumentItemID>10</BaseBusinessTransactionDocumentItemID>

               <ReceivablesPropertyMovementDirectionCode>1</ReceivablesPropertyMovementDirectionCode>

               <Product>

                  <InternalID>123456</InternalID>

                  <TypeCode>1</TypeCode>

               </Product>

               <Quantity unitCode="EA">1</Quantity>

               <QuantityTypeCode>EA</QuantityTypeCode>

               <PriceAndTax>

                  <PriceComponent>

                     <TypeCode>7PR1</TypeCode>

                     <Rate>

                        <DecimalValue>13</DecimalValue>

                        <CurrencyCode>EUR</CurrencyCode>

                        <BaseDecimalValue>1.0</BaseDecimalValue>

                        <BaseMeasureUnitCode>EA</BaseMeasureUnitCode>

                     </Rate>

                  </PriceComponent>

                  <PriceComponent>

                     <TypeCode>7PRA</TypeCode>

                     <Rate>

                        <DecimalValue>5</DecimalValue>

                     </Rate>

                  </PriceComponent>

               </PriceAndTax>

            </Item>

         </CustomerInvoiceRequest>

      </glob:CustomerInvoiceRequestBundleMaintainRequest_sync>

   </soap:Body>

</soap:Envelope>

In the System the External Invoice Request will have the following Price Components: 

Example 7PRA

Keywords

External Customer Invoice Request, web service, ManageCustomerInvoiceRequestIn, Error, price components, Discount, 7PR6, 7PRB, 7PRA, Restocking Fee, Quality Loss Fee, amount, percentage , KBA , AP-CI-CI , Customer Invoice , Problem

Product

SAP Business ByDesign all versions