I've made a document layout for the Delivery layout to print in a single document the items & their batch or serial numbers. SAP BO doesn't manage this information together, it prints one document with the items & additional ones for the batch and serial numbers. So, I created one stored procedure that takes the information that I need and inserts it in the DLN1 table from which the information is taken for the report, and another one that deletes that information, at the end I'm leaving the DLN1 table as it was before I run the stored procedures.
I'm using the MenuEvent to catch when the user click the Print or PrintPreview buttons, then when the pVal.BeforeAction=True I run the stored procedure that inserts the information and when it's False I run the one that deletes the info.
The problem is that when I print or preview the document the additional rows I've inserted doesn't appear. I don't know if I'm catching the appropriate event or what event should I catch to make this work.
If someone could help me with this I'll be very thankful.