Product Lifecycle Management Blogs by Members
Get insider knowledge about product lifecycle management software from SAP. Tap into insights and real-world experiences with community member blog posts.
cancel
Showing results for 
Search instead for 
Did you mean: 
BenPatterson
Participant

Introduction:

I have recently had the opportunity to be on a team that delivered EHSM 2.0 and upgraded to 3.0 both on ramp-up.

Being such a new product I wanted to share my experience from a development perspective, hopefully providing some assistance to others embarking on a similar adventure. This first blog aims to give an overview of the solution with the intention of helping to put it all into perspective. The solution is quite well architected but it can be complex to navigate when trying to add custom requirements. I found that once I had a good grasp on how things worked over-all it was much easier to know where to look and start enhancing to achieve the desired result.  In subsequent posts I would like to elaborate on the approaches to take when enhancing particular components of the solution.

Background:

EHSM is a new solution, extending the original EHS module and has been built from the ground up using the latest and greatest of SAP's NetWeaver ABAP infrastructure offerings. For more detail on the overall solution you can look at online help in the SAP Library - Component Extension for SAP Environment, Health, and Safety Management

Architecture Overview:

The diagram below provides a conceptual overview of the technical solution. The following sections will go through each of the components and the approaches for enhancing them at a high level:

  • User Interface

EHSM has two main access channels Web Dynpro and Adobe Forms. To find all of the objects check out the package EHHSS_PC_INC_RECORDING.

    • Web Dynpro FPM

FPM is all the rage these days and for good reason, however, when built on top of a domain model such as BOPF it really comes into its own. ESHM leverages this well and most of the generic FPM UIBBs such as forms, lists, tabbed and search components are built on top of BOPF (using EHSM frameworks with FBI [FPM BOPF Integration] ). This exposes the BOPF data layer as well as events, relationships and even UI logic. FPM wires are used to enable generic and configurable connections between components and of course feeder classes are used to provide UI specific behaviour.

    • Adobe Forms

SAP Interactive Forms by Adobe are used for offline data entry and can be submitted via email. This provides a lot of flexibility especially for scenarios where the recording of data may be remote and difficult to access the network (e.g. for use by contractors who may not have access to the system). Each form is generated by a 'data provider' class which pre-populates fields and drop-downs. The inbound form is handled by an 'inbound persister' class that collects the data and orchestrates the mapping and saving of the data. A nice feature is that these classes are not set as final and the implementation class is specified in configuration allowing for straight-forward enhancement.
Although access via mobile device was not in scope for our project I did notice an iPhone app in the app store for this and there is also a web service layer available for integrating third party solutions of such a nature.

  • EHSM Tools and Configuration

The EHSM solution provides a large suite of domain specific logic in reusable classes, in particular a gateway layer providing accesses to the BOPF configuration and transaction layer. This provides much of the interaction and logic between the user interface layer and the BOPF transactional layer. Other tools include range of helper classes to assist in working with various EHSM concepts. One such example is the EHSM Party which can represent an HR Person, a System User or Business Partner, etc. (refer to class CL_EHFND_PARTY_PROXY). This model (much of it residing in package EHFND_REUSE_COMPS) is quite rich and well worth leveraging where possible. There is even a master data customising generator (transaction EHFND_CUST_GENERATOR) that can generate objects such as master data tables, text tables and search helps for new data types.

  • BOPF

The BOPF layer provides the core business logic and most of the business rules and behaviour is found here. Each logical component is defined as an object so for example an incident is represented in the node EHHSS_INCIDENT. Objects can have usage dependencies with each other and also have inheritance. Actions relating to incidents for example are represented with EHHSS_INCIDENT_ACTION which inherit from EHFND_ACTION and are linked to the EHHSS_INCIDENT object via a relationship definition in the BOPF configuration definition.

Within an object there are nodes that have data and behaviour configured against them. The nodes relate to each other in a hierarchical manner with a root node at the base of the tree. Data is assigned as either persistent (saved to the database) or transient (represented at runtime only) and this is defined by a grouping of data dictionary structures and one table per node where the data for that node is persisted. The BOPF Model and BOPF runtime manage the data structures, relationships and events at runtime. The transaction layer manages the persistence and buffering of the data. The data structures of the nodes can be extended to allow for custom enhancements. Each node also has actions, determinations and relationships (among other things) assigned to it. Actions as the name suggest allow callable behaviour to be executed on the node. A Determination has behaviour that is triggered on particular events in the BOPF event loop. This is where transient field values are calculated and field control occurs.

  • Workflow

Even workflows themselves are represented using business objects from the BOPF. In this way each process is encapsulated in the same framework as the other components of the solution. The business objects are called Process Control Business Objects (PCBOs).

Overview of Enhancement:

