SAP Knowledge Base Article - Public

3748617 - Error When Adding Attachments to External Customer Invoice Request Using Web Service

Symptom

An error occurs when trying to upload an attachment for a new External Customer Invoice Request via web service.

The error message is:

"Error during modification to dependent object AttachmentFolder"

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 and the BinaryObject for the attachment 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">
            <BaseBusinessTransactionDocumentID>EXT_2026_06</BaseBusinessTransactionDocumentID>
            <BuyerParty>
               <InternalID>10000005</InternalID>
            </BuyerParty>
            <BillToParty>
               <InternalID>10000005</InternalID>
            </BillToParty>
            <SalesUnitParty>
               <InternalID>P1110</InternalID>
            </SalesUnitParty>
            <PayerParty>
               <InternalID>10000005</InternalID>
            </PayerParty>
            <PricingTerms>
               <PricingProcedureCode listID="2">PPSTD1</PricingProcedureCode>
               <CurrencyCode>EUR</CurrencyCode>
               <ProvisionDate>2024-09-11</ProvisionDate>
            </PricingTerms>
            <Item>
               <BaseBusinessTransactionDocumentItemID>10</BaseBusinessTransactionDocumentItemID>
               <BaseBusinessTransactionDocumentItemTypeCode>002</BaseBusinessTransactionDocumentItemTypeCode>
               <ReceivablesPropertyMovementDirectionCode>2</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 listID="2">7PRA</TypeCode>
                     <Rate>
                        <DecimalValue>5</DecimalValue>
                        <CurrencyCode>EUR</CurrencyCode>
                     </Rate>
                  </PriceComponent>
               </PriceAndTax>
               <ProductTaxDetails>
                  <ProductTaxationCharacteristicsCode listID="DE">501</ProductTaxationCharacteristicsCode>
                  <ProductTax>
                     <CountryCode>DE</CountryCode>
                  </ProductTax>
                  <TransactionCurrencyProductTax>
                     <CountryCode>DE</CountryCode>
                  </TransactionCurrencyProductTax>
               </ProductTaxDetails>
            </Item>
            <AttachmentFolder>
               <Document>
                  <VisibleIndicator>true</VisibleIndicator>
                  <CategoryCode>2</CategoryCode>
                  <TypeCode>10001</TypeCode>
                  <MIMECode>application/pdf</MIMECode>
                  <Name>SampleAttachment.pdf</Name>
                  <FileContent>
                     <BinaryObject>Enter the base64 version of the attachement file here</BinaryObject>
                  </FileContent>
               </Document>
            </AttachmentFolder>
         </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:L8P:/1SAI/TAE97B4B03BFBA11CE28D92:804">
         <Log>
            <MaximumLogItemSeverityCode>3</MaximumLogItemSeverityCode>
            <Item>
               <TypeID>200(//BEF/FOUNDATION_ROBJ/)</TypeID>
               <CategoryCode>INC.BOI</CategoryCode>
               <SeverityCode>3</SeverityCode>
               <Note>Error during modification to dependent object AttachmentFolder</Note>
            </Item>
         </Log>
      </n0:CustomerInvoiceRequestBundleMaintainConfirmation_sync>
   </env:Body>
</env:Envelope>

Cause

The following tags <CategoryCode> and <TypeCode>, are not maintained in the payload which is used for creating the External Customer Invoice Request due to which the error is occurring. 

Resolution

Correct your payload and add the CategoryCode and TypeCode in the AttachmentFolder tag: 
 …
<AttachmentFolder>
               <Document>
                  <VisibleIndicator>true</VisibleIndicator>
                  <CategoryCode>2</CategoryCode>
                  <TypeCode>10001</TypeCode>
                  <MIMECode>application/pdf</MIMECode>
                  <Name>SampleAttachment.pdf</Name>
                  <FileContent>
                     <BinaryObject>Enter the base64 version of the attachement file here</BinaryObject>
                  </FileContent>
               </Document>
</AttachmentFolder>

See Also

KBA 3582496 - Error When Adding Attachments to Account Object Using Web Service

Keywords

customer invoice request, managecustomerinvoicerequestin, attachmentfolder, error during modification, TypeID 200, //BEF/FOUNDATION_ROBJ/, categorycode 2, typecode 10001, filecontent, binaryobject, MIMECode application/pdf, external invoice request, web service attachment, bydesign api, attachment upload failure , KBA , AP-CI-CI , Customer Invoice , Problem

Product

SAP Business ByDesign all versions