Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

what is Key (docentry) of order just added?

Hi everyone,

On pressing the "Add" button for a new sale the "et_Item_Pressed" event fires twice, before and after adding. Although a default sale order number (docnum - form Item "8") is displayed and can be determined during the "before" event, this number is not reliable because a different, higher, number could be used if someone else has started another sale and saved it before yours.

No useable number is available during the "after" of the Item_Pressed event because the form has been cleared to prepare for adding another sale, and item "8" holds the next default number.

In other words, during the "After" of the "Item_Pressed" event for item "1" (Add) how do I determine the key (docenry) of the sale order just created.

Thanks for any help.

Mel Dodd

Former Member
Former Member replied

Hi Mel,

hence you use the UI to add the document, the only reliable way to know the docentry is by adding a hidden UDF to the document which will be populated with a unique number (lets say a random GUID + user ID) before the Add. after the document was added you should search for the document with this unique ID you will be able to get the correct docentry

let me know if you need more info or sample code

Moty Moshin

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question