The two fundamental technologies used are BOPF and FPM. So for the scope of this blog I will briefly mention the approaches for enhancing these and as stated earlier, will go into detail on how to implement specific scenarios in subsequent blogs.

  • BOPF

The most common and straight forward enhancement is the addition of custom fields. This is done through extending the standard structures in the BOPF.

The BOPF Enhancement Workbench transaction [BOPF_EWB] allows custom extension to the BOPF objects. Although not everything is configurable, much of the functionality can be extended, including the addition of  determinations (useful for adding logic to custom transient fields), actions, queries and even new nodes. The addition of new nodes are especially helpful when adding a new section of data and behaviour to the solution. For example, the addition of a new tab on the user interface. Further information can be found in the BOPF enhancement Workbench document (refer to note 1457235). Another option for enhancement is to use the enhancement framework on the implementation classes for the existing BOPF framework events.

  • FPM

Extending the functionality of FPM over BOPF is very smooth for things like adding a new field to the BOPF, simply adding the field as an enhancement to the component configuration and updating the EHSM field control configuration is all it takes. The framework takes care of all the persistence/transactional headaches for you. Depending on the complexity of your requirements you may need to extend or enhance the standard feeder classes of the various generic UIBB component configurations. Many of the standard EHSM feeder classes are not set as final so extension is often a viable option. The following provide a good references and starting point for these concepts:

Floorplan Manager for Web Dynpro ABAP - Developer's Guide

How to Create, Enhance and Adapt Floorplan Manager Applications on  SAP NetWeaver 7.0 EhP2

