Custom Situation Cases: Model Your Own Situation Objects (2/6)

With SAP S/4HANA Cloud 2202 you can create your own situation use cases using the extended framework for Situation Handling. This blog post series gives you a detailed look at how to configure custom situations based on demo cases. The first blog post Custom Situation Cases: Configure Your Own Use Cases (1/6) provided an overview. This one will show you how to model situation objects.

New%20apps%20for%20Situation%20Handling

New apps for the extended framework for Situation Handling

To illustrate how situation use cases can be created from scratch, the extended framework comes with demo cases that can be triggered with the Situation Handling Demo app. It’s based on a simplified, fictional booking portal that uses SFlight demo data. The configuration comprises two objects (Flight and Booking), one scenario (Flight Profitability), and three demo templates (Ecological Footprint, Sales Rate, and Booking Rate). See also: Situation Handling – Extended Framework.

Let’s start to configure situation objects. A situation object is a model of a business object that enables Situation Handling. It reuses existing application artefacts such as CDS views, events, and actions.

Object Structure

The object is represented by one or more structures in the form of CDS views. The demo objects flight and booking each use only one CDS view.

object%20structure

With the structure, you also define the semantic keys that represent your object on the UI, for example, in Manage Situation Types – Extended instance list.  On the UI, the semantic keys are concatenated in the corresponding sequence and displayed like this: LH/3598/20220217/1234567. Additionally, you assign the value helps used for filters, as in the condition section of Manage Situation Types – Extended app. You need to define only semantic value helps. Generic formats, such as numbers, dates, and Booleans are handled by default.

object%20structure%20details

Object Events

You can assign multiple events to the object. These events can trigger a situation.

object%20events

Object Actions

You can also assign actions related to the object. The end user can use them to solve a situation. This requires the assignment of a callback class and the required parameters.

object%20callbacks

For instance, if an action deletes a booking, you need the corresponding parameters that specify the exact booking object.

callback%20parameters

Navigation Targets

In some cases, there are no specific actions available that could resolve a situation, or a situation may be too complex to be handled with one click. To support the end user, you can define navigation targets to related apps that help solving a situation.

navigation%20targets

Define the intent-based navigation with the semantic object and the semantic object action. If you want to navigate to a specific page in the app, you need to provide parameters.

End User Actions

Finally, you specify the buttons that appear on the situation page in the My Situations – Extended app. Select the callback or navigation target and enter a button name and a button description.

delete%20booking%20action

The end user finds the buttons for callback actions in the Solution Proposals section.

solution%20proposal%20button

The buttons for navigation targets are shown in the Related Apps section.

related%20apps%20button

And that’s it. That’s all there is to it. Your situation object is complete.

In the next blog post (3/6) you’ll see how to create a Situation Scenario that describes a specific business area. There you map an anchor object that will be affected by situations to multiple objects that can trigger a situation.

  • Custom Situation Cases: Configure your own use cases (1/6)
  • Custom Situation Cases: Model your own Situation Objects (2/6)
  • Custom Situation Cases: Create your own Situation Scenarios (3/6)
  • Custom Situation Cases: Configure a Simple Use Case (4/6)
  • Custom Situation Cases: Configure an Escalation Case (5/6)
  • Custom Situation Cases: Configure a Complex Use Case (6/6)

Let me point you to further information: