How to include administrative data to a BOPF node
In the second step we create the determination on the root node.
Last but not least we test the changes in the BO test tool BOBT.
Enhance the structure of the root node
In this step we will enhance data structure of the root node and add the attributes for administrative data. Launch the Business Object Builder (BOB). Open the business object ZD_SALES_QUOTE and navigate to the root node.
Double click the persistent structure and navigate to the data dictionary. Insert an include with the data type /BOBF/S_LIB_ADMIN_DATA and the group name ADMIN_DATA. This data structure contains the attributes CREA_DATE_TIME and LCHG_DATE_TIME – both typed with the data element TIMESTAMPL for UTC timestamp – and the attributes CREA_UNAME and LCHG_UNAME – both typed with the data element UNAME.
Save and activate the DDIC change. Then go back to the BO editor.
Create a determination
In the BO editor, start the determination creation wizard on the root node. Enter the determination name DET_ADM_DATA and a description.
Continue to the next step where you enter the name of the implementing class. Use the BOPF library class /BOBF/CL_LIB_D_ADMIN_DATA_TSM which cares for maintaining the adminstrative attributes.
Continue to the next step to determine the Determination Pattern. Determinations can be executed at different phases of the transaction. Administrative data must only be updated before the user saves the BO instance. So we select the pattern Derive dependent data before saving.
Continue to the next step to define the trigger nodes. As we only defined the administrative data on the root node, we want it to be updated at any time something changes in the BO instance, be it on root or item level. So we have to select all nodes as trigger nodes. The administrative data must be updated even when an item is deleted, not only when a root or item node is created or updated. We want to track all changes.
Continue and complete the wizard. The administrative data is now updated at any change on the BO instance. You can verify this with the BO test tool (BOBT).
Test the changes
To test the changes launch the transaction BOBT. Open the BO ZD_SALES_QUOTE and add a new instance. You can see the new attributes to track the BO changes. If you save the data the attributes are determined by the framework. Play around with item instances. You will see that they also influence the update of these attributes.
With a few model changes and the use of a BOPF library class, you can add attributes for tracking business object changes on each node level without having to code it by your own. You can test the new feature without any test code in the BO test tool.
Thanks for this very good tutorial on how to use admin data for business objects. There is one more good thing about this solution that is worth to be mentioned: All affected node instances of the transaction will have exactly the same timestamp value.
Unfortunately i have an issue with the structure /BOPF/S_LIB_ADMIN_DATA. It's neither available im our 7.31 SP05 (ERP) nor in our 7.40 SP08 (SCM) system. Are there special requirements for this structure? Any note or something else? Of course i can easily create a similar structure for my own...
our namespaces are confusing: it is /BOBF/S_LIB_ADMIN_DATA. I felt in the trap myself... I corrected it now also in the document.
Great, thank you.
The namespaces are indeed really confusing 😉
i started working with BOPF in eclipse and i tried to add this determination. But unfortunately in eclipse only "react during save" can be set, the timepoint "before save" is missing. So i have to go to BOBX and set the timepoint "Before save" and then it works fine. Is this really the right way to do it? or am i doing something wrong?
I just tried to implement this and when testing I get a short dump with message_type_x
Is this method still valid for BOPF on an S4 system 1709?
I'm using it on 1809, so I would say yes.
twas my mistake, forgot to add the ADMIN_DATA group name in the structure 🙁