FPM BOPF Integration (FBI) - Reusable Objects and Functions for the BOPF Environment (CA-EPT- - S...

Perspectives:

Above I have tried to be as factual and objective as possible, in this section I will taint this  article with my own views from my experience so far.

  • Triumphs

There were many times when my colleagues would find me beaming with the warm satisfaction that an enterprise geek would find in quickly constructing a robust transactional solution to a business requirement. The framework provided a convenient and logical approach to extending the functionality (most of the time). Overall I enjoyed working with the solution.

It was a rare opportunity to be involved in an implementation followed directly by an upgrade. And all the enhancements (from FPM component configuration, to BOPF, to methods) held up considerably well.

The combination of the solution from SAP, and what we were able to enhance, created one of the most user friendly SAP solutions I've seen of this nature.

Being on ramp-up was also a good experience and I have to complement the SAP solution team for a well developed product and the great support for us while delivering it.

  • Tribulations

There were many other times when my colleagues found me shaking my fist at the screen shouting (in a workplace sensitive way of course) "curse you BOPF". The framework is complicated and this means that things were quite a challenge at times. In particular BOPF and FPM events and relationships (both within and between the two) were particularly hard to piece together, especially at the start of the project.

At times the Field Control configuration was very hard to work with. When it worked it was great but when it didn't it was very hard to determine why and where the issue arose.

Conclusion:

The key to designing and building an enhancement in this solution smoothly is to have a good grasp on the technology components and how they are linked together (both technically and architecturally). Due to these things being relatively new it is hard to draw from experience, which is why I decided to share what I could. As we have gone over the components of the EHSM solution and general approaches on how to enhance it I hope you now have a good place to start as you work with it yourself. I would be keen to hear about your experiences and thoughts on this topic as well.

This is just an overview and if I get the feedback and the time I hope to explore some of the concepts further.

34 Comments
Former Member
0 Kudos

Great first post, Ben! You have completely achieved the 1st rule of blogging on SCN - "leave the audience wanting more!"

It's gratifying to see what you were able to achieve in terms of extending the solution without experiencing pain via the subsequent upgrade. We have done a lot of tinkering and testing in the "lab" via demo systems and proof of concept activities, and have a great deal of confidence in the solution and architecture to behave this way, but the only real proof is customer usage and success.

I'm looking forward to learning more about the enhancements you made and what you were able to achieve.

BenPatterson
Participant
0 Kudos

Thanks for the encouragement Jeremiah

Former Member
0 Kudos

Hi Ben

I would like to understand, how to add custom tab in EHSM - Inc mgmt using BOPF ?

Thanks and Regards.

Mandar Sathe.

BenPatterson
Participant
0 Kudos

Thanks Mandar, I will take this on board when considering my next post.

barzake
Participant
0 Kudos

Good time Mr. Ben.

Do you have SAP courses how to start with EH&S module?

I'll so appreciate your help.

Respectfully,

Evhen Barzak <email removed by moderator>

Former Member
0 Kudos

Yes. SAP offers severals ways for you to learn about the solution. In the on-line help http://help.sap.com/ehs-comp you will find various documents. Also, on the right side of the page, you'll find a link to the education offerings or "on line knowledge product."

MassimoX
Participant
0 Kudos

Hi  Ben, i need  add custom field " Other Description" ( long text ,type string ) into node incident as Description of Events ( BASIC_INFO_ALL_DESC ), i can do it?

With BOPF Enhancement Workbench it is not possible add delegation node!?!

BenPatterson
Participant
0 Kudos

Hello Massimo,

Firstly, I am sorry I have not replied sooner, I expected an email update on new comments but I didn't receive one with your comment.

Unfortunately you are correct, it is not possible to add delegation nodes when enhancing BOPF objects, therefore you are not able to create a delegation to the standard object EHFND_TEXT_COLLECTION and re-use all the standard functionality related to this (such as delta change handling).

As a work around you should be able to create a node under Basic Info with a simple structure containing a text field of type string (/BOBF/TEXT_CONTENT if you like) and language. There will be a little more work to do it this way as you will need to set up the determination to manage the creations and cardinality of the node, but it should meet your requirements.

I also hope this enhancement functionality is added in the near future...

Let me know if that helps at all. This is also a prompt for me to start the next blog explaining more detail on how to enhance the BOPF.

Regards,

Ben.

MassimoX
Participant
0 Kudos

Thanks for answer, luckily i need only 2 language local ed english.
So i have create for every custom long text  a sub node with:
-  include /BOBF/TXC_TEXT_TYPE for Administrative data( management with determination for update data )
- desc local ( string )
- desc english ( string ).

Work great!

I only have one problem: always  need create all custom subnode otherwise
Connetion OIF webdynpro FPM does not work. (filed is disable ,not editable )
disadvantage i have a lot of empity node.

 

I tried to change same parameter: Use deferred create, Create On Demand, Allow Instance Creation, from  Feeder Class CL_EHFND_FBI_GUIBB_FORM , but i have same problem.
At the monent i have determination to create custom nodes.

I need another piece of advice ... there is a way to assign a default value to a field into EHS customizing?

BenPatterson
Participant
0 Kudos

Hi Massimo,

it is a requirement that you have to create an instance of your custom node via determination as you have discovered. Another helpful thing to do is to add a transient determination for the standard EHFND field control (re-using class CL_EHHSS_INC_D_FIELD_CONTROL). Then you can use field control configuration for your custom node.

Regarding default values, this also has to be done manually (this was a feature that we also wished to have). To fill default values you can create a determination for this and check the execution time is after loading, or you can enhance the /BOBF/IF_FRW_NODE~RETRIEVE_DEFAULT_VALUES method of the node class (e.g. CL_EHHSS_INC_BIALL_DEF for basic info all).

Ben.

former_member199082
Discoverer
0 Kudos

Hi Mandar,

     You can add your custom Tab in EHSM-INC through FPM. Steps are as follows

1. Enhance Component Configuration

2. Add Tab UIBB Component

3. Add list UIBB/Form UIBB in Tab UIBB and click on Configure UIBB

4. Give Feeder class name and in Feeder class parameter give your BO name and Node Name.

Thanks,

Sumedh Utpat

Former Member
0 Kudos

Hey Hi Mandar,

To create a Custom Tab in EHSM, enhance the component configuration and add a new tab.

Regards,

Sanket.

Former Member
0 Kudos

Hi Massimo,

Try creating just a custom field by enhancing and the BASIC_INFO_ALL_DESC using a transient structure. Populate that custom field by an on load determination.

Regards,

Sanket.

MassimoX
Participant
0 Kudos

it is not possible, BASIC_INFO_ALL_DESC is delegation node.

MassimoX
Participant
0 Kudos

I used the new Enhancement Context-Based Adaptations (CBA), work great.

Former Member
0 Kudos

Hi Massimo,

Can you please elaborate about the Enhancement Context-Based Adaptations (CBA).

Will be useful to me :smile: .

Thanks & Regards,

Sanket.

MassimoX
Participant
0 Kudos

It is slightly complicated to understand, but it has many advantages:

- It is created like virtual copy of standard, you  not enhancement the standard.

CBA is technically realized by wrapping the original application inside an embedding component Which is responsible for managing the adaptations. This way it "s possible to enable CBAs without modifying the existing application.

drawbacks:

need to change the roles to operate the OBN

read this:

http://scn.sap.com/docs/DOC-28799

https://scn.sap.com/docs/DOC-33072

CD268_Adapting Floorplan Manager and Web Dynpro_ABAP Based User Interfaces

regards,

massimo

dhinsap
Active Participant
0 Kudos

Hi Ben,

I believe this content is helpful but little complicated to understand unless u have a knowledge on the architecture of EHSM. Better understood if being explained using simple terminologies as I had to look searching for terms in the blog and their functions.

Regards

Dhinesh

BenPatterson
Participant
0 Kudos

Thank you for your feedback Dhinesh.

Please let me know the specific terminologies you struggled with when reading the blog as I may be able to elaborate on them.

Kind regards,

Ben.

dhinsap
Active Participant
0 Kudos

Hi ben,

In my view, one must know well the architecture of using EHSM before going through this stuff. I did not understand the terms like FPM, BOPF, feeder class, UIBB conenctions....its seems too technical for a functional consultant like me. I am fresher in this stuff.I mean to say any person will not be able to understand if a salesman try to explain the mechanism of a engine transmission system of a BMW car. But it is rather simple to tell him it works on a automatic/manual transmission to brief. Im sorry if I misunderstood you or I may be an amateur to this topic. Im working on classic EHS only.

Kind regards

Dhinesh

Former Member
0 Kudos

Hi Ben

I need to automatically determine and add Line Manager(LM) and Safety Coordinator(SC) to the list of involved partners when reporting an incident. Could you please give me an advice on where such logic should be implemented?

The subsequent workflow needs to send notifications about the incident to the LM and SC. How can this be achieved? By default notifications are sent to the incident managers.

Regards

Jon GG

BenPatterson
Participant
0 Kudos

Hello Jon,

I would look at creating a determination on the incident root node to create these default 'persons involved'. The logic to determine who these people are should of course be encapsulated in a separate class.

As far as workflow goes it is best to copy the standard workflow and create your own and change the way that the event manager is determined. Once these people are added to the incident they can be accessed in the incident object (although) indirectly via the process object. Extension of the incident life cycle standard process object will be needed in order to add the required new methods to access this information. The configuration will also need to be updated accordingly to point to the new class and workflow.

Sounds like a good project.

Beset of luck.

Ben.

dhinsap
Active Participant
0 Kudos

Dear Ben,

I have installed EHSM 3.0. Now How do i create a role or a workflow or task. what is the procedure to create/record a incident. What are the pre-requisites to do it.( any configuration required in SAP EHS management in SPRO?. Kindly share some information.

Regards

Dhinesh

rama_shankar3
Active Contributor
0 Kudos

Hello Ben:

Thanks for publishing this informative blog.

Rama Shankar

Former Member
0 Kudos

I am able to add fields in tab in BO /SCMTMS/FREIGHTAGREEMENT  ....and able to see tab on portal but field on tab not editable....can anyone help me to provide me the solution where i am missing .


I am using same approach you described above

venkat_ratnam3
Explorer
0 Kudos

Hello Ben ,

Thank you for the Blog..

We Have a requirement to remove the radio buttons in the incident adim investigation tab

also change the text for the fields

Please advice how i can acheive that .

Thank you ,

Venkat Ratnam Naidu

MassimoX
Participant
0 Kudos

hi,

1) Enhancement componet configuration of investigation tab

2) use KEYWORD in CMOD

