Skip to Content

Any coding or configuration examples provided in this document are only examples and are NOT intended for use in a productive system. The example is only done to better explain and visualize the topic.

The objective of this blog is to explain how can we extend Utilities Premise Overview & Connection Details facets of Premise Thing Inspector (TI).

Blog will also explain 1708 C4C Utilities enhancement which makes mapping of standard fields easier.

Below is the detailed scope of this Blog: –

  • Mapping Standard fields of Premise Overview & Connection Details facets.
  • Premise Overview
    • Extending  Premise Highlights – Add custom highlights.
  • Customer History
    • Adding extension fields.
    • Populating the extension fields using C4C SDK.
  • Connection Details
    • Add extension fields to Details View of an Installation.

Below will be our targeted Premise Thing Inspector (TI) with the additional fields added and populated in Overview and Connection Details Tabs.

Overview:-

Connection Details:-

Implementation Details: –

  1. Create a solution in PDI.
  2. Create Extension BO for adding extension fields.
  3. Extending Premise Overview and Connection Details UIs.
  4. Implement Premise Enhancement Implementation.
    1. Add Premise Enhancement Implementation
    2. Implement the Premise enhancement Implementation  to map the standard fields & add custom logic for populating extension fields.
      1. Premise Overview – Extending Premise Highlights
      2. Adding additional field to Customer History & Populating the extension field
      3. Add additional Information to Connection Details View of Premise at Installation level.

1. Create a solution in PDI

Provide required information for the creation of Solution.

2. Create Extension BO for adding extension fields

Add a new item “Business Object Extension”

Select the Utility specific business object for extension.

Namespace :- http://sap.com/xi/AP/CRM/Global

Business Object :- UtilitiesExtensibility

For Extending Premise Overview & Connection Details below will the nodes which you need extend.

  • Premise Overview Highlights – PremiseHighlights
  • Premise Overview Customer – PremiseCustomerHistory
  • Premise Connection Details – PremiseObjHier

You can refer below code snippet for reference.

import AP.Common.GDT;
import AP.CRM.Global;

[Extension] businessobject AP.CRM.Global:UtilitiesExtensibility {
 
   		node PremiseHighlights {
   	    } 
    
   		node PremiseCustomerHistory {
			[Label("Customer VIP Status")] element Customer_VIP_Status : Indicator;
   	    } 
 
   		node PremiseObjHier {
			[Label("Additional Details")] element Additional_Details : LANGUAGEINDEPENDENT_EXTENDED_Text;
   	    }  
}

In the above example we have included additional Info about Customer whether he has VIP status and Additional Object level Information in Connection Details.

3. Extending Premise Overview and Connection Details UIs

To extend the UI’s for the above enhancement select “Enhance Screen” option by right clicking on the business object extension.

Select the targeted UIs-

  • Premise Overview Highlights - COD_UTILITIES_PREMISE_VIEW_EC
  • Premise Overview Customer Overview - COD_UTILITIES_PREMISE_VIEW_EC
  • Premise Connection Details – COD_UTILITIES_PREMISE_CONNECTION_DETAILS_E

Premise Overview 

UI Path - /BYD_COD/IndustrySolution/Utilities/UI/Extensibility/COD_UTILITIES_PREMISE_VIEW_EC.EC.uicomponent

Adding extension field to the Customer Overview List:-

Select anchor called “Customer Overview” to add the extension field added under “PremiseCustomerHistory” Node.

Once field is selected and applied – “Save and Activate”.

Premise Connection Details

UI Path - /BYD_COD/IndustrySolution/Utilities/Premise/UI/COD_UTILITIES_PREMISE_CONNECTION_DETAILS_EC.EC.uicomponent

Adding extension field to the Details:-

Select anchor called “Details” to add the extension field added under “PremiseObjHier” Node.

Once field is selected and applied – “Save and Activate”.

4. Implement Premise Enhancement Implementation

With above changes both of the UIs are enhanced with your extension fields, now we need to populate data to those fields.

For this you need to implement Enhancement Implementation provided for Premise

Note :- With C4C 1708 mapping of standard fields in Enhancement implementation became easier as Standard fields will be prefetched and will be part of input parameter.

