cancel
Showing results for 
Search instead for 
Did you mean: 

Create Delivery Note From Draft

Former Member
0 Kudos

Hi, can anyone tell me how to create a Delivery Note from a draft document using DI-API?

Thanks.

Joseph

Accepted Solutions (1)

Accepted Solutions (1)

Nussi
Active Contributor
0 Kudos

there's one sample in the diapi documention.

it descripes how create an order from a draft.

i place the code here:

Private Sub cmdDraftToOrder_Click()

Dim pDraft As SAPbobsCOM.Documents

Set pDraft = vCmp.GetBusinessObject(oDrafts)

Dim pOrder As SAPbobsCOM.Documents

vCmp.XmlExportType = xet_ExportImportMode

vCmp.XMLAsString = False

pDraft.GetByKey (3)

pDraft.SaveXML ("c:\drafts.xml")

'Here you should add a code that will change the Object's

'value from 112 (Drafts) to 17 (Orders) (Delivery is 15) and also you should

'remove the DocObjectCode node from the xml. You can use any

'xml parser.

'

'Create a new order

Set pOrder = vCmp.GetBusinessObjectFromXML("c:\drafts.xml", 0)

pOrder.Add

End Sub

use this code and update the xml like described.

if you're happy reward points

regards

David

Former Member
0 Kudos

Hi David,

Thanks for your response. Is exportToXML and importFromXML the only way to create document from draft?

Regards,

Joseph

Nussi
Active Contributor
0 Kudos

it is the official way from the sdk documentation.

you can also do the following.

copy all properties direct from a oDraft object to an oDelivery object.

after adding remove the Draft from ODRF table

Answers (0)