Change History

SAP Business ByDesign

Overview

Do you desire to track who changed your document?

You can use an embedded component to ensure that a change history is written for all changes made to your custom business object. After adding the embedded component to your business object, you can display the change history in the SAP cloud solution on the Changes tab of your work center. All changes such as add, create, and delete is displayed in a list.


Prerequisites

1. You have created users with the Developer and Business User roles.
2. You have created and opened a solution in the studio.


Procedure

Create a customer BO & Screens

  1. Create a custom Business Object (Change Log).
  2. Define elements/node as shown in the below screenshot. At least one element/node/association in your business object is annotated with ChangeHistory.
  3. Save and Activate.
    For more information about the Custom Business Object creation, see http://blog.sankaranss.com/2016/03/29/sap-byd-business-object/.
  4. Right click on BO name -> Create Screens.
  5. Generate all screens.
    For more information about the screen generation,
    see http://blog.sankaranss.com/2016/04/28/sap-byd-screen-types/.

change history

 

Add an Embedded Component to the Object Instance Floorplan (OIF)

  1. In the Studio, in the Solution Explorer, double-click the object instance floorplan (OIF).
    The UI designer opens.
  2. On the Designer tab, click the Changes tab.
  3. In the Configuration Explorer, navigate to the ChangeDocuments_EC reuse component in the SAP_BYD_APPLICATION_UI/Reuse/ChangeHistory folder.
  4. Drag the reuse component to the top left pane of the OIF as shown in the graphic and then save your changes.

change history

  Create an Outport

  1. On the Controller tab, right-click Outports and select Add Outport.
    The Outport Configuration: OutPort pane opens.
  2. Click the Add Parameter button.
  3. In the ParameterName field, enter ECORootNodeID as shown in the screenshot and save your changes.
  4. Next, to ParameterBinding, click … .
    The Parameter Binding dialog box opens.
  5. Select NodeID and click OK.

change history

 Bind with EC Component

  1. On the Changes tab, click Bind. The Embedded Component Binding dialog box opens.
  2. Right-click Navigations and select Add Navigation.
  3. Bind the outport parameters as shown in the below screenshot.
  4. Click OK and save your changes.

change history

Create an Event Handler

  1. On the Controller tab, right-click Event Handlers and select Add EventHandler.
    The new event handler is displayed under Event Handlers.
  2. Right-click the new event handler and select Rename; then enter a new name for the event handler.
  3. Under EventHandler Operations, click the Add Operation button.
  4. Under Type, click in the field and then select FireOutport.
  5. Under Configure the operation, select your outport (ChangeHistoryOutport) and save your changes.

change history

To ensure that the user can open the embedded component by clicking the Changes tab, associate the new event handler with the OnClick event.
a. Click the Properties tab.
b. On the Designer tab, click the Changes tab and then click the Properties tab again.
c. On the Properties tab, under Events OnClick, select the event handler you created and then save your changes.

change history

 Specify the configuration parameters

  1. Select the embedded component and click the Properties tab.
  2. Under Parameters, specify the following parameters by clicking the arrow to the right of each field:
    • BOName
    • BONameSpace
    • ECOName
    • ECONameSpace
  3. Save and activate the floorplan.

change history

Activate your business configuration, right-click the solution and select Deploy Business Configuration.
The system deploys the business configuration content you created and makes the field values available in the development environment.


Testing

  1. Log on to the cloud solution as a business user and assign the work center that has the same name as
    your business object to your service agent.
  2. Navigate to the work center you created and click Edit.
  3. Enter data in one or more of the fields and save your changes.
  4. On the right of the screen, click View All.
  5. Select Close and Refresh.
    Your changes are displayed on the Changes tab.

change history

 

In the next article, we will learn how to access this change history via absl script with the suitable example.
If you like to add some points to this article, kindly leave your points as comments. Don’t forget to subscribe it.

Reference: © 2017 SAP SE. All rights reserved.