4.1 Add Premise Enhancement Implementation

4.2 Implement the Premise Enhancement Implementation to map the standard fields & add custom logic for populating extension fields.

4.2.1 Premise Overview – Extending Premise Highlights

import AP.CRM.Global;
import AP.Common.GDT;

var result : UtilitiesPremiseBadiResult;
var HighlightsDetails_Entry : UtilitiesPremiseHighlights;

result.UtilitiesPremiseCustomerHistory = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseCustomerHistory;
result.UtilitiesPremiseObjectHierarchy = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchy;
result.UtilitiesPremiseObjectHierarchyConnectionObjectDetails = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchyConnectionObjectDetails;
result.UtilitiesPremiseObjectHierarchyPremiseDetails = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchyPremiseDetails;
result.UtilitiesPremiseObjectHierarchyInstallationDetails =  InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchyInstallationDetails;
result.UtilitiesPremiseObjectHierarchyRegisterDetails = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchyRegisterDetails;

result.UtilitiesPremiseHighlights = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseHighlights;
HighlightsDetails_Entry.ConnectionStatus = "Custom Highlight Message";
result.UtilitiesPremiseHighlights.Add(HighlightsDetails_Entry);

return result;

4.2.2 Adding additional field to Customer History & Populating the extension field

import AP.CRM.Global;
import AP.Common.GDT;

var result : UtilitiesPremiseBadiResult;
var CustomerHistory_Entry : UtilitiesPremiseCustomerHistory;

result.UtilitiesPremiseHighlights = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseHighlights;
result.UtilitiesPremiseObjectHierarchy = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchy;
result.UtilitiesPremiseObjectHierarchyConnectionObjectDetails = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchyConnectionObjectDetails;
result.UtilitiesPremiseObjectHierarchyPremiseDetails = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchyPremiseDetails;
result.UtilitiesPremiseObjectHierarchyInstallationDetails =  InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchyInstallationDetails;
result.UtilitiesPremiseObjectHierarchyRegisterDetails = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchyRegisterDetails;

foreach(var current in InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseCustomerHistory)
{
	CustomerHistory_Entry = current;
	// The field can be set either by backend ERP call using Web Service or querying locally
	CustomerHistory_Entry.Customer_VIP_Status_2DKPL2E4RX97IFVV7J6QDOBKD = true;
	
	result.UtilitiesPremiseCustomerHistory.Add(CustomerHistory_Entry);
}

return result;

4.2.3 Add additional Information to Connection Details View of Premise at Installation level.

import AP.CRM.Global;
import AP.Common.GDT;

var result : UtilitiesPremiseBadiResult;
var PremiseObjectHierarchy_Entry : UtilitiesPremiseObjectHierarchyElements;

result.UtilitiesPremiseHighlights = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseHighlights;
result.UtilitiesPremiseCustomerHistory = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseCustomerHistory;
result.UtilitiesPremiseObjectHierarchyConnectionObjectDetails = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchyConnectionObjectDetails;
result.UtilitiesPremiseObjectHierarchyPremiseDetails = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchyPremiseDetails;
result.UtilitiesPremiseObjectHierarchyInstallationDetails =  InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchyInstallationDetails;
result.UtilitiesPremiseObjectHierarchyRegisterDetails = InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchyRegisterDetails;

foreach(var current in InputData.UtilitiesPremiseBadiResult.UtilitiesPremiseObjectHierarchy)
{
	PremiseObjectHierarchy_Entry = current;
	// Type code "1" for installation/pod hierarchy node & "2" for device node.
	if(PremiseObjectHierarchy_Entry.TypeCode == "1")
	{
		// The field can be set either by backend ERP call using Web Service or querying locally
		PremiseObjectHierarchy_Entry.Additional_Details_0TOYBNL7GVH8K8ZKDUZI7FGSF = "Additional Installation Info";
	}

	result.UtilitiesPremiseObjectHierarchy.Add(PremiseObjectHierarchy_Entry);
}

return result;

Premise Thing Inspector with above enhancements:-

Premise Overview

Premise Connection Details

To report this post you need to login first.

Be the first to leave a comment

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

Leave a Reply