Skip to Content

Cancelling Documents using DI API

Jan 29 at 02:02 PM


avatar image

Good day,

I am developing a code where I have to cancel a documents using DI API SDK.

I see some documents using the method Cancel and ther others using the method


For Example:

The Sales Orders use the Method: ObjectOrder.Cancel()

The Invoices use the method: ObjectTarget = ObjectInvoice.CreateCancellationDocument()

The Question is, How do i know which documents use the method Cancel or


Thanks and Regard.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Danilo Kasparian Jan 29 at 03:02 PM

It is the same idea when you are using SAP as an user. You don`t need to create a document to cancel an Order, but in order to cancel an invoice, you need to create another document.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Thank you for your answer,

Is there any property that tells me which documents can only be done with the cancel method?


Hi david,

You will know when you should use each when you get more familiar with SAP
But as a rule of Thumb, most documents that has a journal entry posting will need to use the CreateCancellationDocument.
All of this documents will have a TransId Value in the table.