Beruflich Dokumente
Kultur Dokumente
In this blog I want to give an overview about how FPM supports work protection.
The basic requirement for work protection is very simple: Whenever the application
contains unsaved data ('is dirty') and the user is about to leave the application presents
him a data-loss popup.
So although this seems to be a rather easy requirement, there is some complexity
involved. This is due to the fact that 3 parties have to interact: The shell (portal or
NWBC), FPM and the business logic.
Basically there are 2 reasons why an application might be dirty:
1. The user entered some data on the screen but did not trigger a roundtrip. This
data is then only available on the client but not in the backend.
2. The user is leaving the application after having maintained a lot of data, but did
not save it. In this case the backend knows all the data, because there have been
several round-trips before. Nevertheless if the application is left then the data is
lost as it is not getting persisted.
Now in the FPM world there is a complete separation between the frontend-side
rendering (which is done using HTML and javascript) and the backend logic
(implemented in ABAP). As a consequence the backend logic isn't capable of detecting
the client-side dirty state and can only deal with the 2nd point. Therefore we have 2
different work protect mechanisms in FPM: the client-side and the backend work
protect mode.
Client-Side Work Protect Mode
The client side work protect mode is a feature of the shell. This means it only works
when the application is running in the SAP Portal or in Netweaver Business Client
(NWBC). It's quite simple: With any user interaction the dirty state is set to true and
stays at this value until the next roundtrip is started. Then the control is passed to the
backend and the dirty state is cleared again.
The problem here is, that there is no generic way to decide whether or not a user
considers his interaction to be worth to be protected. As a consequence this type of
work protection might result in unnecessary data-loss popups (one example: The user
changes an entry in a drop-down list box - now it depends completely on the scenario
whether this change should be work-protected or not).
In FPM the client-side work protect mode is active by default. Note 1801019 explains
how to switch it off.