Você está na página 1de 9

Products

Products Industries
Industries Services Support
Services and Support Training
Training Community
Community Developer
Developer Partner
Partner

About
About

 
Ask a Question Write a Blog Post Login

Former Member
January 13, 2014 3 minute read

How to include administrative data to a BOPF node


Follow RSS feed Like

5 Likes 2,437 Views 8 Comments

Developing a data model for your application, you normally want to track changes. So you add attributes like created_by,
changed_by and so on at least for the header data. Sometimes the business requires also to track changes on item level.
BOPF supports this standard requirement by a library function. This tutorial shows you how to use it in your BOPF BO.
The tutorial starts with the business object SALES_QUOTE created in the ‘Getting Started with Business Object Processing Framework’.
This Business Object follows the semantics of the sales quote based on the NetWeaver Enterprise Procurement Model (EPM). You can
use the BOB or BOBX editor. The tuturial uses BOB.
In the rst step we include the structure /BOBF/S_LIB_ADMIN_DATA in
the persistent structure of the root 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 a ributes CREA_DATE_TIME and
LCHG_DATE_TIME – both typed with the data element TIMESTAMPL for UTC mestamp – and the a ributes 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 di erent 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 de ne the trigger nodes. As we only de ned 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 in uence the update of these attributes.

Summary
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.
Alert Moderator

Assigned tags

ABAP Development | former jive document |

Related Blog Posts

BOPF SCN Sitemap


By Tilmann David Kopp , Jan 09, 2015
BOPF: Using Non-UUIDs (DB_KEY) keys DB tables
By Gaurav Sharan , Jun 07, 2018
BOPF Code Values Check
By Former Member , Oct 04, 2013

Related Questions

Posting data to BOPF node


By Surya Teja , Aug 28, 2018

Confused in BOPF? Where to use?


By Srinivasa Mukka , Apr 23, 2018
BOPF and FPM with dynamic data model
By Mike Pokraka , Dec 22, 2016

8 Comments

You must be Logged on to comment or reply to a post.

Tilmann David Kopp

January 9, 2015 at 10:45 am


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 a ected node instances of the transaction will have exactly the same timestamp
value. 
Like (0)

Christian Guenter

January 16, 2015 at 7:35 am


Hi Thea,

nice Tutorial.

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…

Thanks.

Regards Christian

Like (0)

Former Member | Post author

January 16, 2015 at 8:28 am


Hi Christian,

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.

Kind regards

Thea

Like (0)

Christian Guenter

January 16, 2015 at 10:25 am


Great, thank you.

The namespaces are indeed really confusing

Regards Christian

Like (0)

Siegfried Kuri

February 16, 2018 at 11:41 am


Hi Thea,

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 ne. Is this really the right way to do it?  or am i doing something wrong?

Regards, Siggi

Like (0)

Neil Ward

April 2, 2019 at 7:37 pm


Hi,

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?

Like (0)

Custodio de Oliveira

April 2, 2019 at 10:02 pm


Hi Neil,

I’m using it on 1809, so I would say yes.

Like (0)

Neil Ward

April 6, 2019 at 10:19 pm


twas my mistake, forgot to add the ADMIN_DATA group name in the structure

Like (0)
Share & Follow

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Sitemap Newsletter

Você também pode gostar