cancel
Showing results for 
Search instead for 
Did you mean: 

How to add Package to a Delivery Note?

Former Member
0 Kudos

Hello, I want to add package information via DI API, but I don't know how start.

Thanks

David Muñoz

Accepted Solutions (1)

Accepted Solutions (1)

former_member201110
Active Contributor
0 Kudos

Hi David,

I think what you need is the DocumentPackages object in the DI API. This is a child object of the Documents object and allows you to add and edit the packaging information on a marketing document.

There is sample code in the SDK if you look at the DocumentPackages object in the DI API reference.

Kind Regards,

Owen

Former Member
0 Kudos

Hi Owen. I can't find the code sample that you mention.

I'm using SBO 2007 A (8.00.181) SP: 00 PL 47.

Thank you

David

former_member201110
Active Contributor
0 Kudos

Hi David,

You should find the sample by selecting the DocumentPackages object in the DI API reference. The SDK docs I checked were for build 800.171 (ie earlier than patch 47) so the object should be available to you.

I've copied the sample from the SDK below:


Dim Delivery As SAPbobsCOM.Documents
Dim Line As SAPbobsCOM.Document_Lines
Dim Pack As SAPbobsCOM.DocumentPackages
Dim Item As SAPbobsCOM.DocumentPackageItems

'Add a delivery with Package
'Delivery header
Delivery = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDeliveryNotes)
Delivery.CardCode = "C20000"
Line = Delivery.Lines

'Delivery lines
Line.ItemCode = "A00001"
Line.Quantity = 1
Line.Add()
Line.ItemCode = "A00002"
Line.Quantity = 2

'Package settings
Pack = Delivery.Packages
Pack.Number = 1
Pack.Type = "Box"

'Package Content
Item = Pack.Items
Item.ItemCode = "A00001"
Item.Quantity = 1
Item.Add()
Item.ItemCode = "A00002"
Item.Quantity = 1

'Adding Delivery with package
Delivery.Add()

'Get and Update a Package
Delivery.GetByKey(1) ' Get a delivery by it's Document Number
Pack = Delivery.Packages ' Get the Packages of the Delivery
Pack.Type = "Container" ' Change the type of the Package to Container
Delivery.Update() ' Update the Delivery

'Delete a Package
Delivery.GetByKey(1) ' Get a delivery by it's Document Number
Pack = Delivery.Packages ' Get the Packages of the Delivery
Pack.Delete() ' Delete the package
Delivery.Update() ' Update the Delivery Document

Kind Regards,

Owen

Former Member
0 Kudos

Hello Owen.

Thank you very much for the help.

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Owen Slater 

How to add Sales BOM to a Delivery Note?

Former Member
0 Kudos

Have you searched the forum? Check these first:

Former Member
0 Kudos

Hi David Muñoz,

What kind of package info are you looking for?

Thanks,

Gordon

Former Member
0 Kudos

I try to emulate the right Click -> Packaging

I want to add Package type and content like Package - Setup Form