cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a delivery note based on a sales order in SBO2005

Former Member
0 Kudos

Hi

I am using the diapi to create a delivery note based on a sales order. Everything works well apart from I have 3 user defined fields on the sales order lines, 2 numeric and one which is a combo box.

The 2 numeric values as copied across ok but the combo is not.

I don't know what the delivery number is as I guess SAP assigns that after I save the delivery note.

Can anyone help me with this please ?

Regards Andy

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Paul,

You can capture the assigned DOCENTRY by using a query. ex. SELECT MAX(DOCENTRY) FROM ODLN. You can also use the SBO_SP_TransactionNOtification stored procedure which you can trap during Add, Update, Cancel or Delete. Hope this helps...

Former Member
0 Kudos

Hi Paul

Thanks for the idea, the only problem I can see is if two or more people are runnimng my routine at the same time. I may pick up the wrong number

Regards Andy

Answers (2)

Answers (2)

Former Member
0 Kudos

What i would do is,

1. CReate a new UDF in marketing document (title level) for GUID

2. Generate unique GUID something like this

Guid.NewGuid.ToString before adding the document

3. do a query on the guid created and get the docnum

4. remove the guid created from that document after obtaining the docnum

hope this help

Former Member
0 Kudos

Hi Paul & Gilbert,

As you assumed, the docentry is created at the moment when you are saving the document.

The docentry for the last created document can be retrieved from the Company object. There are two alternative methods for this: GetNewObjectCode and GetNewObjectKey. Please see the DI API reference for more details. These are the only reliable way to get the last created docentry. A query might work nicely in 95% of the cases, but in a multi-user environment it will sooner or later produce incorrect results.

Henry

Former Member
0 Kudos

Hi Henry

Thanks for your answer, I think I may try a query on remarks field in the delivery note, ie look for 'Delivery based on order 34'

Regards Andy