venkat_ratnam3
Explorer
0 Kudos

Hi Massimo ,

since the component of investigation tab is dynamically coming form FPM tabbed uibb .

i could not see the option for this .text and UI are created  dynamically .

is there are any  place we maintain the texts in the configuration level . anywhere in class we control the ui elements .

i have some basic idea about FPM and experience in Web dynpro . i could not see any thing in feeder class level .please suggest .

Thanks in advance  ,

Venkat Ratnam Naidu

MassimoX
Participant
0 Kudos

you can start from componet configuration EHHSS_INC_REC_OIF_V3_INVTAB_MD and  Enhancement UIBB you need.


Text can from data element, if you use KEYWORD in CMOD to change description. fields label update in WD.

Or text are ORT text, you must copy or overwrite standard text.

venkat_ratnam3
Explorer
0 Kudos

Thanks Massimo for the input actually able to change in FPM change group level itself

Former Member
0 Kudos

Hi Ben and other EHSM experts,

Could you help me with the following questions?

1) For EHSM Incident Management Analytic Reports, are they all come from BW/BI, or from EHSM directly? I mean can I have these reports without BW/BI in the landscape?

2) How the Phrase Library (ex, bodyparts, etc) be used in FPM? Or I have to store them in Z tables?

Thanks,

Guorong

vimal
Active Participant
0 Kudos

Hi All,

I have a requirement where i need to change the message text after clicking "Send" button while creating Incident.

How to find the feeder class and method which is called behind "Send" button ?

Thanks,

Vimal

Former Member
0 Kudos

Hi Ben, I´m looking for examples about the implementing a Freestyle GUIBB inside an EHS Incident Report Screen. I´m new in EHS development, and I don´t understand how to implement   /BOFU/CL_FREESTYLE_BOPF_HELPER class to handle the data referred to the incident.

I recently created a thread: FBI Freestyle Helper Sample Implementation

The Freestyle GUIBB has been implemented, but I can´t access any data of the BOPF Data Model.

I appreciate some help, thanks!!!

former_member184739
Contributor
0 Kudos

Hi Ben,

Good blog and greate piece of content. Do you know where the attachments are stored in EHSM system by default. Is it stored in Open Text server. Please throw some lights.

Regards

Prabaharan Asokan