Skip to Content
0
Jul 29, 2019 at 09:45 AM

Attachment in CustomerInvoiceRequest

208 Views Last edit Sep 20, 2023 at 08:43 AM 2 rev

Hello,

we create Customer Invoice Requests using the SAP ByDesign Web Service API.

Now i want to ask whether it is possible to add attachments. My code looks like this:

customerinvoicerequest.AttachmentFolder = new AccessAttachmentFolder(); customerinvoicerequest.AttachmentFolder.Document = new AccessAttachmentFolderDocument[1]; customerinvoicerequest.AttachmentFolder.Document[0] = new AccessAttachmentFolderDocument(); //customerinvoicerequest.AttachmentFolder.Document[0].AlternativeName = "DeliveryNote"; customerinvoicerequest.AttachmentFolder.Document[0].Description = new Description(); customerinvoicerequest.AttachmentFolder.Document[0].Description.Value = "DeliveryNote"; customerinvoicerequest.AttachmentFolder.Document[0].FileContentURI = new URI(); customerinvoicerequest.AttachmentFolder.Document[0].FileContentURI.Value = path; //path to a file customerinvoicerequest.AttachmentFolder.Document[0].VisibleIndicator = true; customerinvoicerequest.AttachmentFolder.Document[0].VisibleIndicatorSpecified = true; customerinvoicerequest.AttachmentFolder.Document[0].VisibleIndicatorSpecified = true; customerinvoicerequest.AttachmentFolder.Document[0].MIMECode = "application/pdf"; customerinvoicerequest.AttachmentFolder.Document[0].TypeCode = new DocumentTypeCode(); customerinvoicerequest.AttachmentFolder.Document[0].TypeCode.Value = "10001"; customerinvoicerequest.AttachmentFolder.Document[0].CategoryCode = "2";

If i do this, i get the following error:

Error during modification to dependent object AttachmentFolder

What i am doing wrong?

Best Regards,

Chris